Seven agents took over LuaEngine (the mod API registration deferred), the rest of Manager (LoadConfigs, fonts, render surfaces, Update/Render), MusicManager/SFXManager, MenuManager with the title/save/game menus, Cutscene/NightmareScene/ Backdrop, RoomConfig (src/rooms ported and retired) with ItemPool, and PersistentGameData (the original binary save format) with InfoDisplay. An integration pass moved call sites to the new APIs, declared the taken-over free functions, fixed two data.cpp crashes (an empty children array, null attribute strings), and made the generator keep a header's own name where a prototype names another address. Clean build (0 warnings with -Wall -Wextra). build/isaac runs the game's Lua scripts (without the mod API yet) and stops at reload_resource_paths. 901 functions taken over, boot path 204/615. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
7518 lines
326 KiB
C++
7518 lines
326 KiB
C++
#include "classes.h"
|
|
|
|
// 008fd530
|
|
uint8_t NetplayManager::process_consolidated_messages()
|
|
{
|
|
uint8_t *this_00;
|
|
int iVar1;
|
|
uint32_t *puVar2;
|
|
uint32_t uVar3;
|
|
NetplayManager *pNVar4;
|
|
char isLastRef;
|
|
uint8_t *isPeerReady;
|
|
int *entryCursor;
|
|
uint8_t findResult [8];
|
|
int lowerBound;
|
|
uint32_t userIdLow;
|
|
uint32_t userIdHigh;
|
|
uint32_t *local_40;
|
|
int *local_3c;
|
|
uint32_t local_38;
|
|
int *piStack_34;
|
|
uint32_t peerIdLow;
|
|
uint32_t peerIdHigh;
|
|
NetplayManager *self;
|
|
uint8_t *puStack_20;
|
|
void *local_1c;
|
|
uint8_t *puStack_18;
|
|
uint32_t local_14;
|
|
int *entriesEnd;
|
|
|
|
puStack_20 = findResult + 0x50;
|
|
puStack_18 = &LAB_00b07edd;
|
|
local_1c = ExceptionList;
|
|
ExceptionList = &local_1c;
|
|
self = this;
|
|
while (local_14 = 0xffffffff, g_multiplayerService != (void *)0x0) {
|
|
entryCursor = (GHIDRA_CAST<NetworkManager *>((g_multiplayerService)))->NetworkManager::receive_message(&local_38,4,0);
|
|
iVar1 = *entryCursor;
|
|
local_14 = 0;
|
|
if (((piStack_34 != GHIDRA_CAST<int *>(0x0)) &&
|
|
(isLastRef = (**(code **)(*piStack_34 + 0xc))(), isLastRef != '\0')) &&
|
|
(g_multiplayerRelease != (void *)0x0)) {
|
|
(*g_multiplayerRelease)(&local_38);
|
|
}
|
|
local_14 = 0xffffffff;
|
|
if (iVar1 == 0) break;
|
|
if (g_multiplayerService == (void *)0x0) {
|
|
KAGE::SmartPointer<MessageData>::reset(0);
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<NetworkManager *>((g_multiplayerService)))->NetworkManager::receive_message(&local_40,4,1);
|
|
}
|
|
puVar2 = local_40;
|
|
local_14 = 1;
|
|
if (local_40[3] != 1) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("This function should only be called on consolidated messages"));
|
|
}
|
|
if (*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(puVar2[2]) + 0x14)) + 8)) == 0) {
|
|
peerIdLow = *local_40;
|
|
peerIdHigh = local_40[1];
|
|
isPeerReady = map_u64_bool_subscript(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[1])) + 0x1))),GHIDRA_CAST<uint64_t *>(&peerIdLow));
|
|
*isPeerReady = 1;
|
|
}
|
|
local_14 = 2;
|
|
if (((local_3c != GHIDRA_CAST<int *>(0x0)) &&
|
|
(isLastRef = (**(code **)(*local_3c + 0xc))(), isLastRef != '\0')) &&
|
|
(g_multiplayerRelease != (void *)0x0)) {
|
|
(*g_multiplayerRelease)(&local_40);
|
|
}
|
|
}
|
|
local_14 = 0xffffffff;
|
|
if (*GHIDRA_CAST<char *>(this) != '\0') {
|
|
entryCursor = GHIDRA_CAST<int *>(g_manager->_netplayManager);
|
|
entriesEnd = *GHIDRA_CAST<int **>((g_manager + 1));
|
|
if (entryCursor != entriesEnd) {
|
|
local_3c = GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(self[1])) + 0x1))));
|
|
do {
|
|
iVar1 = *GHIDRA_CAST<int *>((*entryCursor + 0x374));
|
|
if (iVar1 == 0) {
|
|
local_38 = 0;
|
|
uVar3 = local_38;
|
|
piStack_34 = GHIDRA_CAST<int *>(0x0);
|
|
local_38 = 0;
|
|
userIdHigh = GHIDRA_UINT(piStack_34);
|
|
userIdLow = local_38;
|
|
local_38 = uVar3;
|
|
}
|
|
else {
|
|
userIdHigh = *GHIDRA_CAST<uint32_t *>((iVar1 + 0xc));
|
|
userIdLow = *GHIDRA_CAST<uint32_t *>((iVar1 + 8));
|
|
}
|
|
_local_38 = CONCAT44(userIdLow,local_38);
|
|
peerIdHigh = userIdHigh;
|
|
FUN_00731ee0(findResult,&userIdLow);
|
|
if (((*GHIDRA_CAST<char *>((lowerBound + 0xd)) != '\0') || (peerIdHigh < *GHIDRA_CAST<uint32_t *>((lowerBound + 0x14))))
|
|
|| (((peerIdHigh <= *GHIDRA_CAST<uint32_t *>((lowerBound + 0x14)) &&
|
|
(piStack_34 < *GHIDRA_CAST<uint32_t *>((lowerBound + 0x10)))) || (lowerBound == *local_3c)))) {
|
|
ExceptionList = local_1c;
|
|
return 1;
|
|
}
|
|
entryCursor = entryCursor + 1;
|
|
} while (entryCursor != entriesEnd);
|
|
}
|
|
pNVar4 = self;
|
|
this_00 = &(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(self[1])) + 0x1)));
|
|
*GHIDRA_CAST<uint8_t *>(self) = 0;
|
|
iVar1 = *GHIDRA_CAST<int *>(this_00);
|
|
FID_conflict__Erase_tree<fuzzer::fuzzer_allocator<msvc::_Tree_node<fuzzer::TracePC::PCTableEntry_const*,void*>_>_>
|
|
(this_00,(fuzzer_allocator<msvc::_Tree_node<unsigned_int,void*>_> *)this_00,
|
|
*(_Tree_node<unsigned_int,void*> **)(iVar1 + 4));
|
|
*GHIDRA_CAST<int *>((iVar1 + 4)) = iVar1;
|
|
*GHIDRA_CAST<int *>(iVar1) = iVar1;
|
|
*GHIDRA_CAST<int *>((iVar1 + 8)) = iVar1;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(pNVar4[2])) + 0x2)))) = 0;
|
|
this = self;
|
|
}
|
|
ExceptionList = local_1c;
|
|
return *GHIDRA_CAST<uint8_t *>(this);
|
|
}
|
|
|
|
// 00906a90
|
|
NetplayManager::~NetplayManager()
|
|
{
|
|
NetplayManager *pNVar1;
|
|
void *ptr;
|
|
char cVar2;
|
|
uint32_t uVar3;
|
|
void *local_10;
|
|
uint8_t *puStack_c;
|
|
uint32_t local_8;
|
|
|
|
local_8 = 0xffffffff;
|
|
puStack_c = &LAB_00b08a50;
|
|
local_10 = ExceptionList;
|
|
uVar3 = __security_cookie ^ GHIDRA_INT(register0x00000010) - 4U;
|
|
ExceptionList = &local_10;
|
|
FUN_00a1d6b0(netplay_lobby_join_requested_callback);
|
|
NetplayTextPopup::clear(uVar3);
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x985])) + 0x1)))) = 0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x986])) + 0x2)))) = 0;
|
|
(GHIDRA_CAST<GenericPopup *>((GHIDRA_CAST<GenericPopup *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x912])) + 0x2)))))))->GenericPopup::destructor();
|
|
daily_lobby_join_destructor(this + 0x848);
|
|
pNVar1 = this + 0x834;
|
|
FID_conflict__Erase_tree<fuzzer::fuzzer_allocator<msvc::_Tree_node<fuzzer::TracePC::PCTableEntry_const*,void*>_>_>
|
|
(pNVar1,(fuzzer_allocator<msvc::_Tree_node<unsigned_int,void*>_> *)pNVar1,
|
|
*(_Tree_node<unsigned_int,void*> **)(*GHIDRA_CAST<int *>((this + 0x834)) + 4));
|
|
operator_delete(*(void **)pNVar1,0x20);
|
|
*GHIDRA_CAST<uint8_t ***>((this + 0x830)) = KAGE::Network::Multiplayer::ConstLobby::vftable;
|
|
local_8 = 0;
|
|
if (*GHIDRA_CAST<int **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x832])) + 0x2)))) != GHIDRA_CAST<int *>(0x0)) {
|
|
cVar2 = (**(code **)(**GHIDRA_CAST<int **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x832])) + 0x2)))) + 0xc))();
|
|
if ((cVar2 != '\0') && (g_lobbyReleaseFn != (void *)0x0)) {
|
|
(*g_lobbyReleaseFn)(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x831])) + 0x1))));
|
|
}
|
|
}
|
|
FUN_004b3950();
|
|
msvc::vector<32byte>::_Tidy();
|
|
msvc::vector<24byte>::_Tidy();
|
|
FUN_00914d90(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x821])) + 0x1))),*GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x821])) + 0x1)))) + 4)));
|
|
operator_delete(*(void **)&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x821])) + 0x1))),0x30);
|
|
FUN_00913df0();
|
|
OnlineChat::destructor();
|
|
pNVar1 = this + 0x60c;
|
|
FID_conflict__Erase_tree<fuzzer::fuzzer_allocator<msvc::_Tree_node<fuzzer::TracePC::PCTableEntry_const*,void*>_>_>
|
|
(pNVar1,(fuzzer_allocator<msvc::_Tree_node<unsigned_int,void*>_> *)pNVar1,
|
|
*(_Tree_node<unsigned_int,void*> **)(*GHIDRA_CAST<int *>((this + 0x60c)) + 4));
|
|
operator_delete(*(void **)pNVar1,0x20);
|
|
FUN_00900940();
|
|
msvc::vector<Vector>::_Tidy();
|
|
msvc::vector<Vector>::_Tidy();
|
|
msvc::vector<Vector>::_Tidy();
|
|
msvc::vector<Vector>::_Tidy();
|
|
msvc::vector<Vector>::_Tidy();
|
|
local_8 = 1;
|
|
NetplayTextPopup::clear();
|
|
local_8 = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x1))),2);
|
|
ANM2::Reset(GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x591])) + 0x1)))));
|
|
AnimationState::~AnimationState(GHIDRA_CAST<AnimationState *>((this + 0x5ac)));
|
|
AnimationState::~AnimationState(GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x5a1])) + 0x1)))));
|
|
(GHIDRA_CAST<msvc::string *>((&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x599])) + 0x1))))))->msvc::string::_Tidy_deallocate();
|
|
(GHIDRA_CAST<msvc::string *>((&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x591])) + 0x1))))))->msvc::string::_Tidy_deallocate();
|
|
msvc::deque<36byte>::_Tidy();
|
|
msvc::deque<4byte>::~deque();
|
|
msvc::deque<12byte>::~deque();
|
|
msvc::map<unsigned_long_long_PeerStreams>::destroy_subtree
|
|
(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x57a])) + 0x2))),*GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x57a])) + 0x2)))) + 4)));
|
|
operator_delete(*(void **)&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x57a])) + 0x2))),0xe8);
|
|
FUN_009156e0(this + 0x578,*GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>((this + 0x578)) + 4)));
|
|
operator_delete(*(void **)(this + 0x578),0xfa8);
|
|
FUN_00a58200();
|
|
FUN_00a58200();
|
|
local_8 = 3;
|
|
if (*GHIDRA_CAST<uint32_t **>((this + 0x20)) != GHIDRA_CAST<uint32_t *>(0x0)) {
|
|
(**(code **)**GHIDRA_CAST<uint32_t **>((this + 0x20)))(1);
|
|
}
|
|
PersistentGameData_Bestiary::~PersistentGameData_Bestiary
|
|
(GHIDRA_CAST<PersistentGameData_Bestiary *>((this + 0x540)));
|
|
(GHIDRA_CAST<msvc::string *>((&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x29])) + 0x1))))))->msvc::string::_Tidy_deallocate();
|
|
(GHIDRA_CAST<msvc::string *>((&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x21])) + 0x1))))))->msvc::string::_Tidy_deallocate();
|
|
msvc::vector<Vector>::_Tidy();
|
|
pNVar1 = this + 0x14;
|
|
FID_conflict__Erase_tree<fuzzer::fuzzer_allocator<msvc::_Tree_node<fuzzer::TracePC::PCTableEntry_const*,void*>_>_>
|
|
(pNVar1,(fuzzer_allocator<msvc::_Tree_node<unsigned_int,void*>_> *)pNVar1,
|
|
*(_Tree_node<unsigned_int,void*> **)(*GHIDRA_CAST<int *>((this + 0x14)) + 4));
|
|
operator_delete(*(void **)pNVar1,0x1c);
|
|
msvc::deque<12byte>::_Tidy();
|
|
ptr = *(void **)&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0xd])) + 0x1)));
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0xd])) + 0x1)))) = 0;
|
|
operator_delete(ptr,8);
|
|
FID_conflict__Tidy(this);
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 00906d60
|
|
void NetplayManager::Init()
|
|
{
|
|
NetplayManager *pNVar1;
|
|
char isLastRef;
|
|
LayerState *paperLayer;
|
|
int *jsonEntryRef;
|
|
char *strBuf;
|
|
void *extraout_EAX;
|
|
uint32_t *extraout_EAX_00;
|
|
uint8_t *puVar2;
|
|
uint32_t size;
|
|
NetplayManager *chat;
|
|
uint8_t **ppuVar3;
|
|
void *userRefCount;
|
|
uint8_t auStack_9a [2];
|
|
uint8_t chatMessage [44];
|
|
uint8_t **local_60;
|
|
uint8_t *puStack_5c;
|
|
uint8_t **local_58;
|
|
uint32_t local_54;
|
|
int *local_50;
|
|
NetplayManager *self;
|
|
NetplayManager *local_44;
|
|
std_string local_40;
|
|
uint32_t local_24;
|
|
uint8_t *puStack_20;
|
|
void *local_1c;
|
|
uint8_t *puStack_18;
|
|
uint32_t local_14;
|
|
uint32_t *jsonEntry;
|
|
Manager *manager;
|
|
|
|
puStack_20 = chatMessage + 0x88;
|
|
local_14 = 0xffffffff;
|
|
puStack_18 = &LAB_00b08a9d;
|
|
local_1c = ExceptionList;
|
|
local_24 = __security_cookie ^ GHIDRA_UINT((chatMessage + 0x7c));
|
|
ExceptionList = &local_1c;
|
|
local_40._size = 0;
|
|
local_40._capacity = 0xf;
|
|
local_40._buf[0] = '\0';
|
|
local_40._buf[1] = '\0';
|
|
local_40._buf[2] = '\0';
|
|
local_40._buf[3] = '\0';
|
|
self = this;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_40._buf)) + 0x0))) = msvc::_Allocate(0x20);
|
|
local_40._size = 0x15;
|
|
local_40._capacity = 0x1f;
|
|
builtin_strncpy((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(local_40._buf))) + 0x0))),"gfx/ui/ui_streak.anm2",0x16);
|
|
local_14 = 0;
|
|
ANM2::Load(GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x591])) + 0x1)))),&local_40,1);
|
|
local_14 = 0xffffffff;
|
|
if (0xf < local_40._capacity) {
|
|
size = local_40._capacity + 1;
|
|
strBuf = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(local_40._buf))) + 0x0)));
|
|
if (0xfff < size) {
|
|
strBuf = *GHIDRA_CAST<char **>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_40._buf)) + 0x0))) + -4));
|
|
size = local_40._capacity + 0x24;
|
|
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_40._buf)) + 0x0))) + (-4 - GHIDRA_INT(strBuf))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(strBuf,size);
|
|
}
|
|
paperLayer = ANM2::GetLayer(GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x591])) + 0x1)))),GHIDRA_CAST<uint8_t *>("paper"));
|
|
paperLayer->_visible = 0;
|
|
msvc::list<msvc::pair<int_int>>::push_back();
|
|
msvc::list<msvc::pair<int_int>>::push_back();
|
|
local_40._buf[8] = '\0';
|
|
local_40._buf[9] = '\0';
|
|
local_40._buf[10] = '\0';
|
|
local_40._buf[0xb] = '\0';
|
|
local_40._buf[0xc] = '\0';
|
|
local_40._buf[0xd] = '\0';
|
|
local_40._buf[0xe] = '\0';
|
|
local_40._buf[0xf] = '\0';
|
|
local_40._size = 0;
|
|
local_40._capacity = 0;
|
|
jsonEntryRef = GHIDRA_CAST<int *>(FUN_00a53dd0(&local_44));
|
|
jsonEntry = GHIDRA_CAST<uint32_t *>(*jsonEntryRef);
|
|
strBuf = operator_new_tracked(0xd);
|
|
strncpy(strBuf,"game_version",0xd);
|
|
*jsonEntry = strBuf;
|
|
strBuf = operator_new_tracked(10);
|
|
strncpy(strBuf,"v1.9.7.17",10);
|
|
jsonEntry[2] = strBuf;
|
|
jsonEntry[3] = GHIDRA_INT(strBuf) >> 0x1f;
|
|
local_40._buf[8] = '\0';
|
|
local_40._buf[9] = '\0';
|
|
local_40._buf[10] = '\0';
|
|
local_40._buf[0xb] = '\0';
|
|
local_40._buf[0xc] = '\0';
|
|
local_40._buf[0xd] = '\0';
|
|
local_40._buf[0xe] = '\0';
|
|
local_40._buf[0xf] = '\0';
|
|
local_40._size = 0;
|
|
local_40._capacity = 0;
|
|
jsonEntryRef = GHIDRA_CAST<int *>(FUN_00a53dd0(&local_44));
|
|
jsonEntry = GHIDRA_CAST<uint32_t *>(*jsonEntryRef);
|
|
strBuf = operator_new_tracked(0xd);
|
|
strncpy(strBuf,"build_number",0xd);
|
|
*jsonEntry = strBuf;
|
|
strBuf = operator_new_tracked(5);
|
|
strncpy(strBuf,"J460",5);
|
|
jsonEntry[2] = strBuf;
|
|
jsonEntry[3] = GHIDRA_INT(strBuf) >> 0x1f;
|
|
local_40._buf[0] = '\0';
|
|
local_40._buf[1] = '\0';
|
|
local_40._buf[2] = '\0';
|
|
local_40._buf[3] = '\0';
|
|
local_40._buf[4] = '\0';
|
|
local_40._buf[5] = '\0';
|
|
local_40._buf[6] = '\0';
|
|
local_40._buf[7] = '\0';
|
|
local_40._buf[8] = '\0';
|
|
local_40._buf[9] = '\0';
|
|
local_40._buf[10] = '\0';
|
|
local_40._buf[0xb] = '\0';
|
|
local_40._buf[0xc] = '\0';
|
|
local_40._buf[0xd] = '\0';
|
|
local_40._buf[0xe] = '\0';
|
|
local_40._buf[0xf] = '\0';
|
|
local_40._size = 0;
|
|
local_40._capacity = 0;
|
|
jsonEntryRef = GHIDRA_CAST<int *>(FUN_00a53e50(&local_44));
|
|
jsonEntry = GHIDRA_CAST<uint32_t *>(*jsonEntryRef);
|
|
strBuf = operator_new_tracked(0xd);
|
|
strncpy(strBuf,"game_version",0xd);
|
|
*jsonEntry = strBuf;
|
|
strBuf = operator_new_tracked(10);
|
|
strncpy(strBuf,"v1.9.7.17",10);
|
|
jsonEntry[4] = 2;
|
|
jsonEntry[2] = strBuf;
|
|
jsonEntry[3] = GHIDRA_INT(strBuf) >> 0x1f;
|
|
local_40._buf[0] = '\0';
|
|
local_40._buf[1] = '\0';
|
|
local_40._buf[2] = '\0';
|
|
local_40._buf[3] = '\0';
|
|
local_40._buf[4] = '\0';
|
|
local_40._buf[5] = '\0';
|
|
local_40._buf[6] = '\0';
|
|
local_40._buf[7] = '\0';
|
|
local_40._buf[8] = '\0';
|
|
local_40._buf[9] = '\0';
|
|
local_40._buf[10] = '\0';
|
|
local_40._buf[0xb] = '\0';
|
|
local_40._buf[0xc] = '\0';
|
|
local_40._buf[0xd] = '\0';
|
|
local_40._buf[0xe] = '\0';
|
|
local_40._buf[0xf] = '\0';
|
|
local_40._size = 0;
|
|
local_40._capacity = 0;
|
|
jsonEntryRef = GHIDRA_CAST<int *>(FUN_00a53e50(&local_44));
|
|
jsonEntry = GHIDRA_CAST<uint32_t *>(*jsonEntryRef);
|
|
strBuf = operator_new_tracked(0xd);
|
|
strncpy(strBuf,"build_number",0xd);
|
|
*jsonEntry = strBuf;
|
|
strBuf = operator_new_tracked(5);
|
|
strncpy(strBuf,"J460",5);
|
|
pNVar1 = self;
|
|
local_40._capacity = GHIDRA_UINT(g_userProfile);
|
|
jsonEntry[2] = strBuf;
|
|
manager = g_manager;
|
|
jsonEntry[3] = GHIDRA_INT(strBuf) >> 0x1f;
|
|
jsonEntry[4] = 2;
|
|
chat = self + 0x610;
|
|
local_40._size = GHIDRA_UINT(KAGE)::System::UserProfile::vftable;
|
|
*GHIDRA_CAST<Font **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(self[0x802])) + 0x2)))) = &manager->_font2_TeamMeatEx12;
|
|
local_14 = 1;
|
|
if ((void *)local_40._capacity == (void *)0x0) {
|
|
local_60 = GHIDRA_CAST<uint8_t **>(0x0);
|
|
ppuVar3 = local_60;
|
|
puStack_5c = GHIDRA_CAST<uint8_t *>(0x0);
|
|
local_60 = GHIDRA_CAST<uint8_t **>(0x0);
|
|
local_58 = local_60;
|
|
local_54 = puStack_5c;
|
|
local_60 = ppuVar3;
|
|
}
|
|
else {
|
|
local_58 = *GHIDRA_CAST<uint8_t ***>((local_40._capacity + 8));
|
|
local_54 = GHIDRA_CAST<uint8_t *>(*GHIDRA_CAST<uint32_t *>((local_40._capacity + 0xc)));
|
|
}
|
|
local_44 = self + 0x614;
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(self[0x61a])) + 0x2))))) {
|
|
local_44 = *GHIDRA_CAST<NetplayManager **>(local_44);
|
|
}
|
|
_local_60 = CONCAT44(auStack_9a + -10,local_60);
|
|
(GHIDRA_CAST<UserProfile *>((&local_58)))->UserProfile::find_or_create();
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 2;
|
|
ppuVar3 = KAGE::System::UserProfile::vftable;
|
|
userRefCount = extraout_EAX;
|
|
if (((extraout_EAX != (void *)0x0) &&
|
|
(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(extraout_EAX) + 8)) != 0 || *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(extraout_EAX) + 0xc)) != 0)) &&
|
|
(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(extraout_EAX) + 0x14)) == 0)) {
|
|
(GHIDRA_CAST<KAGE::System::UserProfile *>((auStack_9a + -10)))->KAGE::System::UserProfile::load_steam_avatar();
|
|
}
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 1;
|
|
(GHIDRA_CAST<OnlineChatMessage *>((chatMessage)))->OnlineChatMessage::constructor(chat,GHIDRA_CAST<uint8_t *>(local_44),ppuVar3,userRefCount,1.0);
|
|
local_14 = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))),3);
|
|
*GHIDRA_CAST<uint32_t *>((pNVar1 + 0x61c)) = *extraout_EAX_00;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(pNVar1[0x61e])) + 0x2)))) = extraout_EAX_00[2];
|
|
FormattedText::operator_assign(pNVar1 + 0x620,extraout_EAX_00 + 3);
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(pNVar1[0x625])) + 0x1)))) = extraout_EAX_00[7];
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(pNVar1[0x626])) + 0x2)))) = extraout_EAX_00[8];
|
|
*GHIDRA_CAST<uint32_t *>((pNVar1 + 0x628)) = extraout_EAX_00[9];
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(pNVar1[0x629])) + 0x1)))) = extraout_EAX_00[10];
|
|
msvc::vector<12byte>::clear();
|
|
msvc::vector<12byte>::_Tidy();
|
|
local_14 = 0xffffffff;
|
|
load_mute_list();
|
|
pNVar1 = self;
|
|
reset(self,1);
|
|
daily_lobby_join_init();
|
|
local_40._size = 0;
|
|
local_40._capacity = 0;
|
|
KAGE::Network::Multiplayer::ConstLobby::ConstLobby<id>();
|
|
local_14 = 4;
|
|
(GHIDRA_CAST<msvc::shared_ptr *>((&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(pNVar1[0x982])) + 0x2))))))->msvc::shared_ptr::assign(&local_54);
|
|
local_58 = KAGE::Network::Multiplayer::ConstLobby::vftable;
|
|
local_14 = 5;
|
|
if (local_50 != GHIDRA_CAST<int *>(0x0)) {
|
|
isLastRef = (**(code **)(*local_50 + 0xc))();
|
|
if ((isLastRef != '\0') && (g_lobbyReleaseFn != (void *)0x0)) {
|
|
(*g_lobbyReleaseFn)();
|
|
}
|
|
}
|
|
local_14 = 0xffffffff;
|
|
FUN_008370f0();
|
|
puVar2 = &(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(pNVar1[0x979])) + 0x1)));
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((pNVar1 + 0x980))) {
|
|
puVar2 = *GHIDRA_CAST<uint8_t **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(pNVar1[0x979])) + 0x1))));
|
|
}
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(pNVar1[0x97e])) + 0x2)))) = 0;
|
|
*puVar2 = 0;
|
|
ExceptionList = local_1c;
|
|
return;
|
|
}
|
|
|
|
// 00907c10
|
|
uint8_t NetplayManager::is_user_in_player_list(uint64_t userId)
|
|
{
|
|
Entity_Player **playerSlot;
|
|
uint32_t playerIndex;
|
|
uint32_t playerCount;
|
|
uint32_t idLow;
|
|
uint32_t idHigh;
|
|
float profile;
|
|
|
|
playerSlot = *GHIDRA_CAST<Entity_Player ***>(this);
|
|
playerIndex = 0;
|
|
playerCount = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[1])) + 0x1)))) - GHIDRA_INT(playerSlot) >> 2;
|
|
if (playerCount != 0) {
|
|
do {
|
|
profile = ((*playerSlot)->_sizeMulti).x;
|
|
if (profile == 0.0) {
|
|
idHigh = 0;
|
|
idLow = 0;
|
|
}
|
|
else {
|
|
idLow = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(profile) + 8));
|
|
idHigh = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(profile) + 0xc));
|
|
}
|
|
if (userId == CONCAT44(idHigh,idLow)) {
|
|
return 1;
|
|
}
|
|
playerIndex = playerIndex + 1;
|
|
playerSlot = playerSlot + 1;
|
|
} while (playerIndex < playerCount);
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
// 00908e70
|
|
void NetplayManager::QueueRemovePlayer(float *param_1)
|
|
{
|
|
char cVar1;
|
|
uint8_t bVar2;
|
|
Entity_Player *pEVar3;
|
|
uint32_t uVar4;
|
|
PlayerManager *in_ECX;
|
|
uint32_t uVar5;
|
|
uint32_t size;
|
|
void *ptr;
|
|
float fVar6;
|
|
uint32_t uStack_40;
|
|
Entity_Player *pEStack_3c;
|
|
uint32_t uStack_38;
|
|
void *pvStack_34;
|
|
uint32_t uStack_30;
|
|
int iStack_2c;
|
|
uint64_t uStack_28;
|
|
uint64_t local_20;
|
|
void *local_10;
|
|
uint8_t *puStack_c;
|
|
uint32_t uStack_8;
|
|
|
|
uStack_8 = 0xffffffff;
|
|
puStack_c = &LAB_00b08d9d;
|
|
local_10 = ExceptionList;
|
|
ExceptionList = &local_10;
|
|
if ((GHIDRA_CAST<Vector *>((param_1 + 1)))->x == 0.0) {
|
|
local_20 = 0;
|
|
}
|
|
(**(code **)(GHIDRA_INT(*param_1) + 4))(__security_cookie ^ GHIDRA_INT(register0x00000010) - 4U);
|
|
KAGE_LogMessage(1,(uint8_t *)
|
|
"[Frame: %d] NetManager::QueueRemovePlayer() Queueing remove player \"%s\" %llu \n"
|
|
);
|
|
fVar6 = (GHIDRA_CAST<Vector *>((param_1 + 1)))->x;
|
|
if (fVar6 == 0.0) {
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_20)) + 0x4))) = GHIDRA_CAST<Entity_Player *>(0x0);
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_20)) + 0x0))) = 0;
|
|
}
|
|
else {
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_20)) + 0x0))) = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(fVar6) + 8));
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_20)) + 0x4))) = *GHIDRA_CAST<Entity_Player **>((GHIDRA_CAST<char *>(fVar6) + 0xc));
|
|
}
|
|
pEVar3 = (GHIDRA_CAST<PlayerManager *>((in_ECX)))->PlayerManager::get_player_by_user_id(&local_20);
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_20)) + 0x4))) = pEVar3;
|
|
if (pEVar3 != GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
if ((char)in_ECX[0x15]._coopSlots[0]._state == '\0') {
|
|
cVar1 = FUN_008feaa0(pEVar3);
|
|
if (cVar1 != '\0') {
|
|
if (fVar6 == 0.0) {
|
|
uStack_28 = 0;
|
|
}
|
|
(**(code **)(GHIDRA_INT(*param_1) + 4))();
|
|
KAGE_LogMessage(1,(uint8_t *)
|
|
"[Frame: %d] NetManager::QueueRemovePlayer() Player \"%s\" %llu is already queued to by dropped by the Desync Handler (Removing player from Desync Handler) \n"
|
|
);
|
|
fVar6 = (((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_20)) + 0x4))))->_sizeMulti).x;
|
|
if (fVar6 == 0.0) {
|
|
uStack_28 = 0;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(uStack_28)) + 0x4))) = 0;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(uStack_28)) + 0x0))) = 0;
|
|
uVar4 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(uStack_28)) + 0x4)));
|
|
uVar5 = (uint32_t)uStack_28;
|
|
}
|
|
else {
|
|
uVar4 = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(fVar6) + 0xc));
|
|
uVar5 = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(fVar6) + 8));
|
|
}
|
|
FUN_008feaf0(uVar5,uVar4);
|
|
fVar6 = (GHIDRA_CAST<Vector *>((param_1 + 1)))->x;
|
|
}
|
|
if (fVar6 == 0.0) {
|
|
uStack_28 = 0;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(uStack_28)) + 0x4))) = 0;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(uStack_28)) + 0x0))) = 0;
|
|
uVar4 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(uStack_28)) + 0x4)));
|
|
uVar5 = (uint32_t)uStack_28;
|
|
}
|
|
else {
|
|
uVar4 = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(fVar6) + 0xc));
|
|
uVar5 = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(fVar6) + 8));
|
|
}
|
|
bVar2 = is_player_removal_queued(GHIDRA_CAST<NetplayManager *>(in_ECX),CONCAT44(uVar4,uVar5));
|
|
if (bVar2 != 0) {
|
|
if (fVar6 == 0.0) {
|
|
uStack_28 = 0;
|
|
}
|
|
(**(code **)(GHIDRA_INT(*param_1) + 4))();
|
|
KAGE_LogMessage(1,(uint8_t *)
|
|
"[Frame: %d] NetManager::QueueRemovePlayer() Player \"%s\" %llu is already queued for removal (Ignoring queue request) \n"
|
|
);
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
if (fVar6 == 0.0) {
|
|
uStack_28 = 0;
|
|
}
|
|
(**(code **)(GHIDRA_INT(*param_1) + 4))();
|
|
KAGE_LogMessage(1,(uint8_t *)
|
|
"[Frame: %d] NetManager::QueueRemovePlayer() Adding player \"%s\" %llu to pending removals\n"
|
|
);
|
|
uStack_40 = 0;
|
|
pEStack_3c = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_20)) + 0x4)));
|
|
uStack_38 = 0;
|
|
pvStack_34 = (void *)0x0;
|
|
uStack_30 = 0;
|
|
iStack_2c = 0;
|
|
uStack_8 = 0;
|
|
FUN_00913ac0(&uStack_40);
|
|
if (pvStack_34 == (void *)0x0) {
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
size = iStack_2c - GHIDRA_INT(pvStack_34) & 0xfffffff8;
|
|
ptr = pvStack_34;
|
|
if (0xfff < size) {
|
|
ptr = *(void **)(GHIDRA_CAST<char *>(pvStack_34) + -4);
|
|
size = size + 0x23;
|
|
if (0x1f < GHIDRA_UINT((GHIDRA_INT(pvStack_34) + (-4 - GHIDRA_INT(ptr))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(ptr,size);
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
param_1 = &pEVar3->_size;
|
|
}
|
|
RemoveRemotePlayer(GHIDRA_CAST<NetplayManager *>(in_ECX),param_1);
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 00909120
|
|
uint8_t NetplayManager::is_player_removal_queued(uint64_t userId)
|
|
{
|
|
int profile;
|
|
int iVar2;
|
|
int *entryPlayer;
|
|
uint32_t i;
|
|
uint32_t profileIdLow;
|
|
uint32_t uStack_8;
|
|
int profile;
|
|
|
|
iVar2 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x825])) + 0x1)))) - *GHIDRA_CAST<int *>((this + 0x824));
|
|
profile = iVar2 >> 0x1f;
|
|
iVar2 = iVar2 / 0x18 + profile;
|
|
i = 0;
|
|
if (iVar2 != profile) {
|
|
entryPlayer = GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((this + 0x824)) + 4));
|
|
do {
|
|
profile = *GHIDRA_CAST<int *>((*entryPlayer + 0x374));
|
|
if (profile == 0) {
|
|
uStack_8 = 0;
|
|
profileIdLow = 0;
|
|
}
|
|
else {
|
|
profileIdLow = *GHIDRA_CAST<uint32_t *>((profile + 8));
|
|
uStack_8 = *GHIDRA_CAST<uint32_t *>((profile + 0xc));
|
|
}
|
|
if (userId == CONCAT44(uStack_8,profileIdLow)) {
|
|
return 1;
|
|
}
|
|
i = i + 1;
|
|
entryPlayer = entryPlayer + 6;
|
|
} while (i < GHIDRA_UINT((iVar2 - profile)));
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
// 009091a0
|
|
void NetplayManager::RemoveRemotePlayer(void *userProfile)
|
|
{
|
|
void **ppvVar1;
|
|
uint64_t qVar2;
|
|
Entity *pEVar3;
|
|
Vector VVar4;
|
|
uint8_t bVar5;
|
|
char isLastRef;
|
|
uint32_t uVar6;
|
|
Entity_Player *pEVar7;
|
|
int iVar8;
|
|
Vector *spawnPos;
|
|
Entity_Player *pocketOwner;
|
|
uint32_t uVar9;
|
|
uint8_t unusedBool;
|
|
int *playerSlot;
|
|
float idLow;
|
|
uint32_t playerIndex;
|
|
float fVar10;
|
|
uint64_t *allocatedBytes;
|
|
void *pvVar11;
|
|
uint32_t playerCount;
|
|
int64_t userId;
|
|
void *pvVar12;
|
|
uint8_t *puVar13;
|
|
Vector VStack_7c;
|
|
NetplayManager *self;
|
|
uint8_t auStack_70 [12];
|
|
int *local_64;
|
|
uint32_t uStack_60;
|
|
Entity_Player *pEStack_5c;
|
|
Entity *local_54;
|
|
int local_50;
|
|
float local_4c;
|
|
Vector scratchVec;
|
|
uint32_t dropMessage [2];
|
|
uint64_t dropUserId;
|
|
uint32_t local_30;
|
|
uint32_t local_24;
|
|
uint8_t *puStack_20;
|
|
void *local_1c;
|
|
uint8_t *puStack_18;
|
|
uint32_t local_14;
|
|
Game *game;
|
|
Manager *manager;
|
|
int *playerList;
|
|
Room *room;
|
|
int userProfileData;
|
|
|
|
puStack_20 = GHIDRA_CAST<uint8_t *>((dropMessage + 0xf));
|
|
local_14 = 0xffffffff;
|
|
puStack_18 = &LAB_00b08dd5;
|
|
local_1c = ExceptionList;
|
|
uVar6 = __security_cookie ^ GHIDRA_UINT((dropMessage + 0xc));
|
|
ExceptionList = &local_1c;
|
|
local_54 = userProfile;
|
|
iVar8 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(userProfile) + 4));
|
|
if (iVar8 == 0) {
|
|
scratchVec.x = 0.0;
|
|
scratchVec.y = 0.0;
|
|
VVar4 = scratchVec;
|
|
scratchVec.y = 0.0;
|
|
scratchVec.x = 0.0;
|
|
fVar10 = scratchVec.y;
|
|
idLow = scratchVec.x;
|
|
scratchVec = VVar4;
|
|
}
|
|
else {
|
|
fVar10 = *GHIDRA_CAST<float *>((iVar8 + 0xc));
|
|
idLow = *GHIDRA_CAST<float *>((iVar8 + 8));
|
|
}
|
|
self = this;
|
|
local_24 = uVar6;
|
|
remove_drop_entry(this,CONCAT44(fVar10,idLow));
|
|
iVar8 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(userProfile) + 4));
|
|
if (iVar8 == 0) {
|
|
scratchVec.x = 0.0;
|
|
scratchVec.y = 0.0;
|
|
VVar4 = scratchVec;
|
|
scratchVec.y = 0.0;
|
|
scratchVec.x = 0.0;
|
|
fVar10 = scratchVec.y;
|
|
idLow = scratchVec.x;
|
|
scratchVec = VVar4;
|
|
}
|
|
else {
|
|
fVar10 = *GHIDRA_CAST<float *>((iVar8 + 0xc));
|
|
idLow = *GHIDRA_CAST<float *>((iVar8 + 8));
|
|
}
|
|
bVar5 = is_user_in_player_list(this,CONCAT44(fVar10,idLow));
|
|
if (bVar5 == 0) {
|
|
dropMessage[0] = 4;
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(userProfile) + 4)) == 0) {
|
|
dropUserId = 0;
|
|
}
|
|
else {
|
|
dropUserId = *GHIDRA_CAST<uint64_t *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(userProfile) + 4)) + 8));
|
|
}
|
|
local_30 = *GHIDRA_CAST<uint32_t *>((this + 4));
|
|
if (g_multiplayerService == (void *)0x0) {
|
|
KAGE_LogMessage(0x10,(uint8_t *)
|
|
"Attempting to create a message when there is no multiplayer service\n");
|
|
}
|
|
puVar13 = &DAT_00000005;
|
|
pvVar12 = (void *)0x18;
|
|
NetConnection::send_message(g_multiplayerService,auStack_70 + 8,1,dropMessage,0x18,5);
|
|
local_14 = 0;
|
|
FUN_008ef1d0(auStack_70 + 8);
|
|
multiplayer_send_message(userProfile,pvVar12,puVar13);
|
|
local_14 = 1;
|
|
if (((local_64 != GHIDRA_CAST<int *>(0x0)) &&
|
|
(isLastRef = (**(code **)(*local_64 + 0xc))(), isLastRef != '\0')) &&
|
|
(g_multiplayerRelease != (void *)0x0)) {
|
|
(*g_multiplayerRelease)(auStack_70 + 8);
|
|
}
|
|
local_14 = 0xffffffff;
|
|
}
|
|
local_4c = 0.0;
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x81e])) + 0x2)))) - *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x81d])) + 0x1)))) >> 4 != 0) {
|
|
local_50 = 0;
|
|
do {
|
|
scratchVec = (Vector)FUN_00a23920(uVar6);
|
|
FUN_00914480(&scratchVec);
|
|
local_4c = (float)(GHIDRA_INT(local_4c) + 1);
|
|
local_50 = local_50 + 0x10;
|
|
} while (GHIDRA_UINT(local_4c) <
|
|
GHIDRA_UINT((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x81e])) + 0x2)))) - *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x81d])) + 0x1)))) >> 4)));
|
|
userProfile = local_54;
|
|
}
|
|
iVar8 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(((GHIDRA_CAST<Entity *>(userProfile)))) + 0x4))));
|
|
if (iVar8 == 0) {
|
|
scratchVec.x = 0.0;
|
|
scratchVec.y = 0.0;
|
|
local_4c = 0.0;
|
|
local_50 = 0;
|
|
}
|
|
else {
|
|
local_50 = *GHIDRA_CAST<uint32_t *>((iVar8 + 8));
|
|
local_4c = *GHIDRA_CAST<float *>((iVar8 + 0xc));
|
|
}
|
|
(**(code **)(*GHIDRA_CAST<int *>(userProfile) + 4))();
|
|
KAGE_LogMessage(1,(uint8_t *)
|
|
"[Frame: %d] NetManager::RemoveRemotePlayer(UserProfile) Removing remote player \"%s\" %llu \n"
|
|
);
|
|
pvVar12 = (g_manager->_lobbyMembers)._begin;
|
|
pEStack_5c = (g_manager->_lobbyMembers)._end;
|
|
if (pvVar12 != pEStack_5c) {
|
|
LAB_009093b4:
|
|
iVar8 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar12) + 4));
|
|
if (iVar8 == 0) {
|
|
scratchVec.x = 0.0;
|
|
scratchVec.y = 0.0;
|
|
local_50 = 0;
|
|
local_4c = 0.0;
|
|
}
|
|
else {
|
|
local_4c = *GHIDRA_CAST<float *>((iVar8 + 8));
|
|
local_50 = *GHIDRA_CAST<uint32_t *>((iVar8 + 0xc));
|
|
}
|
|
pvVar11 = (void *)(GHIDRA_INT(pvVar12) + 0x14);
|
|
userId = FUN_00a23920();
|
|
if (userId != CONCAT44(local_50,local_4c)) goto LAB_009093f2;
|
|
if (pvVar11 == pEStack_5c) {
|
|
pEVar7 = pEStack_5c;
|
|
}
|
|
else {
|
|
puVar13 = GHIDRA_CAST<uint8_t *>((GHIDRA_INT(pvVar12) + 8));
|
|
do {
|
|
*GHIDRA_CAST<uint32_t *>((puVar13 + -4)) = *GHIDRA_CAST<uint32_t *>((puVar13 + 0x10));
|
|
pvVar11 = (void *)(GHIDRA_INT(pvVar11) + 0x14);
|
|
*puVar13 = puVar13[0x14];
|
|
*GHIDRA_CAST<uint32_t *>((puVar13 + 4)) = *GHIDRA_CAST<uint32_t *>((puVar13 + 0x18));
|
|
*GHIDRA_CAST<uint32_t *>((puVar13 + 8)) = *GHIDRA_CAST<uint32_t *>((puVar13 + 0x1c));
|
|
puVar13 = puVar13 + 0x14;
|
|
} while (pvVar11 != pEStack_5c);
|
|
pEVar7 = (g_manager->_lobbyMembers)._end;
|
|
}
|
|
manager = g_manager;
|
|
*GHIDRA_CAST<uint8_t ***>((GHIDRA_CAST<char *>(pEVar7) + -0x14)) = KAGE::System::UserProfileBase::vftable;
|
|
ppvVar1 = &(manager->_lobbyMembers)._end;
|
|
*ppvVar1 = (void *)(GHIDRA_INT(*ppvVar1) + -0x14);
|
|
}
|
|
LAB_00909444:
|
|
iVar8 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((local_54)) + 0x4))));
|
|
if (iVar8 == 0) {
|
|
scratchVec.x = 0.0;
|
|
scratchVec.y = 0.0;
|
|
VVar4 = scratchVec;
|
|
scratchVec.y = 0.0;
|
|
scratchVec.x = 0.0;
|
|
fVar10 = scratchVec.y;
|
|
idLow = scratchVec.x;
|
|
scratchVec = VVar4;
|
|
}
|
|
else {
|
|
fVar10 = *GHIDRA_CAST<float *>((iVar8 + 0xc));
|
|
idLow = *GHIDRA_CAST<float *>((iVar8 + 8));
|
|
}
|
|
FUN_008feaf0(idLow,fVar10);
|
|
iVar8 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[1])) + 0x1))));
|
|
local_64 = *GHIDRA_CAST<int **>(this);
|
|
fVar10 = (float)(iVar8 - GHIDRA_INT(local_64) >> 2);
|
|
local_4c = 0.0;
|
|
scratchVec.y = fVar10;
|
|
if (fVar10 == 0.0) {
|
|
LAB_00909b6b:
|
|
local_64 = GHIDRA_CAST<int *>(0x0);
|
|
VStack_7c.y = *GHIDRA_CAST<float *>(this);
|
|
uVar6 = iVar8 - GHIDRA_INT(VStack_7c.y) >> 2;
|
|
if (uVar6 != 0) {
|
|
playerList = (g_game->_playerManager)._playerList._begin;
|
|
playerCount = GHIDRA_INT((g_game->_playerManager)._playerList._end) - GHIDRA_INT(playerList) >> 2;
|
|
do {
|
|
playerIndex = 0;
|
|
if (playerCount != 0) {
|
|
playerSlot = playerList;
|
|
do {
|
|
iVar8 = *playerSlot;
|
|
if (*GHIDRA_CAST<int *>((iVar8 + 0x1618)) == *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(VStack_7c.y) + 0xc))) {
|
|
if ((iVar8 != 0) && (*GHIDRA_CAST<char *>((iVar8 + 0x20a9)) == '\0')) {
|
|
ExceptionList = local_1c;
|
|
return;
|
|
}
|
|
break;
|
|
}
|
|
playerIndex = playerIndex + 1;
|
|
playerSlot = playerSlot + 1;
|
|
} while (playerIndex < playerCount);
|
|
}
|
|
local_64 = GHIDRA_CAST<int *>((GHIDRA_INT(local_64) + 1));
|
|
VStack_7c.y = (float)(GHIDRA_INT(VStack_7c.y) + 4);
|
|
} while (local_64 < uVar6);
|
|
this = self;
|
|
}
|
|
if (*GHIDRA_CAST<int *>(&g_game->_deathmatchManager) < 2) {
|
|
*GHIDRA_CAST<int *>((this + 0x83c)) = 0;
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x83a])) + 0x2)))) = *GHIDRA_CAST<int *>((this + 4)) + 0x3c;
|
|
}
|
|
ExceptionList = local_1c;
|
|
return;
|
|
}
|
|
while( true ) {
|
|
iVar8 = *local_64;
|
|
userProfileData = *GHIDRA_CAST<int *>((iVar8 + 0x374));
|
|
if (userProfileData == 0) {
|
|
VStack_7c.y = 0.0;
|
|
uStack_60 = 0;
|
|
pEStack_5c = GHIDRA_CAST<Entity_Player *>(0x0);
|
|
}
|
|
else {
|
|
pEStack_5c = *GHIDRA_CAST<Entity_Player **>((userProfileData + 8));
|
|
VStack_7c.y = *GHIDRA_CAST<float *>((userProfileData + 0xc));
|
|
}
|
|
local_50 = iVar8;
|
|
userId = FUN_00a23920();
|
|
if (userId == CONCAT44(VStack_7c.y,pEStack_5c)) break;
|
|
local_4c = (float)(GHIDRA_INT(local_4c) + 1);
|
|
local_64 = local_64 + 1;
|
|
if (GHIDRA_UINT(scratchVec.y) <= GHIDRA_UINT(local_4c)) goto LAB_00909b68;
|
|
}
|
|
if (iVar8 != 0) {
|
|
pEVar7 = GHIDRA_CAST<Entity_Player *>(FUN_004253d0());
|
|
if (pEVar7 == GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
this = self;
|
|
}
|
|
else {
|
|
if (*GHIDRA_CAST<char *>(g_game->_room) != '\0') {
|
|
local_64 = GHIDRA_CAST<int *>(0x2);
|
|
do {
|
|
iVar8 = FUN_004253d0();
|
|
bVar5 = 0;
|
|
scratchVec.x = *GHIDRA_CAST<float *>((iVar8 + 0x33c));
|
|
scratchVec.y = *GHIDRA_CAST<float *>((iVar8 + 0x340));
|
|
spawnPos = Room::FindFreePickupSpawnPosition
|
|
(g_game->_room,&VStack_7c,&scratchVec,0.0,0,0,0);
|
|
(GHIDRA_CAST<Entity_Player *>((pEVar7)))->Entity_Player::DropTrinket(spawnPos,bVar5);
|
|
local_64 = GHIDRA_CAST<int *>((GHIDRA_INT(local_64) + -1));
|
|
} while (local_64 != GHIDRA_CAST<int *>(0x0));
|
|
local_64 = GHIDRA_CAST<int *>(0x0);
|
|
pocketOwner = GHIDRA_CAST<Entity_Player *>(FUN_004253d0());
|
|
uVar6 = (GHIDRA_CAST<Entity_Player *>((pocketOwner)))->Entity_Player::GetMaxPocketItems();
|
|
if (uVar6 != 0) {
|
|
do {
|
|
room = g_game->_room;
|
|
iVar8 = FUN_004253d0();
|
|
scratchVec.x = *GHIDRA_CAST<float *>((iVar8 + 0x33c));
|
|
scratchVec.y = *GHIDRA_CAST<float *>((iVar8 + 0x340));
|
|
spawnPos = Room::FindFreePickupSpawnPosition(room,&VStack_7c,&scratchVec,0.0,0,0,0);
|
|
playerList = local_64;
|
|
(GHIDRA_CAST<Entity_Player *>((pEVar7)))->Entity_Player::DropPocketItem(GHIDRA_INT(local_64),spawnPos);
|
|
local_64 = GHIDRA_CAST<int *>((GHIDRA_INT(playerList) + 1));
|
|
pocketOwner = GHIDRA_CAST<Entity_Player *>(FUN_004253d0());
|
|
playerSlot = GHIDRA_CAST<int *>((GHIDRA_CAST<Entity_Player *>((pocketOwner)))->Entity_Player)::GetMaxPocketItems();
|
|
} while (GHIDRA_CAST<int *>((GHIDRA_INT(playerList) + 1)) < playerSlot);
|
|
}
|
|
bVar5 = (GHIDRA_CAST<Entity_Player *>((pEVar7)))->Entity_Player::HasCollectible(0x147,0);
|
|
if (bVar5 != 0) {
|
|
(GHIDRA_CAST<Entity_Player *>((pEVar7)))->Entity_Player::RemoveCollectible(0x147,0,0,1);
|
|
room = g_game->_room;
|
|
spawnPos = Room::GetCenterPos(GHIDRA_CAST<Vector *>((auStack_70 + 8)));
|
|
Room::FindFreePickupSpawnPosition(room,&scratchVec,spawnPos,0.0,1,0,0);
|
|
uVar6 = Random();
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(5,100,&scratchVec,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0x147,uVar6);
|
|
}
|
|
bVar5 = (GHIDRA_CAST<Entity_Player *>((pEVar7)))->Entity_Player::HasCollectible(0x148,0);
|
|
if (bVar5 != 0) {
|
|
(GHIDRA_CAST<Entity_Player *>((pEVar7)))->Entity_Player::RemoveCollectible(0x148,0,0,1);
|
|
room = g_game->_room;
|
|
spawnPos = Room::GetCenterPos(GHIDRA_CAST<Vector *>((auStack_70 + 8)));
|
|
Room::FindFreePickupSpawnPosition(room,&scratchVec,spawnPos,0.0,1,0,0);
|
|
uVar6 = Random();
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(5,100,&scratchVec,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0x148,uVar6);
|
|
}
|
|
bVar5 = (GHIDRA_CAST<Entity_Player *>((pEVar7)))->Entity_Player::HasCollectible(0xee,0);
|
|
if (bVar5 != 0) {
|
|
(GHIDRA_CAST<Entity_Player *>((pEVar7)))->Entity_Player::RemoveCollectible(0xee,0,0,1);
|
|
room = g_game->_room;
|
|
spawnPos = Room::GetCenterPos(GHIDRA_CAST<Vector *>((auStack_70 + 8)));
|
|
Room::FindFreePickupSpawnPosition(room,&scratchVec,spawnPos,0.0,1,0,0);
|
|
uVar6 = Random();
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(5,100,&scratchVec,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0xee,uVar6);
|
|
}
|
|
bVar5 = (GHIDRA_CAST<Entity_Player *>((pEVar7)))->Entity_Player::HasCollectible(0xef,0);
|
|
if (bVar5 != 0) {
|
|
(GHIDRA_CAST<Entity_Player *>((pEVar7)))->Entity_Player::RemoveCollectible(0xef,0,0,1);
|
|
room = g_game->_room;
|
|
spawnPos = Room::GetCenterPos(GHIDRA_CAST<Vector *>((auStack_70 + 8)));
|
|
Room::FindFreePickupSpawnPosition(room,&scratchVec,spawnPos,0.0,1,0,0);
|
|
uVar6 = Random();
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(5,100,&scratchVec,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0xef,uVar6);
|
|
}
|
|
bVar5 = (GHIDRA_CAST<Entity_Player *>((pEVar7)))->Entity_Player::HasCollectible(0x272,0);
|
|
if (bVar5 != 0) {
|
|
(GHIDRA_CAST<Entity_Player *>((pEVar7)))->Entity_Player::RemoveCollectible(0x272,0,0,1);
|
|
room = g_game->_room;
|
|
spawnPos = Room::GetCenterPos(GHIDRA_CAST<Vector *>((auStack_70 + 8)));
|
|
Room::FindFreePickupSpawnPosition(room,&scratchVec,spawnPos,0.0,1,0,0);
|
|
uVar6 = Random();
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(5,100,&scratchVec,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0x272,uVar6);
|
|
}
|
|
bVar5 = (GHIDRA_CAST<Entity_Player *>((pEVar7)))->Entity_Player::HasCollectible(0x273,0);
|
|
if (bVar5 != 0) {
|
|
(GHIDRA_CAST<Entity_Player *>((pEVar7)))->Entity_Player::RemoveCollectible(0x273,0,0,1);
|
|
room = g_game->_room;
|
|
spawnPos = Room::GetCenterPos(GHIDRA_CAST<Vector *>((auStack_70 + 8)));
|
|
Room::FindFreePickupSpawnPosition(room,&scratchVec,spawnPos,0.0,1,0,0);
|
|
uVar6 = Random();
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(5,100,&scratchVec,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0x273,uVar6);
|
|
}
|
|
EntityList::QuerySublist
|
|
(GHIDRA_CAST<EntityList *>((GHIDRA_INT(g_game->_room) + 0x1218)),GHIDRA_CAST<EntityList_EL *>(auStack_70),6,0xb,-1,
|
|
0,0);
|
|
playerList = GHIDRA_CAST<int *>(0x0);
|
|
local_14 = 2;
|
|
if (local_64 != GHIDRA_CAST<int *>(0x0)) {
|
|
do {
|
|
if (*GHIDRA_CAST<Entity_Player **>((*GHIDRA_CAST<int *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(auStack_70)) + 0x4))) + GHIDRA_INT(playerList) * 4)) + 0x3c8)) ==
|
|
pEVar7) {
|
|
uVar6 = Random();
|
|
iVar8 = *GHIDRA_CAST<int *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(auStack_70)) + 0x4))) + GHIDRA_INT(playerList) * 4));
|
|
scratchVec.x = *GHIDRA_CAST<float *>((iVar8 + 0x33c));
|
|
scratchVec.y = *GHIDRA_CAST<float *>((iVar8 + 0x340));
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0xf,&scratchVec,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,uVar6);
|
|
(**(code **)(**GHIDRA_CAST<int **>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(auStack_70)) + 0x4))) + GHIDRA_INT(playerList) * 4)) + 0x28))();
|
|
}
|
|
playerList = GHIDRA_CAST<int *>((GHIDRA_INT(playerList) + 1));
|
|
} while (playerList < local_64);
|
|
}
|
|
local_14 = 0xffffffff;
|
|
if (auStack_70[0] == '\0') {
|
|
if (g_mainHeap == (void *)0x0) {
|
|
allocatedBytes = &g_allocatedBytesNoHeap;
|
|
}
|
|
else {
|
|
allocatedBytes = GHIDRA_CAST<uint64_t *>((GHIDRA_INT(g_mainHeap) + 0x30));
|
|
}
|
|
if ((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(auStack_70)) + 0x4))) != 0) {
|
|
uVar6 = *GHIDRA_CAST<uint32_t *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(auStack_70)) + 0x4))) + -4));
|
|
qVar2 = *allocatedBytes;
|
|
*GHIDRA_CAST<uint32_t *>(allocatedBytes) = GHIDRA_UINT(*allocatedBytes) - uVar6;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocatedBytes) + 4)) =
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocatedBytes) + 4)) - GHIDRA_UINT((GHIDRA_UINT(qVar2) < uVar6));
|
|
free(GHIDRA_CAST<uint32_t *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(auStack_70)) + 0x4))) + -4)));
|
|
}
|
|
}
|
|
local_14 = 0xffffffff;
|
|
iVar8 = local_50;
|
|
}
|
|
uVar9 = FUN_004253d0();
|
|
this = self;
|
|
userProfileData = *GHIDRA_CAST<int *>((iVar8 + 0x374));
|
|
if (userProfileData == 0) {
|
|
scratchVec.y = 0.0;
|
|
scratchVec.x = 0.0;
|
|
}
|
|
else {
|
|
scratchVec.x = *GHIDRA_CAST<float *>((userProfileData + 8));
|
|
scratchVec.y = *GHIDRA_CAST<float *>((userProfileData + 0xc));
|
|
}
|
|
FUN_0090c740(&scratchVec,uVar9);
|
|
}
|
|
}
|
|
pEStack_5c = GHIDRA_CAST<Entity_Player *>(FUN_004253d0());
|
|
if (pEStack_5c != GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
local_54 = GHIDRA_CAST<Entity *>(pEStack_5c->_twinPlayer);
|
|
(GHIDRA_CAST<Entity_Player *>((pEStack_5c)))->Entity_Player::TriggerDeath(0);
|
|
(GHIDRA_CAST<PlayerManager *>((&g_game->_playerManager)))->PlayerManager::RemoveCoPlayer(pEStack_5c,unusedBool);
|
|
pvVar12 = g_game->_room;
|
|
(GHIDRA_CAST<EntityList_EL *>((GHIDRA_CAST<EntityList_EL *>((GHIDRA_INT(pvVar12) + 0x1238)))))->EntityList_EL::remove(GHIDRA_CAST<Entity *>(pEStack_5c));
|
|
(GHIDRA_CAST<EntityList_EL *>((GHIDRA_CAST<EntityList_EL *>((GHIDRA_INT(pvVar12) + 0x1258)))))->EntityList_EL::remove(GHIDRA_CAST<Entity *>(pEStack_5c));
|
|
(GHIDRA_CAST<EntityList_EL *>((GHIDRA_CAST<EntityList_EL *>((GHIDRA_INT(pvVar12) + 0x1248)))))->EntityList_EL::remove(GHIDRA_CAST<Entity *>(pEStack_5c));
|
|
(GHIDRA_CAST<EntityList_EL *>((GHIDRA_CAST<EntityList_EL *>((GHIDRA_INT(pvVar12) + 0x1268)))))->EntityList_EL::remove(GHIDRA_CAST<Entity *>(pEStack_5c));
|
|
(GHIDRA_CAST<EntityList_EL *>((GHIDRA_CAST<EntityList_EL *>((GHIDRA_INT(pvVar12) + 0x12a8)))))->EntityList_EL::remove(GHIDRA_CAST<Entity *>(pEStack_5c));
|
|
pEStack_5c->_valid = 0;
|
|
EntityList::invalidate_type_cache
|
|
(GHIDRA_CAST<EntityList *>((GHIDRA_INT(pvVar12) + 0x1218)),pEStack_5c->_type,pEStack_5c->_variant,
|
|
pEStack_5c->_subtype);
|
|
game = g_game;
|
|
if (*GHIDRA_CAST<Entity_Player **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((g_game->_playerManager))) + 0x7c)))) == pEStack_5c) {
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((g_game->_playerManager))) + 0x7c)))) = 0;
|
|
}
|
|
if (local_54 != GHIDRA_CAST<Entity *>(0x0)) {
|
|
pvVar12 = game->_room;
|
|
(GHIDRA_CAST<EntityList_EL *>((GHIDRA_CAST<EntityList_EL *>((GHIDRA_INT(pvVar12) + 0x1238)))))->EntityList_EL::remove(local_54);
|
|
(GHIDRA_CAST<EntityList_EL *>((GHIDRA_CAST<EntityList_EL *>((GHIDRA_INT(pvVar12) + 0x1258)))))->EntityList_EL::remove(local_54);
|
|
(GHIDRA_CAST<EntityList_EL *>((GHIDRA_CAST<EntityList_EL *>((GHIDRA_INT(pvVar12) + 0x1248)))))->EntityList_EL::remove(local_54);
|
|
(GHIDRA_CAST<EntityList_EL *>((GHIDRA_CAST<EntityList_EL *>((GHIDRA_INT(pvVar12) + 0x1268)))))->EntityList_EL::remove(local_54);
|
|
(GHIDRA_CAST<EntityList_EL *>((GHIDRA_CAST<EntityList_EL *>((GHIDRA_INT(pvVar12) + 0x12a8)))))->EntityList_EL::remove(local_54);
|
|
local_54->_valid = 0;
|
|
EntityList::invalidate_type_cache
|
|
(GHIDRA_CAST<EntityList *>((GHIDRA_INT(pvVar12) + 0x1218)),local_54->_type,local_54->_variant,
|
|
local_54->_subtype);
|
|
pEVar3 = local_54;
|
|
local_54->ClearReferences();
|
|
(*(code *)**GHIDRA_CAST<uint32_t **>(pEVar3))(1);
|
|
}
|
|
pEVar7 = pEStack_5c;
|
|
pEStack_5c->ClearReferences();
|
|
(*(code *)**GHIDRA_CAST<uint32_t **>(pEVar7))(1);
|
|
iVar8 = local_50;
|
|
}
|
|
KAGE_LogMessage(1,GHIDRA_CAST<uint8_t *>("[Frame %d] Removing input device with ID %d \n"));
|
|
pvVar11 = (void *)(*GHIDRA_CAST<int *>(this) + GHIDRA_INT(local_4c) * 4);
|
|
pvVar12 = (void *)(GHIDRA_INT(pvVar11) + 4);
|
|
memmove(pvVar11,pvVar12,*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[1])) + 0x1)))) - GHIDRA_INT(pvVar12));
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[1])) + 0x1)))) = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[1])) + 0x1)))) + -4;
|
|
FUN_00906020(iVar8);
|
|
LAB_00909b68:
|
|
iVar8 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[1])) + 0x1))));
|
|
goto LAB_00909b6b;
|
|
LAB_009093f2:
|
|
pvVar12 = pvVar11;
|
|
if (pvVar11 == pEStack_5c) goto LAB_00909444;
|
|
goto LAB_009093b4;
|
|
}
|
|
|
|
// 00909fe0
|
|
void * NetplayManager::get_drop_entry(uint64_t userId)
|
|
{
|
|
uint64_t *puVar1;
|
|
NetplayManager *pNVar2;
|
|
int *piVar3;
|
|
void *newMapHead;
|
|
uint32_t i;
|
|
uint32_t entryCount;
|
|
uint64_t pendingEntry;
|
|
void *pendingMap;
|
|
uint32_t pendingMapSize;
|
|
NetplayManager *local_14;
|
|
void *local_10;
|
|
uint8_t *puStack_c;
|
|
uint32_t local_8;
|
|
uint32_t swapTmp;
|
|
|
|
local_8 = 0xffffffff;
|
|
puStack_c = &LAB_00b08e8d;
|
|
local_10 = ExceptionList;
|
|
piVar3 = *GHIDRA_CAST<int **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x81d])) + 0x1))));
|
|
i = 0;
|
|
entryCount = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x81e])) + 0x2)))) - GHIDRA_INT(piVar3) >> 4;
|
|
if (entryCount != 0) {
|
|
do {
|
|
if ((*piVar3 == GHIDRA_INT(userId)) && (piVar3[1] == (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(userId)) + 0x4))))) {
|
|
return piVar3;
|
|
}
|
|
i = i + 1;
|
|
piVar3 = piVar3 + 4;
|
|
} while (i < entryCount);
|
|
}
|
|
pendingMap = (void *)0x0;
|
|
pendingMapSize = 0;
|
|
ExceptionList = &local_10;
|
|
local_14 = this;
|
|
pendingEntry = userId;
|
|
pendingMap = operator_new(0x20);
|
|
pNVar2 = local_14;
|
|
*(void **)pendingMap = pendingMap;
|
|
*(void **)(GHIDRA_CAST<char *>(pendingMap) + 4) = pendingMap;
|
|
*(void **)(GHIDRA_CAST<char *>(pendingMap) + 8) = pendingMap;
|
|
*GHIDRA_CAST<uint16_t *>((GHIDRA_CAST<char *>(pendingMap) + 0xc)) = 0x101;
|
|
local_8 = 0;
|
|
puVar1 = *GHIDRA_CAST<uint64_t **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14[0x81e])) + 0x2))));
|
|
if (puVar1 == *GHIDRA_CAST<uint64_t **>((local_14 + 0x820))) {
|
|
msvc::vector<16byte>::_Emplace_reallocate(puVar1,&pendingEntry);
|
|
}
|
|
else {
|
|
*puVar1 = pendingEntry;
|
|
*GHIDRA_CAST<uint32_t *>((puVar1 + 1)) = 0;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(puVar1) + 0xc)) = 0;
|
|
newMapHead = operator_new(0x20);
|
|
*(void **)newMapHead = newMapHead;
|
|
*(void **)(GHIDRA_CAST<char *>(newMapHead) + 4) = newMapHead;
|
|
*(void **)(GHIDRA_CAST<char *>(newMapHead) + 8) = newMapHead;
|
|
*GHIDRA_CAST<uint16_t *>((GHIDRA_CAST<char *>(newMapHead) + 0xc)) = 0x101;
|
|
*(void **)(puVar1 + 1) = newMapHead;
|
|
*(void **)(puVar1 + 1) = pendingMap;
|
|
swapTmp = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(puVar1) + 0xc));
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(puVar1) + 0xc)) = pendingMapSize;
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x81e])) + 0x2)))) = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x81e])) + 0x2)))) + 0x10;
|
|
pendingMap = newMapHead;
|
|
pendingMapSize = swapTmp;
|
|
}
|
|
FID_conflict__Erase_tree<fuzzer::fuzzer_allocator<msvc::_Tree_node<fuzzer::TracePC::PCTableEntry_const*,void*>_>_>
|
|
(&pendingMap,(fuzzer_allocator<msvc::_Tree_node<unsigned_int,void*>_> *)&pendingMap,
|
|
*(_Tree_node<unsigned_int,void*> **)(GHIDRA_INT(pendingMap) + 4));
|
|
operator_delete(pendingMap,0x20);
|
|
ExceptionList = local_10;
|
|
return (void *)(*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(pNVar2[0x81e])) + 0x2)))) + -0x10);
|
|
}
|
|
|
|
// 0090a150
|
|
void NetplayManager::ban_user(uint8_t **param_1, uint32_t param_2)
|
|
{
|
|
char cVar1;
|
|
uint8_t bVar2;
|
|
uint32_t uVar3;
|
|
int ownerProfile;
|
|
uint8_t *metadataValue;
|
|
uint8_t *pbVar4;
|
|
uint8_t *pbVar5;
|
|
uint32_t ****ppppuVar6;
|
|
uint8_t **appuStack_d0 [2];
|
|
uint8_t **local_c8;
|
|
int *lobbyImpl;
|
|
int *lobbyRefCount;
|
|
uint8_t **ppuStack_bc;
|
|
uint32_t uStack_b8;
|
|
uint32_t ****banList [4];
|
|
int iStack_a4;
|
|
uint32_t uStack_a0;
|
|
uint8_t metadataKey [104];
|
|
uint8_t userIdText [32];
|
|
uint32_t local_14;
|
|
void *local_10;
|
|
uint8_t *puStack_c;
|
|
uint32_t local_8;
|
|
uint32_t *bannedUsersEnd;
|
|
Manager *manager;
|
|
|
|
puStack_c = &LAB_00b08ee1;
|
|
local_10 = ExceptionList;
|
|
uVar3 = __security_cookie ^ GHIDRA_UINT((userIdText + 0x30));
|
|
ExceptionList = &local_10;
|
|
local_c8 = KAGE::Network::Multiplayer::ConstLobby::vftable;
|
|
lobbyImpl = GHIDRA_CAST<int *>(0x0);
|
|
lobbyRefCount = GHIDRA_CAST<int *>(0x0);
|
|
local_8 = 0;
|
|
local_14 = uVar3;
|
|
(GHIDRA_CAST<msvc::shared_ptr *>((&lobbyImpl)))->msvc::shared_ptr::assign(&g_multiplayerLobbyPtr);
|
|
local_c8 = KAGE::Network::Multiplayer::Lobby::vftable;
|
|
local_8 = 1;
|
|
if ((lobbyImpl != GHIDRA_CAST<int *>(0x0)) && (cVar1 = (**(code **)(*lobbyImpl + 0xc))(uVar3), cVar1 != '\0'))
|
|
{
|
|
KAGE_LogMessage(1,GHIDRA_CAST<uint8_t *>("[Frame: %d] Banning user %llu from the lobby \n"));
|
|
manager = g_manager;
|
|
ppuStack_bc = param_1;
|
|
uStack_b8 = param_2;
|
|
bannedUsersEnd = *GHIDRA_CAST<uint32_t **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((g_manager)) + 0x4b124))));
|
|
if (bannedUsersEnd == *GHIDRA_CAST<uint32_t **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((g_manager)) + 0x4b128))))) {
|
|
msvc::vector<8byte>::_Emplace_reallocate(bannedUsersEnd,&ppuStack_bc);
|
|
}
|
|
else {
|
|
*bannedUsersEnd = param_1;
|
|
bannedUsersEnd[1] = param_2;
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((manager)) + 0x4b124)))) = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((manager)) + 0x4b124)))) + 8;
|
|
}
|
|
if (lobbyImpl == GHIDRA_CAST<int *>(0x0)) {
|
|
uStack_b8 = 0;
|
|
}
|
|
else {
|
|
ownerProfile = (**(code **)(*lobbyImpl + 0x20))(appuStack_d0);
|
|
uStack_b8 = *GHIDRA_CAST<uint32_t *>((ownerProfile + 4));
|
|
appuStack_d0[0] = KAGE::System::UserProfileBase::vftable;
|
|
}
|
|
ppuStack_bc = KAGE::System::UserProfile::vftable;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 2;
|
|
bVar2 = (GHIDRA_CAST<KAGE::System::UserProfile *>((&ppuStack_bc)))->KAGE::System::UserProfile::is_local_user();
|
|
local_8 = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x1))),1);
|
|
if (bVar2 != 0) {
|
|
sprintf_s(userIdText,0x20,&UNK_00b78d18);
|
|
pbVar4 = userIdText;
|
|
do {
|
|
bVar2 = *pbVar4;
|
|
pbVar4 = pbVar4 + 1;
|
|
} while (bVar2 != 0);
|
|
sprintf_s(metadataKey,100,&DAT_00b62fdc);
|
|
if (lobbyImpl == GHIDRA_CAST<int *>(0x0)) {
|
|
metadataValue = GHIDRA_CAST<uint8_t *>(0x0);
|
|
}
|
|
else {
|
|
metadataValue = GHIDRA_CAST<uint8_t *>((**(code **)(*lobbyImpl + 0x2c))(metadataKey));
|
|
}
|
|
iStack_a4 = 0;
|
|
uStack_a0 = 0xf;
|
|
banList[0] = GHIDRA_CAST<uint32_t ****>(0x0);
|
|
pbVar5 = metadataValue;
|
|
do {
|
|
bVar2 = *pbVar5;
|
|
pbVar5 = pbVar5 + 1;
|
|
} while (bVar2 != 0);
|
|
(GHIDRA_CAST<msvc::string *>((GHIDRA_CAST<char *>(banList))))->msvc::string::assign(metadataValue,GHIDRA_INT(pbVar5) - GHIDRA_INT((metadataValue + 1)));
|
|
local_8 = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x1))),3);
|
|
while (GHIDRA_CAST<uint8_t *>(0x64) < pbVar4 + iStack_a4 + (1 - GHIDRA_INT((userIdText + 1)))) {
|
|
sprintf_s(metadataKey,100,&DAT_00b69520);
|
|
if (lobbyImpl == GHIDRA_CAST<int *>(0x0)) {
|
|
metadataValue = GHIDRA_CAST<uint8_t *>(0x0);
|
|
}
|
|
else {
|
|
metadataValue = GHIDRA_CAST<uint8_t *>((**(code **)(*lobbyImpl + 0x2c))(metadataKey));
|
|
}
|
|
pbVar5 = metadataValue;
|
|
do {
|
|
bVar2 = *pbVar5;
|
|
pbVar5 = pbVar5 + 1;
|
|
} while (bVar2 != 0);
|
|
(GHIDRA_CAST<msvc::string *>((GHIDRA_CAST<char *>(banList))))->msvc::string::assign(metadataValue,GHIDRA_INT(pbVar5) - GHIDRA_INT((metadataValue + 1)));
|
|
}
|
|
pbVar4 = userIdText;
|
|
do {
|
|
bVar2 = *pbVar4;
|
|
pbVar4 = pbVar4 + 1;
|
|
} while (bVar2 != 0);
|
|
(GHIDRA_CAST<msvc::string *>((GHIDRA_CAST<char *>(banList))))->msvc::string::append(userIdText,GHIDRA_INT(pbVar4) - GHIDRA_INT((userIdText + 1)));
|
|
ppppuVar6 = banList;
|
|
if (0xf < uStack_a0) {
|
|
ppppuVar6 = banList[0];
|
|
}
|
|
if (lobbyImpl != GHIDRA_CAST<int *>(0x0)) {
|
|
(**(code **)(*lobbyImpl + 0x28))(metadataKey,ppppuVar6);
|
|
}
|
|
local_8 = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x1))),1);
|
|
if (0xf < uStack_a0) {
|
|
uVar3 = uStack_a0 + 1;
|
|
ppppuVar6 = banList[0];
|
|
if (0xfff < uVar3) {
|
|
ppppuVar6 = GHIDRA_CAST<uint32_t ****>(banList[0][-1]);
|
|
uVar3 = uStack_a0 + 0x24;
|
|
if (0x1f < GHIDRA_UINT((GHIDRA_INT(banList[0]) + (-4 - GHIDRA_INT(ppppuVar6))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(ppppuVar6,uVar3);
|
|
}
|
|
}
|
|
}
|
|
local_c8 = KAGE::Network::Multiplayer::ConstLobby::vftable;
|
|
local_8 = 4;
|
|
if (((lobbyRefCount != GHIDRA_CAST<int *>(0x0)) &&
|
|
(cVar1 = (**(code **)(*lobbyRefCount + 0xc))(), cVar1 != '\0')) &&
|
|
(g_lobbyReleaseFn != (void *)0x0)) {
|
|
(*g_lobbyReleaseFn)(&lobbyImpl);
|
|
}
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 0090a8a0
|
|
void NetplayManager::reset(uint8_t isReleaseDevices)
|
|
{
|
|
NetplayManager *tree;
|
|
uint32_t uVar1;
|
|
uint64_t qVar2;
|
|
char isLastRef;
|
|
uint32_t uVar3;
|
|
uint32_t extraout_ECX;
|
|
uint32_t extraout_ECX_00;
|
|
int *piVar4;
|
|
uint64_t *allocCounter;
|
|
int elementCursor;
|
|
int iVar5;
|
|
uint8_t *outDevice;
|
|
uint8_t device [4];
|
|
int *local_14;
|
|
void *local_10;
|
|
uint8_t *puStack_c;
|
|
uint32_t local_8;
|
|
|
|
local_8 = 0xffffffff;
|
|
puStack_c = &LAB_00b08f8d;
|
|
local_10 = ExceptionList;
|
|
uVar3 = __security_cookie ^ GHIDRA_UINT((device + 0x14));
|
|
ExceptionList = &local_10;
|
|
*GHIDRA_CAST<uint32_t *>((this + 4)) = 0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x83a])) + 0x2)))) = 0;
|
|
*GHIDRA_CAST<uint32_t *>((this + 0x83c)) = 0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[6])) + 0x2)))) = 0;
|
|
*GHIDRA_CAST<uint8_t *>((this + 8)) = 1;
|
|
msvc::deque<12byte>::_Tidy(uVar3);
|
|
*GHIDRA_CAST<uint32_t *>((this + 0x18)) = *GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x16])) + 0x2))));
|
|
piVar4 = *GHIDRA_CAST<int **>((this + 0x14));
|
|
local_14 = GHIDRA_CAST<int *>(*piVar4);
|
|
if (local_14 != piVar4) {
|
|
do {
|
|
piVar4 = local_14;
|
|
iVar5 = local_14[5];
|
|
if (iVar5 != 0) {
|
|
if (g_mainHeap == (void *)0x0) {
|
|
allocCounter = &g_allocatedBytesNoHeap;
|
|
}
|
|
else {
|
|
allocCounter = GHIDRA_CAST<uint64_t *>((GHIDRA_INT(g_mainHeap) + 0x30));
|
|
}
|
|
uVar3 = *GHIDRA_CAST<uint32_t *>((iVar5 + -4));
|
|
qVar2 = *allocCounter;
|
|
*GHIDRA_CAST<uint32_t *>(allocCounter) = GHIDRA_UINT(*allocCounter) - uVar3;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocCounter) + 4)) =
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocCounter) + 4)) - GHIDRA_UINT((GHIDRA_UINT(qVar2) < uVar3));
|
|
free((void *)(iVar5 + -4));
|
|
local_8 = 0xffffffff;
|
|
piVar4[5] = 0;
|
|
}
|
|
msvc::
|
|
_Tree_unchecked_const_iterator<msvc::_Tree_val<msvc::_Tree_simple_types<unsigned_int>_>,msvc::_Iterator_base0>
|
|
::operator++((_Tree_unchecked_const_iterator<msvc::_Tree_val<msvc::_Tree_simple_types<unsigned_int>_>,msvc::_Iterator_base0>
|
|
*)&local_14);
|
|
piVar4 = *GHIDRA_CAST<int **>((this + 0x14));
|
|
} while (local_14 != piVar4);
|
|
}
|
|
FID_conflict__Erase_tree<fuzzer::fuzzer_allocator<msvc::_Tree_node<fuzzer::TracePC::PCTableEntry_const*,void*>_>_>
|
|
(this + 0x14,(fuzzer_allocator<msvc::_Tree_node<unsigned_int,void*>_> *)(this + 0x14),
|
|
(_Tree_node<unsigned_int,void*> *)piVar4[1]);
|
|
piVar4[1] = GHIDRA_INT(piVar4);
|
|
*piVar4 = GHIDRA_INT(piVar4);
|
|
piVar4[2] = GHIDRA_INT(piVar4);
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x15])) + 0x1)))) = 0;
|
|
*GHIDRA_CAST<uint32_t *>((this + 0x5f4)) = *GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x5f2])) + 0x2))));
|
|
*GHIDRA_CAST<uint32_t *>((this + 0x5f8)) = *GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x5f6])) + 0x2))));
|
|
*GHIDRA_CAST<uint32_t *>((this + 0x604)) = *GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x602])) + 0x2))));
|
|
uVar1 = *GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x5fe])) + 0x2))));
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x5ed])) + 0x1)))) = 0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x5ee])) + 0x2)))) = 0;
|
|
*GHIDRA_CAST<uint32_t *>((this + 0x600)) = uVar1;
|
|
FUN_00900b90(extraout_ECX);
|
|
tree = this + 0x60c;
|
|
*GHIDRA_CAST<uint32_t *>((this + 0x608)) = *GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x606])) + 0x2))));
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x5f1])) + 0x1)))) = 0;
|
|
iVar5 = *GHIDRA_CAST<int *>(tree);
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x60a])) + 0x2))) = 0;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x60e])) + 0x2))) = 0;
|
|
FID_conflict__Erase_tree<fuzzer::fuzzer_allocator<msvc::_Tree_node<fuzzer::TracePC::PCTableEntry_const*,void*>_>_>
|
|
(tree,(fuzzer_allocator<msvc::_Tree_node<unsigned_int,void*>_> *)tree,
|
|
*(_Tree_node<unsigned_int,void*> **)(iVar5 + 4));
|
|
*GHIDRA_CAST<int *>((iVar5 + 4)) = iVar5;
|
|
*GHIDRA_CAST<int *>(iVar5) = iVar5;
|
|
*GHIDRA_CAST<int *>((iVar5 + 8)) = iVar5;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x60d])) + 0x1)))) = 0;
|
|
iVar5 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x57a])) + 0x2))));
|
|
*GHIDRA_CAST<uint32_t *>((this + 0x840)) = 0x26;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x841])) + 0x1)))) = 0xe;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x842])) + 0x2)))) = 0;
|
|
*GHIDRA_CAST<uint32_t *>((this + 0x844)) = 0;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x845])) + 0x1))) = 0;
|
|
msvc::map<unsigned_long_long_PeerStreams>::destroy_subtree
|
|
(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x57a])) + 0x2))),*GHIDRA_CAST<uint32_t *>((iVar5 + 4)));
|
|
*GHIDRA_CAST<int *>((iVar5 + 4)) = iVar5;
|
|
*GHIDRA_CAST<int *>(iVar5) = iVar5;
|
|
*GHIDRA_CAST<int *>((iVar5 + 8)) = iVar5;
|
|
*GHIDRA_CAST<uint32_t *>((this + 0x57c)) = 0;
|
|
FUN_00915be0(extraout_ECX_00);
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x81e])) + 0x2)))) = *GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x81d])) + 0x1))));
|
|
if (isReleaseDevices == 0) {
|
|
iVar5 = *GHIDRA_CAST<int *>(this);
|
|
if (iVar5 != *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[1])) + 0x1))))) {
|
|
do {
|
|
FUN_00901b70();
|
|
iVar5 = iVar5 + 4;
|
|
} while (iVar5 != *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[1])) + 0x1)))));
|
|
}
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
piVar4 = *GHIDRA_CAST<int **>(this);
|
|
if (3 < GHIDRA_UINT((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[1])) + 0x1)))) - GHIDRA_INT(piVar4)))) {
|
|
do {
|
|
iVar5 = *GHIDRA_CAST<int *>((*piVar4 + 0xc));
|
|
outDevice = device;
|
|
(GHIDRA_CAST<InputManager *>((&PTR_vftable_00c57b18)))->InputManager::get_device(outDevice,iVar5);
|
|
local_8 = 1;
|
|
FUN_00902d60(device);
|
|
FUN_00a20eb0(outDevice,iVar5);
|
|
local_8 = 2;
|
|
if (((local_14 != GHIDRA_CAST<int *>(0x0)) &&
|
|
(isLastRef = (**(code **)(*local_14 + 0xc))(), isLastRef != '\0')) &&
|
|
(g_inputDeviceRelease != (void *)0x0)) {
|
|
(*g_inputDeviceRelease)(device);
|
|
}
|
|
local_8 = 0xffffffff;
|
|
piVar4 = *GHIDRA_CAST<int **>(this);
|
|
} while ((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[1])) + 0x1)))) - GHIDRA_INT(piVar4) & 0xfffffffcU) != 0);
|
|
}
|
|
iVar5 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x825])) + 0x1))));
|
|
elementCursor = *GHIDRA_CAST<int *>((this + 0x824));
|
|
if (elementCursor != iVar5) {
|
|
do {
|
|
msvc::vector<Vector>::_Tidy();
|
|
elementCursor = elementCursor + 0x18;
|
|
} while (elementCursor != iVar5);
|
|
elementCursor = *GHIDRA_CAST<int *>((this + 0x824));
|
|
}
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x825])) + 0x1)))) = elementCursor;
|
|
iVar5 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x829])) + 0x1))));
|
|
elementCursor = *GHIDRA_CAST<int *>((this + 0x828));
|
|
if (elementCursor != iVar5) {
|
|
do {
|
|
msvc::vector<Vector>::_Tidy();
|
|
elementCursor = elementCursor + 0x20;
|
|
} while (elementCursor != iVar5);
|
|
elementCursor = *GHIDRA_CAST<int *>((this + 0x828));
|
|
}
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x829])) + 0x1)))) = elementCursor;
|
|
iVar5 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x821])) + 0x1))));
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x82d])) + 0x1)))) = *GHIDRA_CAST<uint32_t *>((this + 0x82c));
|
|
FUN_00914d90(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x821])) + 0x1))),*GHIDRA_CAST<uint32_t *>((iVar5 + 4)));
|
|
*GHIDRA_CAST<int *>((iVar5 + 4)) = iVar5;
|
|
*GHIDRA_CAST<int *>(iVar5) = iVar5;
|
|
*GHIDRA_CAST<int *>((iVar5 + 8)) = iVar5;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x822])) + 0x2)))) = 0;
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 0090b100
|
|
uint8_t NetplayManager::IsIdxLocalPlayer(uint32_t idx)
|
|
{
|
|
uint8_t isLocal;
|
|
int *playerSlot;
|
|
uint32_t playerCount;
|
|
uint32_t i;
|
|
|
|
playerSlot = *GHIDRA_CAST<int **>(this);
|
|
i = 0;
|
|
playerCount = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[1])) + 0x1)))) - GHIDRA_INT(playerSlot) >> 2;
|
|
if (playerCount != 0) {
|
|
do {
|
|
if (*GHIDRA_CAST<uint32_t *>((*playerSlot + 0xc)) == idx) {
|
|
isLocal = (**(code **)(*GHIDRA_CAST<int *>((*playerSlot + 0x370)) + 0x14))();
|
|
return isLocal;
|
|
}
|
|
i = i + 1;
|
|
playerSlot = playerSlot + 1;
|
|
} while (i < playerCount);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
// 0090b150
|
|
uint8_t NetplayManager::Update()
|
|
{
|
|
NetplayManager *this_00;
|
|
void *ptr;
|
|
Game *pGVar1;
|
|
uint8_t *puVar2;
|
|
char cVar3;
|
|
uint8_t bVar4;
|
|
int *piVar5;
|
|
uint32_t uVar6;
|
|
Manager *manager;
|
|
int *messageRefCount;
|
|
uint8_t auStack_8a [2];
|
|
int *local_50;
|
|
int *local_4c;
|
|
int *local_48;
|
|
int *local_44;
|
|
int *inputMessage;
|
|
int *inputMessageRef;
|
|
uint8_t received [4];
|
|
Entity_Player *local_34;
|
|
int *local_30;
|
|
int *local_2c;
|
|
int *cleanupFlags;
|
|
char isNoLobby;
|
|
uint8_t *puStack_20;
|
|
void *local_1c;
|
|
uint8_t *puStack_18;
|
|
uint32_t local_14;
|
|
int dailyJoinStatus;
|
|
uint32_t inputDelay;
|
|
|
|
puStack_20 = received + 0x34;
|
|
local_14 = 0xffffffff;
|
|
puStack_18 = &LAB_00b0901e;
|
|
local_1c = ExceptionList;
|
|
ExceptionList = &local_1c;
|
|
this_00 = this + 0x848;
|
|
local_30 = GHIDRA_CAST<int *>(0x0);
|
|
cleanupFlags = GHIDRA_CAST<int *>(0x0);
|
|
puVar2 = received + 0x34;
|
|
if ((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x85d])) + 0x1)))) != 0) &&
|
|
(puVar2 = received + 0x34, (*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x862])) + 0x2))) != '\0')) {
|
|
ANM2::update_appear_then_idle(GHIDRA_CAST<ANM2 *>((this + 0x84c)));
|
|
if (*GHIDRA_CAST<char *>((this + 0x90b)) != '\0') {
|
|
AnimationState::Update(GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x8c2])) + 0x2)))));
|
|
AnimationState::Update(GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x8cd])) + 0x1)))));
|
|
}
|
|
local_2c = GHIDRA_CAST<int *>(&DAT_0000000f);
|
|
cVar3 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a209e0,&local_2c);
|
|
if (cVar3 != '\0') {
|
|
daily_lobby_join_reset(this_00);
|
|
}
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x849])) + 0x1)))) = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x849])) + 0x1)))) + 1;
|
|
puVar2 = puStack_20;
|
|
if (0x5a < *GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x849])) + 0x1))))) {
|
|
dailyJoinStatus = *GHIDRA_CAST<int *>(this_00);
|
|
if (dailyJoinStatus == 2) {
|
|
daily_lobby_join_reset(this_00);
|
|
string_table_translate(&g_manager->_stringTable,GHIDRA_CAST<uint8_t *>("#Online/LOBBY_JOIN_DAILY_DENIED"));
|
|
daily_lobby_join_show_error();
|
|
puVar2 = puStack_20;
|
|
}
|
|
else if (dailyJoinStatus == 5) {
|
|
daily_lobby_join_reset(this_00);
|
|
string_table_translate(&g_manager->_stringTable,GHIDRA_CAST<uint8_t *>("#Online/LOBBY_JOIN_DAILY_FAILED"));
|
|
daily_lobby_join_show_error();
|
|
puVar2 = puStack_20;
|
|
}
|
|
else if (dailyJoinStatus == 3) {
|
|
daily_lobby_join_reset(this_00);
|
|
string_table_translate
|
|
(&g_manager->_stringTable,GHIDRA_CAST<uint8_t *>("#Online/LOBBY_JOIN_DAILY_IN_PROGRESS"));
|
|
daily_lobby_join_show_error();
|
|
puVar2 = puStack_20;
|
|
}
|
|
else if (dailyJoinStatus == 4) {
|
|
join_pending_lobby(GHIDRA_CAST<NetplayManager *>(&g_manager->_netplayManager),&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x90e])) + 0x2))));
|
|
daily_lobby_join_reset(this_00);
|
|
puVar2 = puStack_20;
|
|
}
|
|
}
|
|
}
|
|
puStack_20 = puVar2;
|
|
(GHIDRA_CAST<LobbyPasswordPrompt *>((&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x912])) + 0x2))))))->LobbyPasswordPrompt::Update();
|
|
update_text_popup(GHIDRA_CAST<NetplayManager *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x58a])) + 0x2)))));
|
|
process_lobby_messages();
|
|
if ((*GHIDRA_CAST<int *>((this + 0x838)) != 0) && (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x836])) + 0x2)))) == *GHIDRA_CAST<int *>((this + 4)))) {
|
|
KAGE_LogMessage(1,GHIDRA_CAST<uint8_t *>("[Frame %d] Executing delayed game start \n"));
|
|
FUN_00a581a0();
|
|
local_14 = 0;
|
|
FUN_0090ca40();
|
|
ptr = *(void **)(this + 0x838);
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x836])) + 0x2)))) = 0;
|
|
if (ptr != (void *)0x0) {
|
|
operator_delete(ptr,1);
|
|
*GHIDRA_CAST<uint32_t *>((this + 0x838)) = 0;
|
|
}
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x839])) + 0x1)))) = 0;
|
|
local_14 = 0xffffffff;
|
|
FUN_00a58200();
|
|
}
|
|
while (g_multiplayerService != (void *)0x0) {
|
|
piVar5 = (GHIDRA_CAST<NetworkManager *>((g_multiplayerService)))->NetworkManager::receive_message(received,2,0);
|
|
dailyJoinStatus = *piVar5;
|
|
local_14 = 1;
|
|
if (((local_34 != GHIDRA_CAST<Entity_Player *>(0x0)) &&
|
|
(cVar3 = local_34->Update(), cVar3 != '\0')) &&
|
|
(g_multiplayerRelease != (void *)0x0)) {
|
|
(*g_multiplayerRelease)();
|
|
}
|
|
local_14 = 0xffffffff;
|
|
if (dailyJoinStatus == 0) break;
|
|
cleanupFlags = GHIDRA_CAST<int *>((GHIDRA_UINT(cleanupFlags) | 2));
|
|
if (g_multiplayerService == (void *)0x0) {
|
|
KAGE::SmartPointer<MessageData>::reset();
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<NetworkManager *>((g_multiplayerService)))->NetworkManager::receive_message(&local_48,2,1);
|
|
}
|
|
local_14 = 2;
|
|
if (((local_44 != GHIDRA_CAST<int *>(0x0)) && (cVar3 = (**(code **)(*local_44 + 0xc))(), cVar3 != '\0')) &&
|
|
(g_multiplayerRelease != (void *)0x0)) {
|
|
(*g_multiplayerRelease)();
|
|
}
|
|
local_14 = 0xffffffff;
|
|
}
|
|
update_status_messages();
|
|
while (g_multiplayerService != (void *)0x0) {
|
|
piVar5 = (GHIDRA_CAST<NetworkManager *>((g_multiplayerService)))->NetworkManager::receive_message(&local_50,10,0);
|
|
dailyJoinStatus = *piVar5;
|
|
local_14 = 3;
|
|
if (((local_4c != GHIDRA_CAST<int *>(0x0)) && (cVar3 = (**(code **)(*local_4c + 0xc))(), cVar3 != '\0')) &&
|
|
(g_multiplayerRelease != (void *)0x0)) {
|
|
(*g_multiplayerRelease)();
|
|
}
|
|
local_14 = 0xffffffff;
|
|
if (dailyJoinStatus == 0) break;
|
|
cleanupFlags = GHIDRA_CAST<int *>((GHIDRA_UINT(cleanupFlags) | 4));
|
|
if (g_multiplayerService == (void *)0x0) {
|
|
KAGE::SmartPointer<MessageData>::reset();
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<NetworkManager *>((g_multiplayerService)))->NetworkManager::receive_message(&local_48,10,1);
|
|
}
|
|
local_14 = 4;
|
|
piVar5 = GHIDRA_CAST<int *>(0x0);
|
|
local_2c = local_44;
|
|
local_30 = local_48;
|
|
if ((((local_44 != GHIDRA_CAST<int *>(0x0)) && (cVar3 = (**(code **)(*local_44 + 4))(), cVar3 != '\0')) &&
|
|
(piVar5 != GHIDRA_CAST<int *>(0x0))) &&
|
|
((cVar3 = (**(code **)(*piVar5 + 0xc))(), cVar3 != '\0' &&
|
|
(g_multiplayerRelease != (void *)0x0)))) {
|
|
(*g_multiplayerRelease)(auStack_8a + -10);
|
|
}
|
|
(GHIDRA_CAST<Camera *>((GHIDRA_CAST<Camera *>((this + 0x610)))))->Camera::UpdateUltrasmooth();
|
|
local_14 = 5;
|
|
if (((local_44 != GHIDRA_CAST<int *>(0x0)) && (cVar3 = (**(code **)(*local_44 + 0xc))(), cVar3 != '\0')) &&
|
|
(g_multiplayerRelease != (void *)0x0)) {
|
|
(*g_multiplayerRelease)();
|
|
}
|
|
local_14 = 0xffffffff;
|
|
}
|
|
process_drop_player_message(this);
|
|
receive_vote_end_message(this);
|
|
update_player_removal(this);
|
|
if (*GHIDRA_CAST<int *>(this) != *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[1])) + 0x1))))) {
|
|
local_50 = GHIDRA_CAST<int *>(0x0);
|
|
local_4c = GHIDRA_CAST<int *>(0x0);
|
|
local_14 = 6;
|
|
(GHIDRA_CAST<msvc::shared_ptr *>((&local_50)))->msvc::shared_ptr::assign(&g_multiplayerLobbyPtr);
|
|
local_14 = 7;
|
|
local_30 = GHIDRA_CAST<int *>((GHIDRA_UINT(cleanupFlags) | 0x19));
|
|
cleanupFlags = local_30;
|
|
if (local_50 != GHIDRA_CAST<int *>(0x0)) {
|
|
cVar3 = (**(code **)(*local_50 + 0xc))();
|
|
isNoLobby = '\0';
|
|
if (cVar3 != '\0') goto LAB_0090b5d1;
|
|
}
|
|
}
|
|
isNoLobby = '\x01';
|
|
LAB_0090b5d1:
|
|
if ((GHIDRA_UINT(cleanupFlags) & 1) != 0) {
|
|
cleanupFlags = GHIDRA_CAST<int *>((GHIDRA_UINT(cleanupFlags) & 0xfffffffe));
|
|
local_14 = 8;
|
|
if (((local_4c != GHIDRA_CAST<int *>(0x0)) && (cVar3 = (**(code **)(*local_4c + 0xc))(), cVar3 != '\0')) &&
|
|
(g_lobbyReleaseFn != (void *)0x0)) {
|
|
(*g_lobbyReleaseFn)();
|
|
}
|
|
}
|
|
local_14 = 0xffffffff;
|
|
if (isNoLobby == '\0') {
|
|
check_connection(this);
|
|
manager = g_manager;
|
|
uVar6 = *GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[5])) + 0x1))));
|
|
inputDelay = (g_manager->_optionsConfig)._onlineInputDelay;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[5])) + 0x1)))) = inputDelay;
|
|
if (uVar6 < inputDelay) {
|
|
*GHIDRA_CAST<uint8_t *>((this + 8)) = 1;
|
|
}
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((manager)) + 0x8)))) == 2) {
|
|
online_chat_update(this + 0x610);
|
|
manager = g_manager;
|
|
}
|
|
if ((manager->_framecount & 1) == 0) {
|
|
while (g_multiplayerService != (void *)0x0) {
|
|
piVar5 = (GHIDRA_CAST<NetworkManager *>((g_multiplayerService)))->NetworkManager::receive_message(&local_50,1,0);
|
|
dailyJoinStatus = *piVar5;
|
|
local_14 = 9;
|
|
if (((local_4c != GHIDRA_CAST<int *>(0x0)) && (cVar3 = (**(code **)(*local_4c + 0xc))(), cVar3 != '\0'))
|
|
&& (g_multiplayerRelease != (void *)0x0)) {
|
|
(*g_multiplayerRelease)();
|
|
}
|
|
local_14 = 0xffffffff;
|
|
if (dailyJoinStatus == 0) break;
|
|
cleanupFlags = GHIDRA_CAST<int *>((GHIDRA_UINT(cleanupFlags) | 0x20));
|
|
if (g_multiplayerService == (void *)0x0) {
|
|
KAGE::SmartPointer<MessageData>::reset();
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<NetworkManager *>((g_multiplayerService)))->NetworkManager::receive_message(&inputMessage,1,1);
|
|
}
|
|
local_14 = 10;
|
|
local_48 = GHIDRA_CAST<int *>(*inputMessage);
|
|
local_44 = GHIDRA_CAST<int *>(inputMessage[1]);
|
|
local_34 = PlayerManager::get_player_by_user_id
|
|
(GHIDRA_CAST<PlayerManager *>(this),GHIDRA_CAST<uint64_t *>(&local_48));
|
|
if (local_34 != GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
piVar5 = GHIDRA_CAST<int *>(0x0);
|
|
messageRefCount = GHIDRA_CAST<int *>(0x0);
|
|
local_30 = inputMessageRef;
|
|
local_2c = inputMessage;
|
|
if ((inputMessageRef != GHIDRA_CAST<int *>(0x0)) &&
|
|
(cVar3 = (**(code **)(*inputMessageRef + 4))(), cVar3 != '\0')) {
|
|
if ((messageRefCount != GHIDRA_CAST<int *>(0x0)) &&
|
|
((cVar3 = (**(code **)(*messageRefCount + 0xc))(), cVar3 != '\0' &&
|
|
(g_multiplayerRelease != (void *)0x0)))) {
|
|
(*g_multiplayerRelease)(auStack_8a + -10);
|
|
}
|
|
piVar5 = local_2c;
|
|
messageRefCount = local_30;
|
|
}
|
|
(GHIDRA_CAST<NetInputDevice *>((local_34)))->NetInputDevice::ProcessInputMessage(piVar5,messageRefCount);
|
|
}
|
|
local_14 = 0xb;
|
|
if (((inputMessageRef != GHIDRA_CAST<int *>(0x0)) &&
|
|
(cVar3 = (**(code **)(*inputMessageRef + 0xc))(), cVar3 != '\0')) &&
|
|
(g_multiplayerRelease != (void *)0x0)) {
|
|
(*g_multiplayerRelease)();
|
|
}
|
|
local_14 = 0xffffffff;
|
|
}
|
|
process_drop_player_message(this);
|
|
update_revives(this);
|
|
online_vote_update();
|
|
(GHIDRA_CAST<NetDesyncHandler *>((&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x5ed])) + 0x1))))))->NetDesyncHandler::Update();
|
|
dailyJoinStatus = *GHIDRA_CAST<int *>((this + 0x840));
|
|
local_34 = GHIDRA_CAST<Entity_Player *>(get_rich_presence_room_status());
|
|
pGVar1 = g_game;
|
|
if (((local_34 != GHIDRA_CAST<Entity_Player *>(dailyJoinStatus)) ||
|
|
(*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x841])) + 0x1)))) != g_game->_stage)) ||
|
|
(((dailyJoinStatus = g_game->_difficulty, dailyJoinStatus == 2 || (dailyJoinStatus == 3))
|
|
&& ((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x842])) + 0x2)))) != g_game->_greedModeWave ||
|
|
(*GHIDRA_CAST<int *>((this + 0x844)) != (dailyJoinStatus == 3) + 10)))))) {
|
|
*GHIDRA_CAST<Entity_Player **>((this + 0x840)) = local_34;
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x841])) + 0x1)))) = pGVar1->_stage;
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x842])) + 0x2)))) = pGVar1->_greedModeWave;
|
|
*GHIDRA_CAST<uint32_t *>((this + 0x844)) = (pGVar1->_difficulty == 3) + 10;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x845])) + 0x1))) = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pGVar1->_room) + 0x723c)) != -1;
|
|
update_lobby_stage_info(this);
|
|
}
|
|
bVar4 = process_consolidated_messages(GHIDRA_CAST<NetplayManager *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x60a])) + 0x2)))));
|
|
if (bVar4 == 0) {
|
|
bVar4 = try_advance_frame(this);
|
|
ExceptionList = local_1c;
|
|
return bVar4;
|
|
}
|
|
ExceptionList = local_1c;
|
|
return 0;
|
|
}
|
|
uVar6 = 0;
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[1])) + 0x1)))) - *GHIDRA_CAST<int *>(this) >> 2 != 0) {
|
|
do {
|
|
dailyJoinStatus = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(this) + uVar6 * 4));
|
|
uVar6 = uVar6 + 1;
|
|
*GHIDRA_CAST<uint32_t *>((dailyJoinStatus + 0x388)) = 0;
|
|
*GHIDRA_CAST<uint32_t *>((dailyJoinStatus + 0x38c)) = 0;
|
|
} while (uVar6 < GHIDRA_UINT((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[1])) + 0x1)))) - *GHIDRA_CAST<int *>(this) >> 2)));
|
|
}
|
|
}
|
|
ExceptionList = local_1c;
|
|
return 1;
|
|
}
|
|
|
|
// 0090b900
|
|
void NetplayManager::Render()
|
|
{
|
|
NetplayManager *topAnimState = this;
|
|
char isActive;
|
|
uint32_t uVar1;
|
|
AnimationState *topAnimState;
|
|
uint8_t *str;
|
|
float *centerNull;
|
|
uint32_t drawParams;
|
|
uint32_t local_44;
|
|
uint32_t local_40;
|
|
uint32_t local_3c;
|
|
uint32_t local_38;
|
|
uint32_t local_34;
|
|
uint32_t local_30;
|
|
KColor white;
|
|
Vector drawPos;
|
|
void *local_10;
|
|
uint8_t *puStack_c;
|
|
uint32_t local_8;
|
|
Manager *manager;
|
|
|
|
local_8 = 0xffffffff;
|
|
puStack_c = &LAB_00b0904d;
|
|
local_10 = ExceptionList;
|
|
uVar1 = __security_cookie ^ GHIDRA_INT(register0x00000010) - 4U;
|
|
ExceptionList = &local_10;
|
|
if (*GHIDRA_CAST<int *>((topAnimState + 0x590)) != 0) {
|
|
drawPos.x = g_screenWidth * 0.5;
|
|
drawPos.y = 48.0;
|
|
if ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(topAnimState[0x5e9])) + 0x2))) != '\0') {
|
|
if ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(topAnimState[0x5b6])) + 0x2))) == '\0') {
|
|
AnimationState::Render
|
|
(GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(topAnimState[0x5a1])) + 0x1)))),&drawPos,&g_vectorZero,&g_vectorZero);
|
|
topAnimState = GHIDRA_CAST<AnimationState *>((topAnimState + 0x5ac));
|
|
}
|
|
else {
|
|
AnimationState::Render
|
|
(GHIDRA_CAST<AnimationState *>((topAnimState + 0x5ac)),&drawPos,&g_vectorZero,&g_vectorZero);
|
|
topAnimState = GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(topAnimState[0x5a1])) + 0x1))));
|
|
}
|
|
AnimationState::Render(topAnimState,&drawPos,&g_vectorZero,&g_vectorZero);
|
|
}
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(topAnimState[0x5a2])) + 0x2)))) == 0) {
|
|
centerNull = GHIDRA_CAST<float *>(0x0);
|
|
}
|
|
else {
|
|
centerNull = AnimationState::GetNullFrame
|
|
(GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(topAnimState[0x5a1])) + 0x1)))),GHIDRA_CAST<uint8_t *>("Center"));
|
|
}
|
|
manager = g_manager;
|
|
drawPos.x = drawPos.x + *centerNull;
|
|
drawParams = 4;
|
|
drawPos.y = (drawPos.y + centerNull[1]) - 2.0;
|
|
local_44 = 0xffff;
|
|
local_40 = 0;
|
|
local_3c = 0x3f800000;
|
|
local_38 = 0xffffffff;
|
|
local_34 = 0;
|
|
local_30 = 0;
|
|
local_8 = 0;
|
|
(GHIDRA_CAST<KColor *>((&white)))->KColor::SetFromARGB(0xffffffff);
|
|
str = *GHIDRA_CAST<uint8_t **>((*GHIDRA_CAST<int *>((topAnimState + 0x58c)) +
|
|
(*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(topAnimState[0x58d])) + 0x1)))) - 1U & *GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(topAnimState[0x58e])) + 0x2))))) * 4));
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((str + 0x14))) {
|
|
str = *GHIDRA_CAST<uint8_t **>(str);
|
|
}
|
|
Font::DrawString(&manager->_font2_TeamMeatEx12,str,&drawPos,GHIDRA_CAST<Vector *>((centerNull + 4)),&white,
|
|
&drawParams);
|
|
}
|
|
local_8 = 0xffffffff;
|
|
if (g_menuManager == GHIDRA_CAST<MenuManager *>(0x0)) {
|
|
drawPos.y = DAT_00c79980 - 80.0;
|
|
drawPos.x = 60.0;
|
|
(GHIDRA_CAST<OnlineChat *>((topAnimState + 0x610)))->OnlineChat::render_all(&drawPos,0);
|
|
}
|
|
if ((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(topAnimState[0x85d])) + 0x1)))) != 0) && ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(topAnimState[0x862])) + 0x2))) != '\0')) {
|
|
(GHIDRA_CAST<GenericPopup *>((GHIDRA_CAST<GenericPopup *>((topAnimState + 0x84c)))))->GenericPopup::Render();
|
|
isActive = FUN_00837610(uVar1);
|
|
if (isActive != '\0') {
|
|
drawPos.x = (g_screenWidth - 480.0) * 0.5 + 240.0;
|
|
drawPos.y = (g_screenHeight - 270.0) * 0.5 + 150.0;
|
|
ANM2::Render(GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(topAnimState[0x8b2])) + 0x2)))),&drawPos,&g_vectorZero,&g_vectorZero);
|
|
}
|
|
}
|
|
if ((*GHIDRA_CAST<int *>((topAnimState + 0x924)) != 0) && ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(topAnimState[0x929])) + 0x1))) != '\0')) {
|
|
(GHIDRA_CAST<GenericPopup *>((GHIDRA_CAST<GenericPopup *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(topAnimState[0x912])) + 0x2)))))))->GenericPopup::Render();
|
|
isActive = FUN_00837610(uVar1);
|
|
if (isActive != '\0') {
|
|
drawPos.x = (g_screenWidth - 480.0) * 0.5 + 209.0;
|
|
drawPos.y = (g_screenHeight - 270.0) * 0.5 + 130.0;
|
|
lobby_password_render(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(topAnimState[0x979])) + 0x1))),&drawPos,1.0);
|
|
}
|
|
}
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 0090bf10
|
|
void NetplayManager::join_pending_lobby(void *lobby)
|
|
{
|
|
int height;
|
|
int *piVar1;
|
|
MenuManager *newMenuManager;
|
|
MenuManager *extraout_EAX;
|
|
int unused;
|
|
uint8_t auStackY_dc [128];
|
|
uint32_t in_stack_ffffffac;
|
|
uint32_t in_stack_ffffffb0;
|
|
uint8_t auStack_4a [2];
|
|
KColor fadeColor;
|
|
int local_28;
|
|
MenuManager *pMStack_24;
|
|
uint8_t *puStack_20;
|
|
void *local_1c;
|
|
uint8_t *puStack_18;
|
|
uint32_t local_14;
|
|
Manager *manager;
|
|
|
|
puStack_20 = auStack_4a + 0x46;
|
|
local_14 = 0xffffffff;
|
|
puStack_18 = &LAB_00b090fa;
|
|
local_1c = ExceptionList;
|
|
ExceptionList = &local_1c;
|
|
if (g_manager->_currentSaveSlot == 0) {
|
|
if (g_menuManager == GHIDRA_CAST<MenuManager *>(0x0)) {
|
|
puStack_20 = auStack_4a + 0x46;
|
|
piVar1 = glfw_get_window_size(&local_28,0);
|
|
height = piVar1[1];
|
|
piVar1 = glfw_get_window_size(&local_28,unused);
|
|
Manager::set_viewport_size(*piVar1,height);
|
|
newMenuManager = operator_new(0xf930);
|
|
_local_28 = CONCAT44(newMenuManager,local_28);
|
|
local_14 = 0;
|
|
if (newMenuManager == GHIDRA_CAST<MenuManager *>(0x0)) {
|
|
g_menuManager = GHIDRA_CAST<MenuManager *>(0x0);
|
|
}
|
|
else {
|
|
MenuManager::constructor(newMenuManager);
|
|
g_menuManager = extraout_EAX;
|
|
}
|
|
local_14 = 0xffffffff;
|
|
MenuManager::Init(g_menuManager);
|
|
(GHIDRA_CAST<KColor *>((&fadeColor)))->KColor::SetFromARGB(0xffffffff);
|
|
manager = g_manager;
|
|
(g_manager->_pendingMenuFadeColor)._red = fadeColor._red;
|
|
(manager->_pendingMenuFadeColor)._green = fadeColor._green;
|
|
(manager->_pendingMenuFadeColor)._blue = fadeColor._blue;
|
|
(manager->_pendingMenuFadeColor)._alpha = fadeColor._alpha;
|
|
manager->_pendingMenuState = 2;
|
|
(manager->_pendingMenuFadeColor)._unk = fadeColor._unk;
|
|
manager->_isMenuPending = 1;
|
|
}
|
|
else {
|
|
puStack_20 = auStack_4a + 0x46;
|
|
MenuManager::SetState(g_menuManager,2,1);
|
|
}
|
|
_local_28 = CONCAT44(auStackY_dc + 0x84,local_28);
|
|
local_14 = 1;
|
|
(GHIDRA_CAST<msvc::shared_ptr *>((auStackY_dc + 0x88)))->msvc::shared_ptr::assign((void *)(GHIDRA_INT(lobby) + 4));
|
|
local_14 = 0xffffffff;
|
|
FUN_009db250();
|
|
}
|
|
else if ((g_game == GHIDRA_CAST<Game *>(0x0)) || (g_game->_stage == 0)) {
|
|
online_lobby_join(this,lobby,CONCAT44(in_stack_ffffffb0,in_stack_ffffffac));
|
|
}
|
|
else {
|
|
puStack_20 = auStack_4a + 0x46;
|
|
(GHIDRA_CAST<msvc::shared_ptr *>((&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x831])) + 0x1))))))->msvc::shared_ptr::assign((void *)(GHIDRA_INT(lobby) + 4));
|
|
if (*GHIDRA_CAST<int *>(this) == *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[1])) + 0x1))))) {
|
|
_local_28 = 0;
|
|
KAGE::Network::Multiplayer::ConstLobby::ConstLobby<id>();
|
|
local_14 = 2;
|
|
netplay_leave_lobby_callback();
|
|
(GHIDRA_CAST<KAGE::Network::Multiplayer::ConstLobby *>((&fadeColor._blue)))->KAGE::Network::Multiplayer::ConstLobby::~ConstLobby();
|
|
}
|
|
else {
|
|
Multiplayer::leave_lobby(netplay_leave_lobby_callback,this);
|
|
}
|
|
}
|
|
ExceptionList = local_1c;
|
|
return;
|
|
}
|
|
|
|
// 0090c0e0
|
|
void NetplayManager::store_local_persistent_game_data()
|
|
{
|
|
int *piVar1;
|
|
void *pvVar2;
|
|
int in_ECX;
|
|
uint32_t local_98;
|
|
uint32_t uStack_94;
|
|
void *local_8c;
|
|
uint32_t local_88;
|
|
void *pvStack_84;
|
|
uint8_t messageType;
|
|
uint32_t gameDataWriter;
|
|
uint32_t uStack_74;
|
|
uint32_t uStack_70;
|
|
uint32_t uStack_6c;
|
|
uint32_t local_68;
|
|
uint32_t uStack_64;
|
|
uint32_t uStack_60;
|
|
uint32_t uStack_5c;
|
|
int bufferedStream [13];
|
|
uint32_t local_24;
|
|
uint8_t *puStack_20;
|
|
void *local_1c;
|
|
uint8_t *puStack_18;
|
|
int local_14;
|
|
void *compressedData;
|
|
|
|
puStack_20 = GHIDRA_CAST<uint8_t *>((bufferedStream + 0x15));
|
|
local_14 = 0xffffffff;
|
|
puStack_18 = &LAB_00b09145;
|
|
local_1c = ExceptionList;
|
|
local_24 = __security_cookie ^ GHIDRA_UINT((bufferedStream + 0x12));
|
|
ExceptionList = &local_1c;
|
|
piVar1 = GHIDRA_CAST<int *>((in_ECX + 0xfec));
|
|
(**(code **)(*piVar1 + 8))(local_24);
|
|
(**(code **)(*piVar1 + 4))(0,0xffffffff);
|
|
(GHIDRA_CAST<KAGE::Filesys::BufferedStream *>((bufferedStream)))->KAGE::Filesys::BufferedStream::BufferedStream(0);
|
|
local_14 = 0;
|
|
(**(code **)(bufferedStream[0] + 8))();
|
|
(**(code **)(bufferedStream[0] + 4))(0,0xffffffff);
|
|
gameDataWriter = 0;
|
|
uStack_74 = 0;
|
|
uStack_70 = 0;
|
|
uStack_6c = 0;
|
|
local_68 = 0;
|
|
uStack_64 = 0;
|
|
uStack_60 = 0;
|
|
uStack_5c = 0;
|
|
local_8c = g_userProfile;
|
|
local_14 = 2;
|
|
if (g_userProfile == (void *)0x0) {
|
|
pvStack_84 = (void *)0x0;
|
|
local_88 = 0;
|
|
}
|
|
else {
|
|
local_88 = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(g_userProfile) + 8));
|
|
pvStack_84 = *(void **)(GHIDRA_CAST<char *>(g_userProfile) + 0xc);
|
|
}
|
|
FUN_0091b0f0(&g_manager->_persistentGameData,&local_88);
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 1;
|
|
local_8c = (void *)0x0;
|
|
pvVar2 = (GHIDRA_CAST<PersistentGameDataWriter *>((&gameDataWriter)))->PersistentGameDataWriter::compress(GHIDRA_CAST<uint32_t *>(&local_8c));
|
|
pvStack_84 = pvVar2;
|
|
(**(code **)(*piVar1 + 4))(0,0xffffffff);
|
|
pvVar2 = local_8c;
|
|
(**(code **)(*piVar1 + 0xc))(GHIDRA_INT(local_8c) + 5);
|
|
messageType = 2;
|
|
(**(code **)(*GHIDRA_CAST<int *>((in_ECX + 0x1014)) + 0x1c))(&messageType,1,1);
|
|
local_8c = pvVar2;
|
|
(**(code **)(*GHIDRA_CAST<int *>((in_ECX + 0x1014)) + 0x1c))(&local_8c,4,1);
|
|
compressedData = pvStack_84;
|
|
(**(code **)(*GHIDRA_CAST<int *>((in_ECX + 0x1014)) + 0x1c))(pvStack_84,pvVar2,1);
|
|
if (compressedData != (void *)0x0) {
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 3;
|
|
tracked_alloc(1,compressedData,0);
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 1;
|
|
}
|
|
PersistentGameData::operator_assign
|
|
(GHIDRA_CAST<PersistentGameData *>((in_ECX + 0x5c)),&g_manager->_persistentGameData);
|
|
local_8c = g_userProfile;
|
|
local_14 = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))),4);
|
|
if (g_userProfile == (void *)0x0) {
|
|
uStack_94 = 0;
|
|
local_98 = 0;
|
|
}
|
|
else {
|
|
local_98 = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(g_userProfile) + 8));
|
|
uStack_94 = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(g_userProfile) + 0xc));
|
|
}
|
|
_local_88 = CONCAT44(uStack_94,local_98);
|
|
FUN_0090c2d0(&local_88,&gameDataWriter);
|
|
FUN_00a58200();
|
|
ExceptionList = local_1c;
|
|
return;
|
|
}
|
|
|
|
// 0090c360
|
|
void * NetplayManager::get_player_persistent_game_data(Entity_Player *player)
|
|
{
|
|
void *gameData;
|
|
uint32_t userIdLow;
|
|
uint32_t userIdHigh;
|
|
uint32_t userIdKey;
|
|
uint32_t userIdKeyHigh;
|
|
uint8_t findResult [8];
|
|
int foundNode;
|
|
int userProfile;
|
|
|
|
gameData = this->InputManager::GetDeviceByPlayerEntity(player);
|
|
if (gameData != (void *)0x0) {
|
|
userProfile = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(gameData) + 0x374));
|
|
if (userProfile == 0) {
|
|
userIdKeyHigh = 0;
|
|
userIdKey = 0;
|
|
userIdLow = userIdKey;
|
|
userIdHigh = userIdKeyHigh;
|
|
}
|
|
else {
|
|
userIdLow = *GHIDRA_CAST<uint32_t *>((userProfile + 8));
|
|
userIdHigh = *GHIDRA_CAST<uint32_t *>((userProfile + 0xc));
|
|
}
|
|
_userIdKey = CONCAT44(userIdHigh,userIdLow);
|
|
FUN_00731ee0(findResult,&userIdKey);
|
|
if ((((*GHIDRA_CAST<char *>((foundNode + 0xd)) == '\0') && (*GHIDRA_CAST<uint32_t *>((foundNode + 0x14)) <= userIdHigh)) &&
|
|
((*GHIDRA_CAST<uint32_t *>((foundNode + 0x14)) < userIdHigh || (*GHIDRA_CAST<uint32_t *>((foundNode + 0x10)) <= userIdLow))))
|
|
&& (foundNode != *GHIDRA_CAST<int *>((this + 0x578)))) {
|
|
gameData = (void *)FUN_00914150(&userIdKey);
|
|
return gameData;
|
|
}
|
|
}
|
|
return (void *)0x0;
|
|
}
|
|
|
|
// 0090c7e0
|
|
int NetplayManager::restore_player_state(uint64_t *userId, Entity_Player *player)
|
|
{
|
|
Entity_Player *player_00;
|
|
Entity_Player *pEVar1;
|
|
uint64_t *userId_00;
|
|
NetplayManager *this_00;
|
|
uint32_t uVar2;
|
|
int *pendingEntry;
|
|
int *piVar3;
|
|
uint8_t findResult [8];
|
|
int lowerBound;
|
|
uint32_t reader;
|
|
uint8_t *local_618;
|
|
uint32_t local_614;
|
|
uint32_t local_610;
|
|
uint8_t local_60c;
|
|
uint32_t local_608;
|
|
uint32_t local_604;
|
|
int slotValue;
|
|
Entity_Player *local_5fc;
|
|
uint64_t *local_5f8;
|
|
NetplayManager *local_5f4;
|
|
GameStatePlayer gameState [500];
|
|
uint32_t local_14;
|
|
void *local_10;
|
|
uint8_t *puStack_c;
|
|
uint32_t local_8;
|
|
int playerType;
|
|
|
|
local_8 = 0xffffffff;
|
|
puStack_c = &LAB_00b091d0;
|
|
local_10 = ExceptionList;
|
|
uVar2 = __security_cookie ^ GHIDRA_UINT(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(gameState[0x1f9])) + 0x1))));
|
|
ExceptionList = &local_10;
|
|
local_5f8 = userId;
|
|
local_5fc = player;
|
|
local_5f4 = this;
|
|
local_14 = uVar2;
|
|
FUN_00731ee0(findResult,userId);
|
|
if (*GHIDRA_CAST<char *>((lowerBound + 0xd)) != '\0') {
|
|
ExceptionList = local_10;
|
|
return 0;
|
|
}
|
|
if (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(userId) + 4)) < *GHIDRA_CAST<uint32_t *>((lowerBound + 0x14))) {
|
|
ExceptionList = local_10;
|
|
return 0;
|
|
}
|
|
if ((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(userId) + 4)) <= *GHIDRA_CAST<uint32_t *>((lowerBound + 0x14))) &&
|
|
(GHIDRA_UINT(*userId) < *GHIDRA_CAST<uint32_t *>((lowerBound + 0x10)))) {
|
|
ExceptionList = local_10;
|
|
return 0;
|
|
}
|
|
if (lowerBound == *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x57a])) + 0x2))))) {
|
|
ExceptionList = local_10;
|
|
return 0;
|
|
}
|
|
pendingEntry = GHIDRA_CAST<int *>(FUN_00913e50(userId));
|
|
playerType = player->_playerType;
|
|
if (*pendingEntry == playerType) {
|
|
piVar3 = pendingEntry;
|
|
}
|
|
else {
|
|
piVar3 = pendingEntry + 0xd;
|
|
if (((pendingEntry[0xd] != playerType) &&
|
|
(piVar3 = pendingEntry + 0x1a, pendingEntry[0x1a] != playerType)) &&
|
|
(piVar3 = pendingEntry + 0x27, pendingEntry[0x27] != playerType)) goto LAB_0090c9f0;
|
|
}
|
|
if (piVar3 != GHIDRA_CAST<int *>(0x0)) {
|
|
(**(code **)(piVar3[0xc] + 0xc))(0,0,uVar2);
|
|
local_618 = &s_empty;
|
|
local_604 = 1;
|
|
local_610 = 0;
|
|
local_60c = 0;
|
|
reader = -GHIDRA_UINT((piVar3 != GHIDRA_CAST<int *>(0xfffffff8))) & GHIDRA_UINT((piVar3 + 0xc));
|
|
local_608 = 0xfedcba76;
|
|
input_state_reset(gameState);
|
|
local_8 = 0;
|
|
(GHIDRA_CAST<GameStatePlayer *>((gameState)))->GameStatePlayer::Init();
|
|
local_614 = 0xa9;
|
|
(GHIDRA_CAST<GameStatePlayer *>((gameState)))->GameStatePlayer::read(&reader);
|
|
(GHIDRA_CAST<Entity_Player *>((local_5fc)))->Entity_Player::RestoreGameState(gameState);
|
|
this_00 = local_5f4;
|
|
userId_00 = local_5f8;
|
|
slotValue = piVar3[1];
|
|
*piVar3 = 0x29;
|
|
piVar3[1] = 0;
|
|
if (((*pendingEntry == 0x29) && (pendingEntry[0xd] == 0x29)) &&
|
|
((pendingEntry[0x1a] == 0x29 && (pendingEntry[0x27] == 0x29)))) {
|
|
msvc::map<unsigned_long_long_PeerStreams>::erase(local_5f8);
|
|
}
|
|
pEVar1 = local_5fc;
|
|
player_00 = GHIDRA_CAST<Entity_Player *>(local_5fc->_twinPlayer);
|
|
if ((player_00 != GHIDRA_CAST<Entity_Player *>(0x0)) &&
|
|
(((player_00->_playerIndex == -1 || (local_5fc->_playerIndex <= player_00->_playerIndex)) ||
|
|
(player_00 == local_5fc)))) {
|
|
restore_player_state(this_00,userId_00,player_00);
|
|
}
|
|
if (pEVar1->_backupPlayer != GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
restore_player_state(this_00,userId_00,pEVar1->_backupPlayer);
|
|
}
|
|
(GHIDRA_CAST<GameStatePlayer *>((gameState)))->GameStatePlayer::~GameStatePlayer();
|
|
ExceptionList = local_10;
|
|
return slotValue;
|
|
}
|
|
LAB_0090c9f0:
|
|
if ((((*pendingEntry == 0x29) && (pendingEntry[0xd] == 0x29)) && (pendingEntry[0x1a] == 0x29)) &&
|
|
(pendingEntry[0x27] == 0x29)) {
|
|
msvc::map<unsigned_long_long_PeerStreams>::erase(userId);
|
|
}
|
|
ExceptionList = local_10;
|
|
return 0;
|
|
}
|
|
|
|
// 0090d640
|
|
void NetplayManager::save_frame_snapshot(uint8_t isResetEntities)
|
|
{
|
|
NetplayManager *snapshotDeque = this;
|
|
NetplayManager *pNVar1;
|
|
NetplayManager *pNVar2;
|
|
uint8_t ***pppuVar3;
|
|
uint32_t uVar4;
|
|
int iVar5;
|
|
int *piVar6;
|
|
void *pvVar7;
|
|
int dequeMap;
|
|
uint32_t uVar8;
|
|
uint64_t *allocatedBytes;
|
|
EntityList *entityList;
|
|
uint32_t local_94;
|
|
int iStack_90;
|
|
int lowerBoundNode;
|
|
EntityList *entityListRef;
|
|
uint32_t local_84;
|
|
uint32_t local_80;
|
|
NetplayManager *netplay;
|
|
uint32_t gameDataWriter;
|
|
uint32_t uStack_74;
|
|
uint32_t uStack_70;
|
|
uint32_t uStack_6c;
|
|
uint32_t local_68;
|
|
uint32_t uStack_64;
|
|
uint32_t uStack_60;
|
|
uint32_t uStack_5c;
|
|
uint8_t **stream;
|
|
uint32_t local_54;
|
|
uint32_t local_50;
|
|
uint32_t local_4c;
|
|
uint32_t local_48;
|
|
uint32_t local_40;
|
|
uint32_t uStack_3c;
|
|
uint32_t uStack_38;
|
|
uint32_t uStack_34;
|
|
uint8_t **local_30 [3];
|
|
uint32_t local_24;
|
|
uint8_t *puStack_20;
|
|
void *local_1c;
|
|
uint8_t *puStack_18;
|
|
uint8_t **local_14;
|
|
uint64_t allocatedBefore;
|
|
NetplayManager *frameNumber;
|
|
uint64_t *snapshotEntry;
|
|
|
|
puStack_20 = GHIDRA_CAST<uint8_t *>((local_30 + 0xb));
|
|
local_14 = GHIDRA_CAST<uint8_t **>(0xffffffff);
|
|
puStack_18 = &LAB_00b09285;
|
|
local_1c = ExceptionList;
|
|
uVar4 = __security_cookie ^ GHIDRA_UINT((local_30 + 8));
|
|
ExceptionList = &local_1c;
|
|
entityList = GHIDRA_CAST<EntityList *>((GHIDRA_INT(g_game->_room) + 0x1218));
|
|
entityListRef = entityList;
|
|
netplay = snapshotDeque;
|
|
local_24 = uVar4;
|
|
pppuVar3 = local_30 + 0xb;
|
|
if (isResetEntities != 0) {
|
|
(GHIDRA_CAST<EntityList *>((entityList)))->EntityList::Reset();
|
|
(GHIDRA_CAST<EntityList *>((entityList)))->EntityList::Update(0);
|
|
pppuVar3 = GHIDRA_CAST<uint8_t ***>(puStack_20);
|
|
}
|
|
puStack_20 = GHIDRA_CAST<uint8_t *>(pppuVar3);
|
|
pNVar2 = netplay;
|
|
pNVar1 = netplay + 0xd;
|
|
uVar8 = *GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(netplay[0x11])) + 0x1))));
|
|
local_80 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(netplay[0x12])) + 0x2)))) + uVar8;
|
|
piVar6 = *GHIDRA_CAST<int **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((pNVar1)) + 0x1))));
|
|
while( true ) {
|
|
if (uVar8 == local_80) {
|
|
(GHIDRA_CAST<KAGE::Filesys::BufferedStream *>((&stream)))->KAGE::Filesys::BufferedStream::BufferedStream(0);
|
|
local_14 = GHIDRA_CAST<uint8_t **>(0x0);
|
|
(*(code *)stream[2])(uVar4);
|
|
(*(code *)stream[1])(0,0xffffffff);
|
|
gameDataWriter = 0;
|
|
uStack_74 = 0;
|
|
uStack_70 = 0;
|
|
uStack_6c = 0;
|
|
local_68 = 0;
|
|
uStack_64 = 0;
|
|
uStack_60 = 0;
|
|
uStack_5c = 0;
|
|
local_14 = GHIDRA_CAST<uint8_t **>(0x1);
|
|
PersistentGameDataWriter::write
|
|
(&gameDataWriter,&g_manager->_persistentGameData,&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(netplay[0x55d])) + 0x1))));
|
|
frameNumber = netplay + 4;
|
|
_Find_lower_bound<>(&local_94,frameNumber);
|
|
if (((*GHIDRA_CAST<char *>((lowerBoundNode + 0xd)) == '\0') &&
|
|
(*GHIDRA_CAST<uint32_t *>((lowerBoundNode + 0x10)) <= *GHIDRA_CAST<uint32_t *>(frameNumber))) &&
|
|
(lowerBoundNode != *GHIDRA_CAST<int *>((netplay + 0x14)))) {
|
|
piVar6 = GHIDRA_CAST<int *>(std)::map<unsigned_int_8byte>::try_emplace(&local_84,frameNumber);
|
|
if (*GHIDRA_CAST<int *>((*piVar6 + 0x14)) != 0) {
|
|
piVar6 = GHIDRA_CAST<int *>(std)::map<unsigned_int_8byte>::try_emplace(&local_84,frameNumber);
|
|
iVar5 = *GHIDRA_CAST<int *>((*piVar6 + 0x14));
|
|
if (g_mainHeap == (void *)0x0) {
|
|
allocatedBytes = &g_allocatedBytesNoHeap;
|
|
}
|
|
else {
|
|
allocatedBytes = GHIDRA_CAST<uint64_t *>((GHIDRA_INT(g_mainHeap) + 0x30));
|
|
}
|
|
if (iVar5 != 0) {
|
|
uVar4 = *GHIDRA_CAST<uint32_t *>((iVar5 + -4));
|
|
allocatedBefore = *allocatedBytes;
|
|
*GHIDRA_CAST<uint32_t *>(allocatedBytes) = GHIDRA_UINT(*allocatedBytes) - uVar4;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocatedBytes) + 4)) =
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocatedBytes) + 4)) - GHIDRA_UINT((GHIDRA_UINT(allocatedBefore) < uVar4));
|
|
free((void *)(iVar5 + -4));
|
|
}
|
|
local_14 = GHIDRA_CAST<uint8_t **>(CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))),1));
|
|
piVar6 = GHIDRA_CAST<int *>(std)::map<unsigned_int_8byte>::try_emplace(&local_84,frameNumber);
|
|
*GHIDRA_CAST<uint32_t *>((*piVar6 + 0x14)) = 0;
|
|
}
|
|
msvc::map<unsigned_int_8byte>::erase(frameNumber);
|
|
}
|
|
local_84 = 0;
|
|
local_80 = 0;
|
|
pvVar7 = (GHIDRA_CAST<PersistentGameDataWriter *>((&gameDataWriter)))->PersistentGameDataWriter::compress(&local_80);
|
|
piVar6 = GHIDRA_CAST<int *>(std)::map<unsigned_int_8byte>::try_emplace(&iStack_90,netplay + 4);
|
|
iVar5 = *piVar6;
|
|
*(void **)(iVar5 + 0x14) = pvVar7;
|
|
*GHIDRA_CAST<uint32_t *>((iVar5 + 0x18)) = local_80;
|
|
local_80 = checksum_stream(local_30,0,0);
|
|
uVar4 = *GHIDRA_CAST<uint32_t *>((pNVar2 + 0x10));
|
|
local_94 = *GHIDRA_CAST<uint32_t *>((netplay + 4));
|
|
iStack_90 = entityListRef[1]._updateEL._capacity;
|
|
uVar8 = *GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(pNVar2[0x12])) + 0x2))));
|
|
if (uVar4 <= uVar8 + 1) {
|
|
std_deque_growmap(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((pNVar1)) + 0x1))),uVar8);
|
|
uVar4 = *GHIDRA_CAST<uint32_t *>((pNVar2 + 0x10));
|
|
uVar8 = *GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(pNVar2[0x12])) + 0x2))));
|
|
}
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(pNVar2[0x11])) + 0x1)))) = *GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(pNVar2[0x11])) + 0x1)))) & uVar4 - 1;
|
|
uVar4 = uVar8 + *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(pNVar2[0x11])) + 0x1)))) & uVar4 - 1;
|
|
dequeMap = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(pNVar2[0xe])) + 0x2))));
|
|
iVar5 = uVar4 * 4;
|
|
if (*GHIDRA_CAST<int *>((dequeMap + uVar4 * 4)) == 0) {
|
|
pvVar7 = operator_new(0xc);
|
|
*(void **)(iVar5 + *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(pNVar2[0xe])) + 0x2))))) = pvVar7;
|
|
dequeMap = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(pNVar2[0xe])) + 0x2))));
|
|
}
|
|
snapshotEntry = *GHIDRA_CAST<uint64_t **>((dequeMap + iVar5));
|
|
*snapshotEntry = CONCAT44(iStack_90,local_94);
|
|
*GHIDRA_CAST<uint32_t *>((snapshotEntry + 1)) = local_80;
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(pNVar2[0x12])) + 0x2)))) = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(pNVar2[0x12])) + 0x2)))) + 1;
|
|
local_30[0] = KAGE::Filesys::StreamBase::vftable;
|
|
stream = KAGE::Filesys::BufferedStreamBase::vftable;
|
|
local_54 = 0;
|
|
local_50 = 0;
|
|
local_48 = local_4c;
|
|
local_40 = 0;
|
|
uStack_3c = 0;
|
|
uStack_38 = 0;
|
|
uStack_34 = 0;
|
|
FUN_007dcd30();
|
|
ExceptionList = local_1c;
|
|
return;
|
|
}
|
|
if (piVar6 == GHIDRA_CAST<int *>(0x0)) {
|
|
iVar5 = 0;
|
|
}
|
|
else {
|
|
iVar5 = *piVar6;
|
|
}
|
|
if (**GHIDRA_CAST<int **>((*GHIDRA_CAST<int *>((iVar5 + 4)) + (*GHIDRA_CAST<int *>((iVar5 + 8)) - 1U & uVar8) * 4)) ==
|
|
*GHIDRA_CAST<int *>((netplay + 4))) break;
|
|
uVar8 = uVar8 + 1;
|
|
}
|
|
iVar5 = entityListRef[1]._updateEL._capacity;
|
|
if (piVar6 == GHIDRA_CAST<int *>(0x0)) {
|
|
*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((_DAT_00000004 + (_DAT_00000008 - 1U & uVar8) * 4)) + 4)) = iVar5;
|
|
ExceptionList = local_1c;
|
|
return;
|
|
}
|
|
*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((*piVar6 + 4)) + (*GHIDRA_CAST<int *>((*piVar6 + 8)) - 1U & uVar8) * 4)) + 4)) = iVar5;
|
|
ExceptionList = local_1c;
|
|
return;
|
|
}
|
|
|
|
// 0090d9b0
|
|
void NetplayManager::add_new_players()
|
|
{
|
|
void **ppvVar1;
|
|
char cVar2;
|
|
uint8_t isLocalUser;
|
|
int playerEntry;
|
|
uint8_t ***ownerProfile;
|
|
uint8_t **ppuVar3;
|
|
uint32_t uVar4;
|
|
uint8_t **ppuVar5;
|
|
uint32_t *puVar6;
|
|
void *pvVar7;
|
|
void *messageRefCount;
|
|
uint8_t **stream;
|
|
uint8_t **ppuStack_88;
|
|
uint32_t uStack_84;
|
|
void *pvStack_80;
|
|
void *pvStack_7c;
|
|
void *pvStack_74;
|
|
uint32_t uStack_70;
|
|
uint32_t uStack_6c;
|
|
uint32_t uStack_68;
|
|
uint8_t **ppuStack_64;
|
|
uint8_t **lobby;
|
|
int *lobbyPtr;
|
|
int *lobbyRefCount;
|
|
uint32_t *newPlayersBegin;
|
|
uint32_t *newPlayersEnd;
|
|
uint32_t *newPlayersCapacity;
|
|
uint8_t **ppuStack_48;
|
|
uint8_t **ppuStack_44;
|
|
uint8_t **ppuStack_3c;
|
|
uint8_t **ppuStack_38;
|
|
uint8_t **local_34;
|
|
NetplayManager *self;
|
|
uint8_t **ppuStack_2c;
|
|
uint8_t **local_28;
|
|
char isLobbyOwner;
|
|
uint8_t *puStack_20;
|
|
void *local_1c;
|
|
uint8_t *puStack_18;
|
|
uint32_t uStack_14;
|
|
Manager *manager;
|
|
NetplayManager *netplayManager;
|
|
|
|
puStack_20 = GHIDRA_CAST<uint8_t *>((GHIDRA_INT(register0x00000010) + -4));
|
|
uStack_14 = 0xffffffff;
|
|
puStack_18 = &LAB_00b0931f;
|
|
local_1c = ExceptionList;
|
|
ExceptionList = &local_1c;
|
|
local_28 = GHIDRA_CAST<uint8_t **>(0x0);
|
|
local_34 = GHIDRA_CAST<uint8_t **>(0x0);
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x822])) + 0x2)))) != 0) {
|
|
self = this;
|
|
KAGE_LogMessage(1,GHIDRA_CAST<uint8_t *>("[Frame %d] Adding %d new players\n"));
|
|
local_34 = GHIDRA_CAST<uint8_t **>(0x0);
|
|
newPlayersBegin = GHIDRA_CAST<uint32_t *>(0x0);
|
|
newPlayersEnd = GHIDRA_CAST<uint32_t *>(0x0);
|
|
newPlayersCapacity = GHIDRA_CAST<uint32_t *>(0x0);
|
|
uStack_14 = 0;
|
|
ppuStack_3c = GHIDRA_CAST<uint8_t **>(0x0);
|
|
ppuStack_38 = GHIDRA_CAST<uint8_t **>(0x0);
|
|
ppuStack_3c = operator_new(0x30);
|
|
netplayManager = self;
|
|
*ppuStack_3c = GHIDRA_CAST<uint8_t *>(ppuStack_3c);
|
|
ppuStack_3c[1] = GHIDRA_CAST<uint8_t *>(ppuStack_3c);
|
|
ppuStack_3c[2] = GHIDRA_CAST<uint8_t *>(ppuStack_3c);
|
|
*GHIDRA_CAST<uint16_t *>((ppuStack_3c + 3)) = 0x101;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(uStack_14)) + 0x0))) = 1;
|
|
ppuStack_2c = GHIDRA_CAST<uint8_t **>(**(int **))&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x821])) + 0x1)));
|
|
if (ppuStack_2c != GHIDRA_CAST<uint8_t **>(*(int **))&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x821])) + 0x1)))) {
|
|
do {
|
|
ppuVar5 = ppuStack_2c;
|
|
lobby = KAGE::Network::Multiplayer::ConstLobby::vftable;
|
|
lobbyPtr = GHIDRA_CAST<int *>(0x0);
|
|
lobbyRefCount = GHIDRA_CAST<int *>(0x0);
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(uStack_14)) + 0x0))) = 2;
|
|
(GHIDRA_CAST<msvc::shared_ptr *>((&lobbyPtr)))->msvc::shared_ptr::assign(&g_multiplayerLobbyPtr);
|
|
local_28 = GHIDRA_CAST<uint8_t **>((GHIDRA_UINT(local_28) | 0xc));
|
|
lobby = KAGE::Network::Multiplayer::Lobby::vftable;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(uStack_14)) + 0x0))) = 3;
|
|
ppuStack_48 = GHIDRA_CAST<uint8_t **>(FUN_00a28590());
|
|
ppuStack_44 = GHIDRA_CAST<uint8_t **>((GHIDRA_INT(ppuStack_48) >> 0x1f));
|
|
playerEntry = FUN_00913ba0();
|
|
*GHIDRA_CAST<uint32_t *>((playerEntry + 4)) = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(ppuVar5) + 0x1c));
|
|
*GHIDRA_CAST<uint8_t *>((playerEntry + 8)) = *GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(ppuVar5) + 0x20));
|
|
*GHIDRA_CAST<uint32_t *>((playerEntry + 0xc)) = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(ppuVar5) + 0x24));
|
|
*GHIDRA_CAST<uint32_t *>((playerEntry + 0x10)) = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(ppuVar5) + 0x28));
|
|
lobby = KAGE::Network::Multiplayer::ConstLobby::vftable;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(uStack_14)) + 0x0))) = 4;
|
|
if (((lobbyRefCount != GHIDRA_CAST<int *>(0x0)) &&
|
|
(cVar2 = (**(code **)(*lobbyRefCount + 0xc))(), cVar2 != '\0')) &&
|
|
(g_lobbyReleaseFn != (void *)0x0)) {
|
|
(*g_lobbyReleaseFn)();
|
|
}
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(uStack_14)) + 0x0))) = 1;
|
|
msvc::
|
|
_Tree_unchecked_const_iterator<msvc::_Tree_val<msvc::_Tree_simple_types<unsigned_int>_>,msvc::_Iterator_base0>
|
|
::operator++((_Tree_unchecked_const_iterator<msvc::_Tree_val<msvc::_Tree_simple_types<unsigned_int>_>,msvc::_Iterator_base0>
|
|
*)&ppuStack_2c);
|
|
} while (ppuStack_2c != GHIDRA_CAST<uint8_t **>(*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(netplayManager[0x821])) + 0x1))))));
|
|
}
|
|
ppuStack_2c = GHIDRA_CAST<uint8_t **>(*ppuStack_3c);
|
|
ppuVar5 = GHIDRA_CAST<uint8_t **>(GHIDRA_CAST<uint32_t *>(0x0));
|
|
if (ppuStack_2c != ppuStack_3c) {
|
|
puVar6 = newPlayersCapacity;
|
|
do {
|
|
if (newPlayersEnd == puVar6) {
|
|
FUN_008ef230();
|
|
puVar6 = newPlayersCapacity;
|
|
}
|
|
else {
|
|
*newPlayersEnd = KAGE::System::UserProfileBase::vftable;
|
|
newPlayersEnd[1] = ppuStack_2c[7];
|
|
*newPlayersEnd = KAGE::System::UserProfile::vftable;
|
|
*GHIDRA_CAST<uint8_t *>((newPlayersEnd + 2)) = *GHIDRA_CAST<uint8_t *>((ppuStack_2c + 8));
|
|
newPlayersEnd[3] = ppuStack_2c[9];
|
|
newPlayersEnd[4] = ppuStack_2c[10];
|
|
newPlayersEnd = newPlayersEnd + 5;
|
|
}
|
|
msvc::
|
|
_Tree_unchecked_const_iterator<msvc::_Tree_val<msvc::_Tree_simple_types<unsigned_int>_>,msvc::_Iterator_base0>
|
|
::operator++((_Tree_unchecked_const_iterator<msvc::_Tree_val<msvc::_Tree_simple_types<unsigned_int>_>,msvc::_Iterator_base0>
|
|
*)&ppuStack_2c);
|
|
} while (ppuStack_2c != ppuStack_3c);
|
|
local_34 = GHIDRA_CAST<uint8_t **>(newPlayersBegin);
|
|
ppuVar5 = GHIDRA_CAST<uint8_t **>(newPlayersBegin);
|
|
}
|
|
uStack_14 = (*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(uStack_14))) + 0x1))) << 8;
|
|
FUN_00914d90();
|
|
operator_delete(ppuStack_3c,0x30);
|
|
manager = g_manager;
|
|
if (ppuVar5 != GHIDRA_CAST<uint8_t **>(newPlayersEnd)) {
|
|
do {
|
|
puVar6 = (manager->_lobbyMembers)._end;
|
|
if (puVar6 == (manager->_lobbyMembers)._capacity) {
|
|
FUN_008ef230();
|
|
}
|
|
else {
|
|
*puVar6 = KAGE::System::UserProfileBase::vftable;
|
|
puVar6[1] = ppuVar5[1];
|
|
*puVar6 = KAGE::System::UserProfile::vftable;
|
|
*GHIDRA_CAST<uint8_t *>((puVar6 + 2)) = *GHIDRA_CAST<uint8_t *>((ppuVar5 + 2));
|
|
puVar6[3] = ppuVar5[3];
|
|
puVar6[4] = ppuVar5[4];
|
|
ppvVar1 = &(manager->_lobbyMembers)._end;
|
|
*ppvVar1 = (void *)(GHIDRA_INT(*ppvVar1) + 0x14);
|
|
}
|
|
ppuVar5 = ppuVar5 + 5;
|
|
} while (ppuVar5 != GHIDRA_CAST<uint8_t **>(newPlayersEnd));
|
|
ppuVar5 = local_34;
|
|
}
|
|
lobby = KAGE::Network::Multiplayer::ConstLobby::vftable;
|
|
lobbyPtr = GHIDRA_CAST<int *>(0x0);
|
|
lobbyRefCount = GHIDRA_CAST<int *>(0x0);
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(uStack_14)) + 0x0))) = 5;
|
|
(GHIDRA_CAST<msvc::shared_ptr *>((&lobbyPtr)))->msvc::shared_ptr::assign(&g_multiplayerLobbyPtr);
|
|
ppuVar3 = local_28;
|
|
lobby = KAGE::Network::Multiplayer::Lobby::vftable;
|
|
uStack_14 = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(uStack_14)) + 0x1))),6);
|
|
local_28 = GHIDRA_CAST<uint8_t **>((GHIDRA_UINT(local_28) | 0x31));
|
|
local_34 = local_28;
|
|
if (lobbyPtr == GHIDRA_CAST<int *>(0x0)) {
|
|
ppuStack_44 = GHIDRA_CAST<uint8_t **>(0x0);
|
|
ownerProfile = &ppuStack_48;
|
|
ppuStack_48 = KAGE::System::UserProfile::vftable;
|
|
uVar4 = GHIDRA_UINT(ppuVar3) | 0xb1;
|
|
}
|
|
else {
|
|
ownerProfile = GHIDRA_CAST<uint8_t ***>((**(code **)(*lobbyPtr + 0x20))());
|
|
uVar4 = GHIDRA_UINT(local_28) | 0x40;
|
|
}
|
|
ppuStack_3c = KAGE::System::UserProfileBase::vftable;
|
|
ppuStack_38 = ownerProfile[1];
|
|
ppuStack_3c = KAGE::System::UserProfile::vftable;
|
|
if ((char)uVar4 < '\0') {
|
|
uVar4 = uVar4 & 0xffffff7f;
|
|
}
|
|
if ((uVar4 & 0x40) != 0) {
|
|
uVar4 = uVar4 & 0xffffffbf;
|
|
ppuStack_48 = KAGE::System::UserProfileBase::vftable;
|
|
}
|
|
local_34 = GHIDRA_CAST<uint8_t **>((uVar4 | 0x102));
|
|
uStack_14 = 7;
|
|
local_28 = local_34;
|
|
isLocalUser = (GHIDRA_CAST<KAGE::System::UserProfile *>((&ppuStack_3c)))->KAGE::System::UserProfile::is_local_user();
|
|
if ((isLocalUser == 0) || (isLobbyOwner = '\x01', *GHIDRA_CAST<int *>((self + 0x57c)) == 0)) {
|
|
isLobbyOwner = '\0';
|
|
}
|
|
ppuVar3 = local_28;
|
|
if ((GHIDRA_UINT(local_28) & 2) != 0) {
|
|
ppuVar3 = GHIDRA_CAST<uint8_t **>((GHIDRA_UINT(local_28) & 0xfffffffd));
|
|
ppuStack_3c = KAGE::System::UserProfileBase::vftable;
|
|
}
|
|
uStack_14 = 0;
|
|
if ((GHIDRA_UINT(ppuVar3) & 1) != 0) {
|
|
lobby = KAGE::Network::Multiplayer::ConstLobby::vftable;
|
|
uStack_14 = 8;
|
|
if (((lobbyRefCount != GHIDRA_CAST<int *>(0x0)) &&
|
|
(cVar2 = (**(code **)(*lobbyRefCount + 0xc))(), cVar2 != '\0')) &&
|
|
(g_lobbyReleaseFn != (void *)0x0)) {
|
|
(*g_lobbyReleaseFn)();
|
|
}
|
|
uStack_14 = uStack_14 & 0xffffff00;
|
|
}
|
|
if (isLobbyOwner != '\0') {
|
|
(GHIDRA_CAST<KAGE::Filesys::BufferedStream *>((&stream)))->KAGE::Filesys::BufferedStream::BufferedStream(0);
|
|
uStack_14 = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(uStack_14)) + 0x1))),9);
|
|
write_player_game_states_message();
|
|
local_34 = ppuStack_88;
|
|
pvVar7 = pvStack_80;
|
|
if (pvStack_74 != (void *)0x0) {
|
|
pvVar7 = pvStack_74;
|
|
}
|
|
if (g_multiplayerService == (void *)0x0) {
|
|
KAGE_LogMessage(0x10,(uint8_t *)
|
|
"Attempting to create a message when there is no multiplayer service\n"
|
|
);
|
|
}
|
|
NetConnection::send_message(g_multiplayerService,&ppuStack_48,1,pvVar7,GHIDRA_UINT(local_34),0);
|
|
puVar6 = newPlayersEnd;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(uStack_14)) + 0x0))) = 10;
|
|
for (; ppuVar5 != GHIDRA_CAST<uint8_t **>(puVar6); ppuVar5 = ppuVar5 + 5) {
|
|
ppuStack_2c = GHIDRA_CAST<uint8_t **>((GHIDRA_INT(register0x00000010) + -0xa4));
|
|
pvVar7 = (void *)0x0;
|
|
messageRefCount = (void *)0x0;
|
|
local_34 = ppuStack_44;
|
|
ppuVar3 = GHIDRA_CAST<uint8_t **>((GHIDRA_INT(register0x00000010) + -0xa4));
|
|
local_28 = ppuStack_48;
|
|
if (ppuStack_44 != GHIDRA_CAST<uint8_t **>(0x0)) {
|
|
cVar2 = (**(code **)(*ppuStack_44 + 4))();
|
|
ppuVar3 = ppuStack_2c;
|
|
if (cVar2 != '\0') {
|
|
if (((GHIDRA_CAST<int *>(ppuStack_2c[1]) != GHIDRA_CAST<int *>(0x0)) &&
|
|
(cVar2 = (**(code **)(*GHIDRA_CAST<int *>(ppuStack_2c[1]) + 0xc))(), cVar2 != '\0')) &&
|
|
(g_multiplayerRelease != (void *)0x0)) {
|
|
(*g_multiplayerRelease)(ppuStack_2c);
|
|
}
|
|
ppuStack_2c[1] = GHIDRA_CAST<uint8_t *>(local_34);
|
|
*ppuStack_2c = GHIDRA_CAST<uint8_t *>(local_28);
|
|
ppuVar3 = ppuStack_2c;
|
|
}
|
|
}
|
|
ppuStack_2c = ppuVar3;
|
|
multiplayer_send_message(ppuVar5,pvVar7,messageRefCount);
|
|
}
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(uStack_14)) + 0x0))) = 0xb;
|
|
if (((ppuStack_44 != GHIDRA_CAST<uint8_t **>(0x0)) &&
|
|
(cVar2 = (**(code **)(*ppuStack_44 + 0xc))(), cVar2 != '\0')) &&
|
|
(g_multiplayerRelease != (void *)0x0)) {
|
|
(*g_multiplayerRelease)();
|
|
}
|
|
uStack_14 = (*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(uStack_14))) + 0x1))) << 8;
|
|
ppuStack_64 = KAGE::Filesys::StreamBase::vftable;
|
|
stream = KAGE::Filesys::BufferedStreamBase::vftable;
|
|
ppuStack_88 = GHIDRA_CAST<uint8_t **>(0x0);
|
|
uStack_84 = 0;
|
|
pvStack_7c = pvStack_80;
|
|
pvStack_74 = (void *)0x0;
|
|
uStack_70 = 0;
|
|
uStack_6c = 0;
|
|
uStack_68 = 0;
|
|
FUN_007dcd30();
|
|
}
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::add_players(GHIDRA_CAST<int *>(&newPlayersBegin),4);
|
|
netplayManager = self;
|
|
playerEntry = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(self[0x821])) + 0x1))));
|
|
FUN_00914d90();
|
|
*GHIDRA_CAST<int *>((playerEntry + 4)) = playerEntry;
|
|
*GHIDRA_CAST<int *>(playerEntry) = playerEntry;
|
|
*GHIDRA_CAST<int *>((playerEntry + 8)) = playerEntry;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(netplayManager[0x822])) + 0x2)))) = 0;
|
|
puVar6 = newPlayersBegin;
|
|
if (newPlayersBegin != GHIDRA_CAST<uint32_t *>(0x0)) {
|
|
for (; puVar6 != newPlayersEnd; puVar6 = puVar6 + 5) {
|
|
*puVar6 = KAGE::System::UserProfileBase::vftable;
|
|
}
|
|
uVar4 = ((GHIDRA_INT(newPlayersCapacity) - GHIDRA_INT(newPlayersBegin)) / 0x14) * 0x14;
|
|
puVar6 = newPlayersBegin;
|
|
if (0xfff < uVar4) {
|
|
puVar6 = GHIDRA_CAST<uint32_t *>(newPlayersBegin[-1]);
|
|
uVar4 = uVar4 + 0x23;
|
|
if (0x1f < GHIDRA_UINT((GHIDRA_INT(newPlayersBegin) + (-4 - GHIDRA_INT(puVar6))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(puVar6,uVar4);
|
|
}
|
|
}
|
|
ExceptionList = local_1c;
|
|
return;
|
|
}
|
|
|
|
// 0090df40
|
|
void NetplayManager::process_pending_joins(uint8_t isForce)
|
|
{
|
|
char cVar1;
|
|
uint32_t uVar2;
|
|
int iVar3;
|
|
void *pvVar4;
|
|
undefined3 in_stack_00000005;
|
|
void *message;
|
|
void *messageRefCount;
|
|
uint8_t stream [4];
|
|
void *pvStack_b8;
|
|
void *pvStack_b0;
|
|
void *pvStack_a4;
|
|
uint8_t **ppuStack_90;
|
|
int *piStack_8c;
|
|
uint8_t **ownerProfile;
|
|
void *pvStack_84;
|
|
uint8_t isLobbyOwner;
|
|
uint8_t gameDataWriter [80];
|
|
void *challengeString [3];
|
|
uint8_t **lobby;
|
|
int *piStack_1c;
|
|
int *piStack_18;
|
|
uint32_t local_14;
|
|
void *local_10;
|
|
uint8_t *puStack_c;
|
|
void *pvStack_8;
|
|
|
|
pvStack_8 = (void *)0xffffffff;
|
|
puStack_c = &LAB_00b0938e;
|
|
local_10 = ExceptionList;
|
|
uVar2 = __security_cookie ^ GHIDRA_UINT((challengeString + 10));
|
|
ExceptionList = &local_10;
|
|
if ((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x822])) + 0x2)))) != 0) || (isForce != 0)) {
|
|
local_14 = uVar2;
|
|
KAGE_LogMessage(1,GHIDRA_CAST<uint8_t *>("[Frame %d] Processing pending joins \n"));
|
|
if (isForce != 0) {
|
|
reset(this,0);
|
|
}
|
|
add_new_players(this,uVar2);
|
|
lobby = KAGE::Network::Multiplayer::ConstLobby::vftable;
|
|
piStack_1c = GHIDRA_CAST<int *>(0x0);
|
|
piStack_18 = GHIDRA_CAST<int *>(0x0);
|
|
pvStack_8 = (void *)0x0;
|
|
(GHIDRA_CAST<msvc::shared_ptr *>((&piStack_1c)))->msvc::shared_ptr::assign(&g_multiplayerLobbyPtr);
|
|
lobby = KAGE::Network::Multiplayer::Lobby::vftable;
|
|
pvStack_8 = (void *)0x1;
|
|
if (piStack_1c == GHIDRA_CAST<int *>(0x0)) {
|
|
pvStack_84 = (void *)0x0;
|
|
}
|
|
else {
|
|
iVar3 = (**(code **)(*piStack_1c + 0x20))(&ppuStack_90);
|
|
pvStack_84 = *(void **)(iVar3 + 4);
|
|
ppuStack_90 = KAGE::System::UserProfileBase::vftable;
|
|
}
|
|
ownerProfile = KAGE::System::UserProfile::vftable;
|
|
pvStack_8 = (void *)CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(pvStack_8)) + 0x1))),2);
|
|
isLobbyOwner = (GHIDRA_CAST<KAGE::System::UserProfile *>((&ownerProfile)))->KAGE::System::UserProfile::is_local_user();
|
|
ownerProfile = KAGE::System::UserProfileBase::vftable;
|
|
lobby = KAGE::Network::Multiplayer::ConstLobby::vftable;
|
|
pvStack_8 = (void *)0x3;
|
|
if (piStack_18 != GHIDRA_CAST<int *>(0x0)) {
|
|
cVar1 = (**(code **)(*piStack_18 + 0xc))();
|
|
if ((cVar1 != '\0') && (g_lobbyReleaseFn != (void *)0x0)) {
|
|
(*g_lobbyReleaseFn)(&piStack_1c);
|
|
}
|
|
}
|
|
pvStack_8 = (void *)0xffffffff;
|
|
if (isLobbyOwner != 0) {
|
|
(GHIDRA_CAST<KAGE::Filesys::BufferedStream *>((stream)))->KAGE::Filesys::BufferedStream::BufferedStream(0);
|
|
pvStack_8 = (void *)0x4;
|
|
if (isForce == 0) {
|
|
FUN_009193b0();
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(pvStack_8)) + 0x0))) = 6;
|
|
PersistentGameDataWriter::write
|
|
(gameDataWriter,&g_manager->_persistentGameData,&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x55d])) + 0x1))));
|
|
piStack_18 = GHIDRA_CAST<int *>(0xf);
|
|
piStack_1c = GHIDRA_CAST<int *>(0x0);
|
|
challengeString[0] = (void *)0x0;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(pvStack_8)) + 0x0))) = 7;
|
|
FUN_00916f70(g_game->_challenge,challengeString,gameDataWriter,0);
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(pvStack_8)) + 0x0))) = 6;
|
|
if (0xf < piStack_18) {
|
|
uVar2 = GHIDRA_INT(piStack_18) + 1;
|
|
pvVar4 = challengeString[0];
|
|
if (0xfff < uVar2) {
|
|
pvVar4 = *(void **)(GHIDRA_INT(challengeString[0]) + -4);
|
|
uVar2 = GHIDRA_INT(piStack_18) + 0x24;
|
|
if (0x1f < GHIDRA_UINT((GHIDRA_INT(challengeString[0]) + (-4 - GHIDRA_INT(pvVar4))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(pvVar4,uVar2);
|
|
}
|
|
pvStack_8 = (void *)CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(pvStack_8)) + 0x1))),4);
|
|
FUN_00a58200();
|
|
}
|
|
else {
|
|
piStack_18 = GHIDRA_CAST<int *>(0xf);
|
|
piStack_1c = GHIDRA_CAST<int *>(0x0);
|
|
challengeString[0] = (void *)0x0;
|
|
pvStack_8 = (void *)0x5;
|
|
FUN_00916f70(g_game->_challenge,challengeString,&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x55d])) + 0x1))),_isForce);
|
|
pvStack_8 = (void *)CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(pvStack_8)) + 0x1))),4);
|
|
if (0xf < piStack_18) {
|
|
uVar2 = GHIDRA_INT(piStack_18) + 1;
|
|
pvVar4 = challengeString[0];
|
|
if (0xfff < uVar2) {
|
|
pvVar4 = *(void **)(GHIDRA_INT(challengeString[0]) + -4);
|
|
uVar2 = GHIDRA_INT(piStack_18) + 0x24;
|
|
if (0x1f < GHIDRA_UINT((GHIDRA_INT(challengeString[0]) + (-4 - GHIDRA_INT(pvVar4))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(pvVar4,uVar2);
|
|
}
|
|
}
|
|
pvStack_84 = pvStack_b8;
|
|
pvVar4 = pvStack_b0;
|
|
if (pvStack_a4 != (void *)0x0) {
|
|
pvVar4 = pvStack_a4;
|
|
}
|
|
if (g_multiplayerService == (void *)0x0) {
|
|
KAGE_LogMessage(0x10,(uint8_t *)
|
|
"Attempting to create a message when there is no multiplayer service\n"
|
|
);
|
|
}
|
|
messageRefCount = (void *)0x0;
|
|
message = pvStack_84;
|
|
NetConnection::send_message(g_multiplayerService,&ppuStack_90,1,pvVar4,GHIDRA_UINT(pvStack_84),0);
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(pvStack_8)) + 0x0))) = 8;
|
|
FUN_008ef1d0(&ppuStack_90);
|
|
send_message(this,0x1c,message,messageRefCount);
|
|
pvStack_8 = (void *)CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(pvStack_8)) + 0x1))),9);
|
|
if (piStack_8c != GHIDRA_CAST<int *>(0x0)) {
|
|
cVar1 = (**(code **)(*piStack_8c + 0xc))();
|
|
if ((cVar1 != '\0') && (g_multiplayerRelease != (void *)0x0)) {
|
|
(*g_multiplayerRelease)(&ppuStack_90);
|
|
}
|
|
}
|
|
FUN_00a58200();
|
|
}
|
|
}
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 0090e6d0
|
|
uint8_t NetplayManager::check_connection()
|
|
{
|
|
uint8_t *puVar1;
|
|
char isConnected;
|
|
int popupId;
|
|
uint8_t local_d0 [168];
|
|
Vector popupPos;
|
|
uint8_t *puStack_20;
|
|
void *local_1c;
|
|
uint8_t *puStack_18;
|
|
uint32_t local_14;
|
|
|
|
puStack_20 = local_d0 + 0xcc;
|
|
local_14 = 0xffffffff;
|
|
puStack_18 = &LAB_00b093d0;
|
|
local_1c = ExceptionList;
|
|
ExceptionList = &local_1c;
|
|
puVar1 = local_d0 + 0xcc;
|
|
if ((g_multiplayerService != (void *)0x0) &&
|
|
(isConnected = (**(code **)(*GHIDRA_CAST<int *>(g_multiplayerService) + 0x10))
|
|
(__security_cookie ^ GHIDRA_UINT((local_d0 + 0xc0))), puVar1 = puStack_20,
|
|
isConnected != '\0')) {
|
|
ExceptionList = local_1c;
|
|
return 1;
|
|
}
|
|
puStack_20 = puVar1;
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x1d])) + 0x1)))) == -1) {
|
|
popupPos.x = (float)&DAT_bf800000;
|
|
popupPos.y = (float)&DAT_bf800000;
|
|
MessagePopup::MessagePopup
|
|
(local_d0,&g_manager->_font2_TeamMeatEx12,netplay_lost_connection_callback,this,
|
|
&popupPos);
|
|
local_14 = 0;
|
|
MessagePopup::add_ok_button(GHIDRA_CAST<uint8_t *>("##PLATFORM###LOST_CONNECTION_TO_SERVER"),local_d0);
|
|
popupId = (GHIDRA_CAST<PopupQueue *>((&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(g_manager[1]._gamestate)) + 0xcf0))))))->PopupQueue::push(local_d0);
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x1d])) + 0x1)))) = popupId;
|
|
FUN_00420710();
|
|
ExceptionList = local_1c;
|
|
return 0;
|
|
}
|
|
ExceptionList = local_1c;
|
|
return 1;
|
|
}
|
|
|
|
// 0090eca0
|
|
void NetplayManager::send_message(uint32_t flags, void *message, void *messageRefCount)
|
|
{
|
|
uint8_t bVar1;
|
|
char cVar2;
|
|
uint32_t uVar3;
|
|
uint8_t *sentFlag;
|
|
uint32_t uVar4;
|
|
int *peerNode;
|
|
void *pvVar5;
|
|
uint32_t memberIdHigh;
|
|
int64_t localUserId;
|
|
uint8_t auStackY_138 [128];
|
|
void *pvVar6;
|
|
NetplayManager *pNVar7;
|
|
void *foundIt;
|
|
uint8_t **local_90;
|
|
uint32_t local_8c;
|
|
int *memberLobbyRefCount;
|
|
uint8_t **local_84;
|
|
int lobbyImpl;
|
|
int *lobbyRefCount;
|
|
uint64_t idKey;
|
|
void *peerIdLow;
|
|
NetplayManager *peerIdHigh;
|
|
NetplayManager *userIdLow;
|
|
uint32_t userIdHigh;
|
|
int local_60;
|
|
int *peerRefCount;
|
|
uint8_t **local_58;
|
|
int local_54;
|
|
void *sentIds;
|
|
uint32_t local_48;
|
|
NetplayManager *local_44;
|
|
uint64_t local_40;
|
|
uint32_t local_38;
|
|
NetplayManager *pNStack_34;
|
|
void *local_2c;
|
|
NetplayManager *cleanupFlags;
|
|
char isRecipient;
|
|
uint8_t *puStack_20;
|
|
void *local_1c;
|
|
uint8_t *puStack_18;
|
|
uint32_t local_14;
|
|
int userImpl;
|
|
|
|
puStack_20 = GHIDRA_CAST<uint8_t *>((GHIDRA_INT(register0x00000010) + -4));
|
|
puStack_18 = &LAB_00b09533;
|
|
local_1c = ExceptionList;
|
|
ExceptionList = &local_1c;
|
|
cleanupFlags = GHIDRA_CAST<NetplayManager *>(0x0);
|
|
pNStack_34 = GHIDRA_CAST<NetplayManager *>(0x0);
|
|
local_14 = 0;
|
|
local_44 = this;
|
|
if ((flags & 1) == 0) {
|
|
sentIds = (void *)0x0;
|
|
local_48 = 0;
|
|
sentIds = operator_new(0x20);
|
|
*(void **)sentIds = sentIds;
|
|
*(void **)(GHIDRA_CAST<char *>(sentIds) + 4) = sentIds;
|
|
*(void **)(GHIDRA_CAST<char *>(sentIds) + 8) = sentIds;
|
|
*GHIDRA_CAST<uint16_t *>((GHIDRA_CAST<char *>(sentIds) + 0xc)) = 0x101;
|
|
if ((flags & 2) != 0) {
|
|
local_2c = (void *)0x0;
|
|
pNVar7 = GHIDRA_CAST<NetplayManager *>(0x0);
|
|
while( true ) {
|
|
local_84 = KAGE::Network::Multiplayer::ConstLobby::vftable;
|
|
lobbyImpl = 0;
|
|
lobbyRefCount = GHIDRA_CAST<int *>(0x0);
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 2;
|
|
(GHIDRA_CAST<msvc::shared_ptr *>((&lobbyImpl)))->msvc::shared_ptr::assign(&g_multiplayerLobbyPtr);
|
|
cleanupFlags = GHIDRA_CAST<NetplayManager *>((GHIDRA_UINT(pNVar7) | 0x18));
|
|
if (lobbyImpl == 0) {
|
|
pvVar5 = (void *)0x0;
|
|
}
|
|
else {
|
|
pvVar5 = (void *)(*GHIDRA_CAST<int *>((lobbyImpl + 0x14)) - *GHIDRA_CAST<int *>((lobbyImpl + 0x10)) >> 3);
|
|
}
|
|
local_84 = KAGE::Network::Multiplayer::ConstLobby::vftable;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 3;
|
|
if (((lobbyRefCount != GHIDRA_CAST<int *>(0x0)) &&
|
|
(cVar2 = (**(code **)(*lobbyRefCount + 0xc))(), cVar2 != '\0')) &&
|
|
(g_lobbyReleaseFn != (void *)0x0)) {
|
|
(*g_lobbyReleaseFn)();
|
|
}
|
|
if (pvVar5 <= local_2c) break;
|
|
local_90 = KAGE::Network::Multiplayer::ConstLobby::vftable;
|
|
local_8c = 0;
|
|
memberLobbyRefCount = GHIDRA_CAST<int *>(0x0);
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 4;
|
|
(GHIDRA_CAST<msvc::shared_ptr *>((&local_8c)))->msvc::shared_ptr::assign(&g_multiplayerLobbyPtr);
|
|
cleanupFlags = GHIDRA_CAST<NetplayManager *>((GHIDRA_UINT(pNVar7) | 0x78));
|
|
local_90 = KAGE::Network::Multiplayer::Lobby::vftable;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 5;
|
|
(GHIDRA_CAST<KAGE::Network::Multiplayer::Lobby *>((&local_90)))->KAGE::Network::Multiplayer::Lobby::get_member(&local_58,GHIDRA_UINT(local_2c));
|
|
local_90 = KAGE::Network::Multiplayer::ConstLobby::vftable;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 8;
|
|
if (((memberLobbyRefCount != GHIDRA_CAST<int *>(0x0)) &&
|
|
(cVar2 = (**(code **)(*memberLobbyRefCount + 0xc))(), cVar2 != '\0')) &&
|
|
(g_lobbyReleaseFn != (void *)0x0)) {
|
|
(*g_lobbyReleaseFn)();
|
|
}
|
|
local_14 = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))),7);
|
|
pvVar5 = (g_manager->_lobbyMembers)._begin;
|
|
pvVar6 = (g_manager->_lobbyMembers)._end;
|
|
local_40 = CONCAT44(pvVar6,GHIDRA_CAST<NetplayManager *>(local_40));
|
|
if (pvVar5 != pvVar6) {
|
|
do {
|
|
userImpl = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar5) + 4));
|
|
if (userImpl == 0) {
|
|
pNStack_34 = GHIDRA_CAST<NetplayManager *>(0x0);
|
|
pNVar7 = pNStack_34;
|
|
local_38 = 0;
|
|
pNStack_34 = GHIDRA_CAST<NetplayManager *>(0x0);
|
|
}
|
|
else {
|
|
pNStack_34 = *GHIDRA_CAST<NetplayManager **>((userImpl + 8));
|
|
pNVar7 = *GHIDRA_CAST<NetplayManager **>((userImpl + 0xc));
|
|
}
|
|
localUserId = FUN_00a23920();
|
|
if (localUserId == CONCAT44(pNVar7,pNStack_34)) goto LAB_0090ef7c;
|
|
pvVar5 = (void *)(GHIDRA_INT(pvVar5) + 0x14);
|
|
} while (pvVar5 != (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_40)) + 0x4))));
|
|
}
|
|
userImpl = local_54;
|
|
if (local_54 == 0) {
|
|
local_40 = 0;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_40)) + 0x4))) = GHIDRA_CAST<NetplayManager *>(0x0);
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_40)) + 0x0))) = GHIDRA_CAST<NetplayManager *>(0x0);
|
|
userIdLow = GHIDRA_CAST<NetplayManager *>(local_40);
|
|
memberIdHigh = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(local_40))) + 0x4)));
|
|
}
|
|
else {
|
|
userIdLow = *GHIDRA_CAST<NetplayManager **>((local_54 + 8));
|
|
memberIdHigh = *GHIDRA_CAST<uint32_t *>((local_54 + 0xc));
|
|
}
|
|
userIdHigh = memberIdHigh;
|
|
pNStack_34 = userIdLow;
|
|
FUN_00731ee0();
|
|
if (((*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(foundIt) + 0xd)) == '\0') &&
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(foundIt) + 0x14)) <= memberIdHigh)) &&
|
|
(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(foundIt) + 0x14)) < memberIdHigh ||
|
|
(*GHIDRA_CAST<NetplayManager **>((GHIDRA_CAST<char *>(foundIt) + 0x10)) <= pNStack_34)) && (foundIt != sentIds)))) {
|
|
LAB_0090ef7c:
|
|
isRecipient = '\0';
|
|
}
|
|
else {
|
|
if (g_multiplayerService == (void *)0x0) {
|
|
KAGE::SmartPointer<ConnectionBase>::SmartPointer();
|
|
}
|
|
else {
|
|
if (userImpl == 0) {
|
|
local_40 = 0;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_40)) + 0x4))) = GHIDRA_CAST<NetplayManager *>(0x0);
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_40)) + 0x0))) = (void *)0x0;
|
|
peerIdLow = GHIDRA_CAST<NetplayManager *>(local_40);
|
|
peerIdHigh = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_40)) + 0x4)));
|
|
}
|
|
else {
|
|
peerIdLow = *(void **)(userImpl + 8);
|
|
peerIdHigh = *GHIDRA_CAST<NetplayManager **>((userImpl + 0xc));
|
|
}
|
|
(GHIDRA_CAST<NetworkManager *>((g_multiplayerService)))->NetworkManager::get_peer(&local_60,GHIDRA_CAST<uint64_t *>(&peerIdLow));
|
|
}
|
|
local_14 = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))),9);
|
|
cleanupFlags = GHIDRA_CAST<NetplayManager *>((GHIDRA_UINT(cleanupFlags) | 0x81));
|
|
pNStack_34 = cleanupFlags;
|
|
if ((local_60 == 0) &&
|
|
((bVar1 = (GHIDRA_CAST<KAGE::System::UserProfile *>((&local_58)))->KAGE::System::UserProfile::is_local_user(), bVar1 == 0 ||
|
|
((flags & 0x10) == 0)))) goto LAB_0090ef7c;
|
|
isRecipient = '\x01';
|
|
}
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))) = 0;
|
|
if ((GHIDRA_UINT(cleanupFlags) & 1) != 0) {
|
|
cleanupFlags = GHIDRA_CAST<NetplayManager *>((GHIDRA_UINT(cleanupFlags) & 0xfffffffe));
|
|
local_14 = 10;
|
|
if (((peerRefCount != GHIDRA_CAST<int *>(0x0)) &&
|
|
(cVar2 = (**(code **)(*peerRefCount + 0xc))(), cVar2 != '\0')) &&
|
|
(g_connectionReleaseFn != (void *)0x0)) {
|
|
(*g_connectionReleaseFn)();
|
|
}
|
|
}
|
|
pvVar5 = messageRefCount;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 7;
|
|
if (isRecipient != '\0') {
|
|
pvVar6 = (void *)0x0;
|
|
peerNode = GHIDRA_CAST<int *>(0x0);
|
|
local_40 = CONCAT44(message,GHIDRA_CAST<NetplayManager *>(local_40));
|
|
if ((messageRefCount != (void *)0x0) &&
|
|
(cVar2 = (**(code **)(*GHIDRA_CAST<int *>(messageRefCount) + 4))(), cVar2 != '\0')) {
|
|
if ((peerNode != GHIDRA_CAST<int *>(0x0)) &&
|
|
((cVar2 = (**(code **)(*peerNode + 0xc))(), cVar2 != '\0' &&
|
|
(g_multiplayerRelease != (void *)0x0)))) {
|
|
(*g_multiplayerRelease)(auStackY_138 + 0x84);
|
|
}
|
|
pvVar6 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_40)) + 0x4)));
|
|
peerNode = pvVar5;
|
|
}
|
|
multiplayer_send_message(&local_58,pvVar6,peerNode);
|
|
if (local_54 == 0) {
|
|
local_40 = 0;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_40)) + 0x4))) = GHIDRA_CAST<NetplayManager *>(0x0);
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_40)) + 0x0))) = GHIDRA_CAST<NetplayManager *>(0x0);
|
|
uVar3 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_40)) + 0x4)));
|
|
uVar4 = GHIDRA_CAST<NetplayManager *>(local_40);
|
|
}
|
|
else {
|
|
uVar3 = *GHIDRA_CAST<uint32_t *>((local_54 + 0xc));
|
|
uVar4 = *GHIDRA_CAST<uint32_t *>((local_54 + 8));
|
|
}
|
|
idKey = CONCAT44(uVar3,uVar4);
|
|
sentFlag = map_u64_bool_subscript(&sentIds,&idKey);
|
|
*sentFlag = 1;
|
|
}
|
|
local_2c = (void *)(GHIDRA_INT(local_2c) + 1);
|
|
local_58 = KAGE::System::UserProfileBase::vftable;
|
|
pNVar7 = cleanupFlags;
|
|
}
|
|
this = local_44;
|
|
}
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 1;
|
|
if ((flags & 4) != 0) {
|
|
peerNode = GHIDRA_CAST<int *>(**(int **))&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x821])) + 0x1)));
|
|
local_40 = CONCAT44(peerNode,GHIDRA_CAST<NetplayManager *>(local_40));
|
|
if (peerNode != *GHIDRA_CAST<int **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x821])) + 0x1))))) {
|
|
do {
|
|
userImpl = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(peerNode) + 0x1c));
|
|
if (userImpl == 0) {
|
|
idKey = 0;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(idKey)) + 0x4))) = GHIDRA_CAST<NetplayManager *>(0x0);
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(idKey)) + 0x0))) = (void *)0x0;
|
|
peerIdHigh = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(idKey)) + 0x4)));
|
|
peerIdLow = GHIDRA_CAST<NetplayManager *>(idKey);
|
|
}
|
|
else {
|
|
peerIdHigh = *GHIDRA_CAST<NetplayManager **>((userImpl + 0xc));
|
|
peerIdLow = *(void **)(userImpl + 8);
|
|
}
|
|
local_2c = peerIdLow;
|
|
pNStack_34 = peerIdHigh;
|
|
FUN_00731ee0();
|
|
if ((((*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(foundIt) + 0xd)) == '\0') &&
|
|
(*GHIDRA_CAST<NetplayManager **>((GHIDRA_CAST<char *>(foundIt) + 0x14)) <= pNStack_34)) &&
|
|
((*GHIDRA_CAST<NetplayManager **>((GHIDRA_CAST<char *>(foundIt) + 0x14)) < pNStack_34 ||
|
|
(*(void **)(GHIDRA_CAST<char *>(foundIt) + 0x10) <= local_2c)))) && (foundIt != sentIds)) {
|
|
LAB_0090f165:
|
|
isRecipient = '\0';
|
|
}
|
|
else {
|
|
if (g_multiplayerService == (void *)0x0) {
|
|
KAGE::SmartPointer<ConnectionBase>::SmartPointer();
|
|
}
|
|
else {
|
|
if (userImpl == 0) {
|
|
idKey = 0;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(idKey)) + 0x4))) = GHIDRA_CAST<NetplayManager *>(0x0);
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(idKey)) + 0x0))) = GHIDRA_CAST<NetplayManager *>(0x0);
|
|
userIdLow = GHIDRA_CAST<NetplayManager *>(idKey);
|
|
userIdHigh = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(idKey))) + 0x4)));
|
|
}
|
|
else {
|
|
userIdLow = *GHIDRA_CAST<NetplayManager **>((userImpl + 8));
|
|
userIdHigh = *GHIDRA_CAST<uint32_t *>((userImpl + 0xc));
|
|
}
|
|
(GHIDRA_CAST<NetworkManager *>((g_multiplayerService)))->NetworkManager::get_peer(&local_60,GHIDRA_CAST<uint64_t *>(&userIdLow));
|
|
}
|
|
local_14 = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))),0xb);
|
|
cleanupFlags = GHIDRA_CAST<NetplayManager *>((GHIDRA_UINT(cleanupFlags) | 0x102));
|
|
pNStack_34 = cleanupFlags;
|
|
if ((local_60 == 0) &&
|
|
((cVar2 = (**(code **)(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(peerNode) + 0x18)) + 0x14))(), cVar2 == '\0' ||
|
|
((flags & 0x10) == 0)))) goto LAB_0090f165;
|
|
isRecipient = '\x01';
|
|
}
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))) = 0;
|
|
if ((GHIDRA_UINT(cleanupFlags) & 2) != 0) {
|
|
cleanupFlags = GHIDRA_CAST<NetplayManager *>((GHIDRA_UINT(cleanupFlags) & 0xfffffffd));
|
|
local_14 = 0xc;
|
|
if (((peerRefCount != GHIDRA_CAST<int *>(0x0)) &&
|
|
(cVar2 = (**(code **)(*peerRefCount + 0xc))(), cVar2 != '\0')) &&
|
|
(g_connectionReleaseFn != (void *)0x0)) {
|
|
(*g_connectionReleaseFn)();
|
|
}
|
|
}
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 1;
|
|
if (isRecipient != '\0') {
|
|
pvVar5 = (void *)0x0;
|
|
pNVar7 = GHIDRA_CAST<NetplayManager *>(0x0);
|
|
pNStack_34 = messageRefCount;
|
|
local_2c = message;
|
|
if ((messageRefCount != (void *)0x0) &&
|
|
(cVar2 = (**(code **)(*GHIDRA_CAST<int *>(messageRefCount) + 4))(), cVar2 != '\0')) {
|
|
if ((pNVar7 != GHIDRA_CAST<NetplayManager *>(0x0)) &&
|
|
((cVar2 = (**(code **)(*GHIDRA_CAST<int *>(pNVar7) + 0xc))(), cVar2 != '\0' &&
|
|
(g_multiplayerRelease != (void *)0x0)))) {
|
|
(*g_multiplayerRelease)(auStackY_138 + 0x84);
|
|
}
|
|
pvVar5 = local_2c;
|
|
pNVar7 = pNStack_34;
|
|
}
|
|
multiplayer_send_message((void *)(GHIDRA_INT(peerNode) + 0x18),pvVar5,pNVar7);
|
|
userImpl = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(peerNode) + 0x1c));
|
|
if (userImpl == 0) {
|
|
idKey = 0;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(idKey)) + 0x4))) = GHIDRA_CAST<NetplayManager *>(0x0);
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(idKey)) + 0x0))) = GHIDRA_CAST<NetplayManager *>(0x0);
|
|
local_54 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_INT(idKey))) + 0x4)));
|
|
local_58 = GHIDRA_CAST<uint8_t **>(GHIDRA_CAST<NetplayManager *>(idKey));
|
|
}
|
|
else {
|
|
local_54 = *GHIDRA_CAST<int *>((userImpl + 0xc));
|
|
local_58 = *GHIDRA_CAST<uint8_t ***>((userImpl + 8));
|
|
}
|
|
sentFlag = map_u64_bool_subscript(&sentIds,GHIDRA_CAST<uint64_t *>(&local_58));
|
|
*sentFlag = 1;
|
|
}
|
|
msvc::
|
|
_Tree_unchecked_const_iterator<msvc::_Tree_val<msvc::_Tree_simple_types<unsigned_int>_>,msvc::_Iterator_base0>
|
|
::operator++((_Tree_unchecked_const_iterator<msvc::_Tree_val<msvc::_Tree_simple_types<unsigned_int>_>,msvc::_Iterator_base0>
|
|
*)(GHIDRA_INT(&local_40) + 4));
|
|
peerNode = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<int *>(local_40))) + 0x4)));
|
|
} while ((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_40)) + 0x4))) != GHIDRA_CAST<NetplayManager *>(*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_44[0x821])) + 0x1))))));
|
|
}
|
|
}
|
|
if (((flags & 8) != 0) &&
|
|
(peerNode = (g_manager->_lobbyMembers)._begin, peerNode != (g_manager->_lobbyMembers)._end))
|
|
{
|
|
do {
|
|
userImpl = peerNode[1];
|
|
if (userImpl == 0) {
|
|
idKey = 0;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(idKey)) + 0x4))) = GHIDRA_CAST<NetplayManager *>(0x0);
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(idKey)) + 0x0))) = (void *)0x0;
|
|
peerIdHigh = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(idKey)) + 0x4)));
|
|
peerIdLow = GHIDRA_CAST<NetplayManager *>(idKey);
|
|
}
|
|
else {
|
|
peerIdHigh = *GHIDRA_CAST<NetplayManager **>((userImpl + 0xc));
|
|
peerIdLow = *(void **)(userImpl + 8);
|
|
}
|
|
local_40 = CONCAT44(peerIdLow,GHIDRA_CAST<NetplayManager *>(local_40));
|
|
local_44 = peerIdHigh;
|
|
FUN_00731ee0();
|
|
if ((((*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(foundIt) + 0xd)) == '\0') &&
|
|
(*GHIDRA_CAST<NetplayManager **>((GHIDRA_CAST<char *>(foundIt) + 0x14)) <= local_44)) &&
|
|
((*GHIDRA_CAST<NetplayManager **>((GHIDRA_CAST<char *>(foundIt) + 0x14)) < local_44 ||
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(foundIt) + 0x10)) <= (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_40)) + 0x4))))))) && (foundIt != sentIds)) {
|
|
LAB_0090f35f:
|
|
isRecipient = '\0';
|
|
}
|
|
else {
|
|
if (g_multiplayerService == (void *)0x0) {
|
|
KAGE::SmartPointer<ConnectionBase>::SmartPointer();
|
|
}
|
|
else {
|
|
if (userImpl == 0) {
|
|
idKey = 0;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(idKey)) + 0x4))) = GHIDRA_CAST<NetplayManager *>(0x0);
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(idKey)) + 0x0))) = GHIDRA_CAST<NetplayManager *>(0x0);
|
|
userIdLow = GHIDRA_CAST<NetplayManager *>(idKey);
|
|
userIdHigh = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(idKey))) + 0x4)));
|
|
}
|
|
else {
|
|
userIdLow = *GHIDRA_CAST<NetplayManager **>((userImpl + 8));
|
|
userIdHigh = *GHIDRA_CAST<uint32_t *>((userImpl + 0xc));
|
|
}
|
|
(GHIDRA_CAST<NetworkManager *>((g_multiplayerService)))->NetworkManager::get_peer(&local_60,GHIDRA_CAST<uint64_t *>(&userIdLow));
|
|
}
|
|
local_14 = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))),0xd);
|
|
cleanupFlags = GHIDRA_CAST<NetplayManager *>((GHIDRA_UINT(cleanupFlags) | 0x204));
|
|
pNStack_34 = cleanupFlags;
|
|
if ((local_60 == 0) &&
|
|
((cVar2 = (**(code **)(*peerNode + 0x14))(), cVar2 == '\0' || ((flags & 0x10) == 0))))
|
|
goto LAB_0090f35f;
|
|
isRecipient = '\x01';
|
|
}
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))) = 0;
|
|
if ((GHIDRA_UINT(cleanupFlags) & 4) != 0) {
|
|
cleanupFlags = GHIDRA_CAST<NetplayManager *>((GHIDRA_UINT(cleanupFlags) & 0xfffffffb));
|
|
local_14 = 0xe;
|
|
if (((peerRefCount != GHIDRA_CAST<int *>(0x0)) &&
|
|
(cVar2 = (**(code **)(*peerRefCount + 0xc))(), cVar2 != '\0')) &&
|
|
(g_connectionReleaseFn != (void *)0x0)) {
|
|
(*g_connectionReleaseFn)();
|
|
}
|
|
}
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 1;
|
|
if (isRecipient != '\0') {
|
|
pvVar5 = (void *)0x0;
|
|
pNVar7 = GHIDRA_CAST<NetplayManager *>(0x0);
|
|
local_44 = messageRefCount;
|
|
local_40 = CONCAT44(message,GHIDRA_CAST<NetplayManager *>(local_40));
|
|
if ((messageRefCount != (void *)0x0) &&
|
|
(cVar2 = (**(code **)(*GHIDRA_CAST<int *>(messageRefCount) + 4))(), cVar2 != '\0')) {
|
|
if ((pNVar7 != GHIDRA_CAST<NetplayManager *>(0x0)) &&
|
|
((cVar2 = (**(code **)(*GHIDRA_CAST<int *>(pNVar7) + 0xc))(), cVar2 != '\0' &&
|
|
(g_multiplayerRelease != (void *)0x0)))) {
|
|
(*g_multiplayerRelease)(auStackY_138 + 0x84);
|
|
}
|
|
pvVar5 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_40)) + 0x4)));
|
|
pNVar7 = local_44;
|
|
}
|
|
multiplayer_send_message(peerNode,pvVar5,pNVar7);
|
|
userImpl = peerNode[1];
|
|
if (userImpl == 0) {
|
|
idKey = 0;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(idKey)) + 0x4))) = GHIDRA_CAST<NetplayManager *>(0x0);
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(idKey)) + 0x0))) = GHIDRA_CAST<NetplayManager *>(0x0);
|
|
local_54 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_INT(idKey))) + 0x4)));
|
|
local_58 = GHIDRA_CAST<uint8_t **>(GHIDRA_CAST<NetplayManager *>(idKey));
|
|
}
|
|
else {
|
|
local_54 = *GHIDRA_CAST<int *>((userImpl + 0xc));
|
|
local_58 = *GHIDRA_CAST<uint8_t ***>((userImpl + 8));
|
|
}
|
|
sentFlag = map_u64_bool_subscript(&sentIds,GHIDRA_CAST<uint64_t *>(&local_58));
|
|
*sentFlag = 1;
|
|
}
|
|
peerNode = peerNode + 5;
|
|
} while (peerNode != (g_manager->_lobbyMembers)._end);
|
|
}
|
|
FID_conflict__Erase_tree<fuzzer::fuzzer_allocator<msvc::_Tree_node<fuzzer::TracePC::PCTableEntry_const*,void*>_>_>
|
|
(&sentIds,(fuzzer_allocator<msvc::_Tree_node<unsigned_int,void*>_> *)&sentIds,
|
|
*(_Tree_node<unsigned_int,void*> **)(GHIDRA_INT(sentIds) + 4));
|
|
operator_delete(sentIds,0x20);
|
|
}
|
|
else {
|
|
puStack_20 = GHIDRA_CAST<uint8_t *>((GHIDRA_INT(register0x00000010) + -4));
|
|
FUN_008ef1d0(&message);
|
|
FUN_00a29a40((uint8_t)(flags >> 4) & 1);
|
|
}
|
|
local_14 = 0xf;
|
|
if (((messageRefCount != (void *)0x0) &&
|
|
(cVar2 = (**(code **)(*GHIDRA_CAST<int *>(messageRefCount) + 0xc))(), cVar2 != '\0')) &&
|
|
(g_multiplayerRelease != (void *)0x0)) {
|
|
(*g_multiplayerRelease)();
|
|
}
|
|
ExceptionList = local_1c;
|
|
return;
|
|
}
|
|
|
|
// 0090f760
|
|
void NetplayManager::process_drop_player_message()
|
|
{
|
|
NetplayManager *dropEntry = this;
|
|
char cVar1;
|
|
uint8_t bVar2;
|
|
uint32_t uVar3;
|
|
int *piVar4;
|
|
uint64_t *dropEntry;
|
|
int extraout_EAX;
|
|
uint32_t uVar5;
|
|
int extraout_EAX_00;
|
|
int extraout_EAX_01;
|
|
int extraout_EAX_02;
|
|
int extraout_EAX_03;
|
|
uint8_t *profileName;
|
|
uint32_t *puVar6;
|
|
int extraout_EAX_04;
|
|
int extraout_EAX_05;
|
|
int extraout_EAX_06;
|
|
int extraout_EAX_07;
|
|
int extraout_EAX_08;
|
|
int extraout_EAX_09;
|
|
int extraout_EAX_10;
|
|
int extraout_EAX_11;
|
|
int extraout_EAX_12;
|
|
int extraout_EAX_13;
|
|
int extraout_EAX_14;
|
|
Entity_Player *kickedPlayer;
|
|
uint8_t *nameEnd;
|
|
uint8_t *******textEnd;
|
|
uint32_t uVar7;
|
|
uint32_t userIdLow;
|
|
uint8_t *******textBuffer;
|
|
void *freeBlock;
|
|
int unused1;
|
|
int iVar8;
|
|
uint8_t voteIter [8];
|
|
uint32_t kickedIdLow;
|
|
uint32_t kickedIdHigh;
|
|
uint32_t execSenderIdLow;
|
|
uint32_t execSenderIdHigh;
|
|
uint32_t offVoterIdLow;
|
|
uint32_t offVoterIdHigh;
|
|
uint32_t offSenderIdLow;
|
|
uint32_t offSenderIdHigh;
|
|
uint32_t voterIdLow;
|
|
uint32_t voterIdHigh;
|
|
uint32_t senderIdLow;
|
|
uint32_t senderIdHigh;
|
|
uint8_t peekedMessage [4];
|
|
int *peekedRefCount;
|
|
uint8_t **targetProfile;
|
|
int targetProfileData;
|
|
uint8_t **execTargetProfile;
|
|
int execTargetProfileData;
|
|
uint8_t **offTargetProfile;
|
|
int offTargetProfileData;
|
|
uint8_t **removeProfile [2];
|
|
uint8_t **banProfile;
|
|
int banProfileData;
|
|
uint8_t **execSenderProfile [2];
|
|
uint8_t **execCheckProfile [2];
|
|
uint8_t **kickedChatProfile [2];
|
|
uint8_t **execTargetNameProfile [2];
|
|
uint8_t **offSenderProfile [2];
|
|
uint8_t **offTargetNameProfile [2];
|
|
uint8_t **banCheckProfile [2];
|
|
uint8_t **targetChatProfile [2];
|
|
uint8_t **targetCheckProfile [2];
|
|
uint8_t **senderProfile [2];
|
|
uint8_t **targetNameProfile [2];
|
|
uint32_t *messageData;
|
|
int *messageRefCount;
|
|
uint32_t logSenderIdLow;
|
|
uint32_t local_a4;
|
|
uint64_t local_a0;
|
|
uint64_t uStack_98;
|
|
uint64_t local_90;
|
|
uint8_t *******kickVoteText;
|
|
uint32_t uStack_80;
|
|
uint32_t uStack_7c;
|
|
uint32_t uStack_78;
|
|
uint32_t kickVoteTextSize;
|
|
uint32_t kickVoteTextCapacity;
|
|
uint8_t *******kickedText;
|
|
uint32_t uStack_68;
|
|
uint32_t uStack_64;
|
|
uint32_t uStack_60;
|
|
uint32_t kickedTextSize;
|
|
uint32_t kickedTextCapacity;
|
|
void *chatLine [4];
|
|
uint32_t chatLineSize;
|
|
uint32_t chatLineCapacity;
|
|
uint64_t nameText;
|
|
char acStack_34 [12];
|
|
uint32_t nameTextCapacity;
|
|
uint32_t stackCookie;
|
|
uint8_t *puStack_20;
|
|
void *savedExceptionList;
|
|
uint8_t *puStack_18;
|
|
uint32_t ehState;
|
|
|
|
puStack_20 = acStack_34 + 0x30;
|
|
puStack_18 = &LAB_00b09748;
|
|
savedExceptionList = ExceptionList;
|
|
uVar3 = __security_cookie ^ GHIDRA_UINT((acStack_34 + 0x24));
|
|
ExceptionList = &savedExceptionList;
|
|
stackCookie = uVar3;
|
|
do {
|
|
ehState = 0xffffffff;
|
|
if (g_multiplayerService == (void *)0x0) {
|
|
ExceptionList = savedExceptionList;
|
|
return;
|
|
}
|
|
piVar4 = (GHIDRA_CAST<NetworkManager *>((g_multiplayerService)))->NetworkManager::receive_message(peekedMessage,5,0);
|
|
iVar8 = *piVar4;
|
|
ehState = 0;
|
|
if (((peekedRefCount != GHIDRA_CAST<int *>(0x0)) &&
|
|
(cVar1 = (**(code **)(*peekedRefCount + 0xc))(uVar3), cVar1 != '\0')) &&
|
|
(g_multiplayerRelease != (void *)0x0)) {
|
|
(*g_multiplayerRelease)(peekedMessage);
|
|
}
|
|
ehState = 0xffffffff;
|
|
if (iVar8 == 0) {
|
|
ExceptionList = savedExceptionList;
|
|
return;
|
|
}
|
|
if (g_multiplayerService == (void *)0x0) {
|
|
KAGE::SmartPointer<MessageData>::reset(0);
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<NetworkManager *>((g_multiplayerService)))->NetworkManager::receive_message(&messageData,5,1);
|
|
}
|
|
ehState = 1;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_90)) + 0x4))) = messageData;
|
|
if (messageData[3] != 1) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("This function should only be called on consolidated messages"));
|
|
}
|
|
if (*GHIDRA_CAST<int *>((*(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<int *>(local_90))) + 0x4)))[2] + 0x18)) != 0x20) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("Invalid data size recieved for Drop Player Message \n"));
|
|
}
|
|
puVar6 = messageData;
|
|
if (messageData[3] != 1) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("This function should only be called on consolidated messages"));
|
|
}
|
|
local_90 = CONCAT44(*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(puVar6[2]) + 0x14)) + 8,(uint32_t)local_90);
|
|
dropEntry = get_drop_entry(dropEntry,*GHIDRA_CAST<uint64_t *>((*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(puVar6[2]) + 0x14)) + 0x10)));
|
|
if (dropEntry == GHIDRA_CAST<uint64_t *>(0x0)) {
|
|
KAGE_LogMessage(8,(uint8_t *)
|
|
"[Frame: %d] Recieved Drop Player Message with invalid drop player ID: %llu \n"
|
|
);
|
|
}
|
|
else {
|
|
iVar8 = *(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_90)) + 0x4)));
|
|
if (iVar8 == 0) {
|
|
senderIdLow = *messageData;
|
|
senderIdHigh = messageData[1];
|
|
senderProfile[0] = KAGE::System::UserProfileBase::vftable;
|
|
logSenderIdLow = senderIdLow;
|
|
local_a4 = senderIdHigh;
|
|
(GHIDRA_CAST<UserProfile *>((&senderIdLow)))->UserProfile::find_or_create();
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 2;
|
|
senderProfile[0] = KAGE::System::UserProfile::vftable;
|
|
if (((extraout_EAX != 0) &&
|
|
(*GHIDRA_CAST<int *>((extraout_EAX + 8)) != 0 || *GHIDRA_CAST<int *>((extraout_EAX + 0xc)) != 0)) &&
|
|
(*GHIDRA_CAST<int *>((extraout_EAX + 0x14)) == 0)) {
|
|
(GHIDRA_CAST<KAGE::System::UserProfile *>((senderProfile)))->KAGE::System::UserProfile::load_steam_avatar();
|
|
}
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 3;
|
|
uVar5 = (*(code *)senderProfile[0][1])();
|
|
uStack_98 = CONCAT44(uVar5,(uint32_t)uStack_98);
|
|
targetProfile = KAGE::System::UserProfileBase::vftable;
|
|
(GHIDRA_CAST<UserProfile *>((dropEntry)))->UserProfile::find_or_create();
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 4;
|
|
targetProfile = KAGE::System::UserProfile::vftable;
|
|
targetProfileData = extraout_EAX_00;
|
|
if (((extraout_EAX_00 != 0) &&
|
|
(*GHIDRA_CAST<int *>((extraout_EAX_00 + 8)) != 0 || *GHIDRA_CAST<int *>((extraout_EAX_00 + 0xc)) != 0)) &&
|
|
(*GHIDRA_CAST<int *>((extraout_EAX_00 + 0x14)) == 0)) {
|
|
(GHIDRA_CAST<KAGE::System::UserProfile *>((&targetProfile)))->KAGE::System::UserProfile::load_steam_avatar();
|
|
}
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 5;
|
|
if (targetProfileData == 0) {
|
|
local_a0 = local_a0 & 0xffffffff;
|
|
local_90 = 0;
|
|
}
|
|
else {
|
|
local_90 = CONCAT44(*GHIDRA_CAST<uint32_t *>((targetProfileData + 8)),(uint32_t)local_90);
|
|
local_a0 = CONCAT44(*GHIDRA_CAST<uint32_t *>((targetProfileData + 0xc)),(uint32_t)local_a0);
|
|
}
|
|
targetNameProfile[0] = KAGE::System::UserProfileBase::vftable;
|
|
(GHIDRA_CAST<UserProfile *>((dropEntry)))->UserProfile::find_or_create();
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 6;
|
|
targetNameProfile[0] = KAGE::System::UserProfile::vftable;
|
|
if (((extraout_EAX_01 != 0) &&
|
|
(*GHIDRA_CAST<int *>((extraout_EAX_01 + 8)) != 0 || *GHIDRA_CAST<int *>((extraout_EAX_01 + 0xc)) != 0)) &&
|
|
(*GHIDRA_CAST<int *>((extraout_EAX_01 + 0x14)) == 0)) {
|
|
(GHIDRA_CAST<KAGE::System::UserProfile *>((targetNameProfile)))->KAGE::System::UserProfile::load_steam_avatar();
|
|
}
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 7;
|
|
(*(code *)targetNameProfile[0][1])();
|
|
KAGE_LogMessage(1,(uint8_t *)
|
|
"[Frame: %d] Recieved eDropMessageType::MSG_DROP_ON for player \"%s\" %llu from player \"%s\" %llu \n"
|
|
);
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 1;
|
|
targetNameProfile[0] = KAGE::System::UserProfileBase::vftable;
|
|
targetProfile = KAGE::System::UserProfileBase::vftable;
|
|
senderProfile[0] = KAGE::System::UserProfileBase::vftable;
|
|
voterIdLow = *messageData;
|
|
voterIdHigh = messageData[1];
|
|
piVar4 = GHIDRA_CAST<int *>(FUN_00915960(voteIter,&voterIdLow));
|
|
*GHIDRA_CAST<uint8_t *>((*piVar4 + 0x18)) = 1;
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(dropEntry[1])) + 0x1)))) - *GHIDRA_CAST<int *>(dropEntry) >> 2 != 0) {
|
|
targetCheckProfile[0] = KAGE::System::UserProfileBase::vftable;
|
|
(GHIDRA_CAST<UserProfile *>((dropEntry)))->UserProfile::find_or_create();
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 8;
|
|
targetCheckProfile[0] = KAGE::System::UserProfile::vftable;
|
|
if (((extraout_EAX_02 != 0) &&
|
|
(*GHIDRA_CAST<int *>((extraout_EAX_02 + 8)) != 0 || *GHIDRA_CAST<int *>((extraout_EAX_02 + 0xc)) != 0)) &&
|
|
(*GHIDRA_CAST<int *>((extraout_EAX_02 + 0x14)) == 0)) {
|
|
(GHIDRA_CAST<KAGE::System::UserProfile *>((targetCheckProfile)))->KAGE::System::UserProfile::load_steam_avatar();
|
|
}
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 9;
|
|
cVar1 = (*(code *)targetCheckProfile[0][5])();
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 1;
|
|
targetCheckProfile[0] = KAGE::System::UserProfileBase::vftable;
|
|
if (cVar1 == '\0') {
|
|
targetChatProfile[0] = KAGE::System::UserProfileBase::vftable;
|
|
(GHIDRA_CAST<UserProfile *>((dropEntry)))->UserProfile::find_or_create();
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 10;
|
|
targetChatProfile[0] = KAGE::System::UserProfile::vftable;
|
|
if (((extraout_EAX_03 != 0) &&
|
|
(*GHIDRA_CAST<int *>((extraout_EAX_03 + 8)) != 0 || *GHIDRA_CAST<int *>((extraout_EAX_03 + 0xc)) != 0)) &&
|
|
(*GHIDRA_CAST<int *>((extraout_EAX_03 + 0x14)) == 0)) {
|
|
(GHIDRA_CAST<KAGE::System::UserProfile *>((targetChatProfile)))->KAGE::System::UserProfile::load_steam_avatar();
|
|
}
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 0xb;
|
|
profileName = GHIDRA_CAST<uint8_t *>((*(code *)targetChatProfile[0][1])());
|
|
acStack_34[8] = '\0';
|
|
acStack_34[9] = '\0';
|
|
acStack_34[10] = '\0';
|
|
acStack_34[0xb] = '\0';
|
|
nameTextCapacity = 0xf;
|
|
nameText = nameText & 0xffffffff00000000;
|
|
uStack_98 = CONCAT44(profileName + 1,(uint32_t)uStack_98);
|
|
nameEnd = profileName;
|
|
do {
|
|
bVar2 = *nameEnd;
|
|
nameEnd = nameEnd + 1;
|
|
} while (bVar2 != 0);
|
|
(GHIDRA_CAST<msvc::string *>((GHIDRA_CAST<char *>(&nameText))))->msvc::string::assign(profileName,GHIDRA_INT(nameEnd) - GHIDRA_INT((profileName + 1)))
|
|
;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 0xc;
|
|
puVar6 = (GHIDRA_CAST<msvc::string *>((GHIDRA_CAST<char *>(&nameText))))->msvc::string::append(GHIDRA_CAST<uint8_t *>(" RECEIVED A KICK VOTE"),0x15);
|
|
kickVoteText = GHIDRA_CAST<uint8_t *******>(*puVar6);
|
|
kickVoteTextSize = puVar6[4];
|
|
kickVoteTextCapacity = puVar6[5];
|
|
uStack_80 = puVar6[1];
|
|
uStack_7c = puVar6[2];
|
|
uStack_78 = puVar6[3];
|
|
puVar6[4] = 0;
|
|
puVar6[5] = 0xf;
|
|
*GHIDRA_CAST<uint8_t *>(puVar6) = 0;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 0xd;
|
|
chatLineSize = 0;
|
|
textBuffer = GHIDRA_CAST<uint8_t *******>(&kickVoteText);
|
|
if (0xf < kickVoteTextCapacity) {
|
|
textBuffer = kickVoteText;
|
|
}
|
|
chatLineCapacity = 0xf;
|
|
chatLine[0] = (void *)0x0;
|
|
uStack_98 = CONCAT44(GHIDRA_CAST<uint8_t *>((GHIDRA_INT(textBuffer) + 1)),(uint32_t)uStack_98);
|
|
textEnd = textBuffer;
|
|
do {
|
|
bVar2 = *GHIDRA_CAST<uint8_t *>(textEnd);
|
|
textEnd = GHIDRA_CAST<uint8_t *******>((GHIDRA_INT(textEnd) + 1));
|
|
} while (bVar2 != 0);
|
|
uVar7 = GHIDRA_INT(textEnd) - (GHIDRA_INT(textBuffer) + 1);
|
|
(GHIDRA_CAST<msvc::string *>((GHIDRA_CAST<char *>(chatLine))))->msvc::string::assign(GHIDRA_CAST<uint8_t *>(textBuffer),uVar7);
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 0xe;
|
|
FUN_00428b60(chatLine,0x6e,textBuffer,uVar7);
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 0xd;
|
|
if (0xf < chatLineCapacity) {
|
|
uVar7 = chatLineCapacity + 1;
|
|
freeBlock = chatLine[0];
|
|
if (0xfff < uVar7) {
|
|
freeBlock = *(void **)(GHIDRA_INT(chatLine[0]) + -4);
|
|
uVar7 = chatLineCapacity + 0x24;
|
|
if (0x1f < GHIDRA_UINT((GHIDRA_INT(chatLine[0]) + (-4 - GHIDRA_INT(freeBlock))))) goto LAB_0091061f;
|
|
}
|
|
operator_delete(freeBlock,uVar7);
|
|
}
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 0xc;
|
|
if (0xf < kickVoteTextCapacity) {
|
|
uVar7 = kickVoteTextCapacity + 1;
|
|
textBuffer = kickVoteText;
|
|
if (0xfff < uVar7) {
|
|
textBuffer = GHIDRA_CAST<uint8_t *******>(kickVoteText[-1]);
|
|
uVar7 = kickVoteTextCapacity + 0x24;
|
|
if (GHIDRA_CAST<uint8_t *>(0x1f) < GHIDRA_CAST<uint8_t *>((GHIDRA_INT(kickVoteText) + (-4 - GHIDRA_INT(textBuffer)))))
|
|
goto LAB_0091061f;
|
|
}
|
|
operator_delete(textBuffer,uVar7);
|
|
}
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 0xb;
|
|
if (0xf < nameTextCapacity) {
|
|
uVar7 = nameTextCapacity + 1;
|
|
freeBlock = (void *)nameText;
|
|
if (0xfff < uVar7) {
|
|
freeBlock = *(void **)(GHIDRA_INT((void *)nameText) + -4);
|
|
uVar7 = nameTextCapacity + 0x24;
|
|
if (0x1f < GHIDRA_UINT((GHIDRA_INT((void *)nameText) + (-4 - GHIDRA_INT(freeBlock))))) goto LAB_0091061f;
|
|
}
|
|
operator_delete(freeBlock,uVar7);
|
|
}
|
|
acStack_34[8] = '\0';
|
|
acStack_34[9] = '\0';
|
|
acStack_34[10] = '\0';
|
|
acStack_34[0xb] = '\0';
|
|
nameTextCapacity = 0xf;
|
|
nameText = nameText & 0xffffffffffffff00;
|
|
targetChatProfile[0] = KAGE::System::UserProfileBase::vftable;
|
|
}
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 1;
|
|
local_90 = CONCAT44(&g_manager->_netplayManager,(uint32_t)local_90);
|
|
bVar2 = is_user_in_player_list(GHIDRA_CAST<NetplayManager *>(&g_manager->_netplayManager),*dropEntry);
|
|
if (bVar2 == 0) {
|
|
uVar7 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_90)) + 0x4)))[1] - *(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_90)) + 0x4))) >> 2;
|
|
}
|
|
else {
|
|
uVar7 = ((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_90)) + 0x4)))[1] - *(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_90)) + 0x4))) >> 2) - 1;
|
|
}
|
|
if (uVar7 <= *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(dropEntry) + 0xc))) {
|
|
banProfile = KAGE::System::UserProfileBase::vftable;
|
|
(GHIDRA_CAST<UserProfile *>((dropEntry)))->UserProfile::find_or_create();
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 0xf;
|
|
banProfile = KAGE::System::UserProfile::vftable;
|
|
banProfileData = extraout_EAX_04;
|
|
if (((extraout_EAX_04 != 0) &&
|
|
(*GHIDRA_CAST<int *>((extraout_EAX_04 + 8)) != 0 || *GHIDRA_CAST<int *>((extraout_EAX_04 + 0xc)) != 0)) &&
|
|
(*GHIDRA_CAST<int *>((extraout_EAX_04 + 0x14)) == 0)) {
|
|
(GHIDRA_CAST<KAGE::System::UserProfile *>((&banProfile)))->KAGE::System::UserProfile::load_steam_avatar();
|
|
}
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 0x10;
|
|
if (banProfileData == 0) {
|
|
uStack_98 = 0;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(uStack_98)) + 0x4))) = 0;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(uStack_98)) + 0x0))) = 0;
|
|
uVar5 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(uStack_98)) + 0x4)));
|
|
userIdLow = (uint32_t)uStack_98;
|
|
}
|
|
else {
|
|
uVar5 = *GHIDRA_CAST<uint32_t *>((banProfileData + 0xc));
|
|
userIdLow = *GHIDRA_CAST<uint32_t *>((banProfileData + 8));
|
|
}
|
|
ban_user(userIdLow,uVar5);
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 1;
|
|
banProfile = KAGE::System::UserProfileBase::vftable;
|
|
banCheckProfile[0] = KAGE::System::UserProfileBase::vftable;
|
|
(GHIDRA_CAST<UserProfile *>((dropEntry)))->UserProfile::find_or_create();
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 0x11;
|
|
banCheckProfile[0] = KAGE::System::UserProfile::vftable;
|
|
if (((extraout_EAX_05 != 0) &&
|
|
(*GHIDRA_CAST<int *>((extraout_EAX_05 + 8)) != 0 || *GHIDRA_CAST<int *>((extraout_EAX_05 + 0xc)) != 0)) &&
|
|
(*GHIDRA_CAST<int *>((extraout_EAX_05 + 0x14)) == 0)) {
|
|
(GHIDRA_CAST<KAGE::System::UserProfile *>((banCheckProfile)))->KAGE::System::UserProfile::load_steam_avatar();
|
|
}
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 0x12;
|
|
uVar5 = 0x90fe2f;
|
|
cVar1 = (*(code *)banCheckProfile[0][5])();
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 1;
|
|
banCheckProfile[0] = KAGE::System::UserProfileBase::vftable;
|
|
if (cVar1 == '\0') {
|
|
removeProfile[0] = KAGE::System::UserProfileBase::vftable;
|
|
(GHIDRA_CAST<UserProfile *>((dropEntry)))->UserProfile::find_or_create();
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 0x14;
|
|
removeProfile[0] = KAGE::System::UserProfile::vftable;
|
|
if (((extraout_EAX_06 != 0) &&
|
|
(*GHIDRA_CAST<int *>((extraout_EAX_06 + 8)) != 0 || *GHIDRA_CAST<int *>((extraout_EAX_06 + 0xc)) != 0)) &&
|
|
(*GHIDRA_CAST<int *>((extraout_EAX_06 + 0x14)) == 0)) {
|
|
(GHIDRA_CAST<KAGE::System::UserProfile *>((removeProfile)))->KAGE::System::UserProfile::load_steam_avatar();
|
|
}
|
|
ehState = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x1))),0x15);
|
|
QueueRemovePlayer(removeProfile);
|
|
removeProfile[0] = KAGE::System::UserProfileBase::vftable;
|
|
}
|
|
else {
|
|
builtin_strncpy(acStack_34," KICKED",8);
|
|
nameTextCapacity = 0xf;
|
|
acStack_34[8] = '\x0f';
|
|
acStack_34[9] = '\0';
|
|
acStack_34[10] = '\0';
|
|
acStack_34[0xb] = '\0';
|
|
nameText = 0x4552455720554f59;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 0x13;
|
|
FUN_00428b60(&nameText,0x6e,userIdLow,uVar5);
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 1;
|
|
if (0xf < nameTextCapacity) {
|
|
uVar7 = nameTextCapacity + 1;
|
|
freeBlock = (void *)nameText;
|
|
if (0xfff < uVar7) {
|
|
freeBlock = *(void **)(GHIDRA_INT((void *)nameText) + -4);
|
|
uVar7 = nameTextCapacity + 0x24;
|
|
if (0x1f < GHIDRA_UINT((GHIDRA_INT((void *)nameText) + (-4 - GHIDRA_INT(freeBlock))))) {
|
|
LAB_0091061f:
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(freeBlock,uVar7);
|
|
}
|
|
uVar5 = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(dropEntry) + 4));
|
|
userIdLow = (uint32_t)*dropEntry;
|
|
remove_drop_entry(dropEntry,*dropEntry);
|
|
FUN_00907830(userIdLow,uVar5);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else if (iVar8 == 1) {
|
|
offSenderIdLow = *messageData;
|
|
offSenderIdHigh = messageData[1];
|
|
uStack_98 = CONCAT44(offSenderIdHigh,(uint32_t)uStack_98);
|
|
offSenderProfile[0] = KAGE::System::UserProfileBase::vftable;
|
|
logSenderIdLow = offSenderIdLow;
|
|
(GHIDRA_CAST<UserProfile *>((&offSenderIdLow)))->UserProfile::find_or_create();
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 0x16;
|
|
offSenderProfile[0] = KAGE::System::UserProfile::vftable;
|
|
if (((extraout_EAX_07 != 0) &&
|
|
(*GHIDRA_CAST<int *>((extraout_EAX_07 + 8)) != 0 || *GHIDRA_CAST<int *>((extraout_EAX_07 + 0xc)) != 0)) &&
|
|
(*GHIDRA_CAST<int *>((extraout_EAX_07 + 0x14)) == 0)) {
|
|
(GHIDRA_CAST<KAGE::System::UserProfile *>((offSenderProfile)))->KAGE::System::UserProfile::load_steam_avatar();
|
|
}
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 0x17;
|
|
local_a4 = (*(code *)offSenderProfile[0][1])();
|
|
offTargetProfile = KAGE::System::UserProfileBase::vftable;
|
|
(GHIDRA_CAST<UserProfile *>((dropEntry)))->UserProfile::find_or_create();
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 0x18;
|
|
offTargetProfile = KAGE::System::UserProfile::vftable;
|
|
offTargetProfileData = extraout_EAX_08;
|
|
if (((extraout_EAX_08 != 0) &&
|
|
(*GHIDRA_CAST<int *>((extraout_EAX_08 + 8)) != 0 || *GHIDRA_CAST<int *>((extraout_EAX_08 + 0xc)) != 0)) &&
|
|
(*GHIDRA_CAST<int *>((extraout_EAX_08 + 0x14)) == 0)) {
|
|
(GHIDRA_CAST<KAGE::System::UserProfile *>((&offTargetProfile)))->KAGE::System::UserProfile::load_steam_avatar();
|
|
}
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 0x19;
|
|
if (offTargetProfileData == 0) {
|
|
local_90 = local_90 & 0xffffffff;
|
|
local_a0 = 0;
|
|
}
|
|
else {
|
|
local_a0 = CONCAT44(*GHIDRA_CAST<uint32_t *>((offTargetProfileData + 8)),(uint32_t)local_a0);
|
|
local_90 = CONCAT44(*GHIDRA_CAST<uint32_t *>((offTargetProfileData + 0xc)),(uint32_t)local_90);
|
|
}
|
|
offTargetNameProfile[0] = KAGE::System::UserProfileBase::vftable;
|
|
(GHIDRA_CAST<UserProfile *>((dropEntry)))->UserProfile::find_or_create();
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 0x1a;
|
|
offTargetNameProfile[0] = KAGE::System::UserProfile::vftable;
|
|
if (((extraout_EAX_09 != 0) &&
|
|
(*GHIDRA_CAST<int *>((extraout_EAX_09 + 8)) != 0 || *GHIDRA_CAST<int *>((extraout_EAX_09 + 0xc)) != 0)) &&
|
|
(*GHIDRA_CAST<int *>((extraout_EAX_09 + 0x14)) == 0)) {
|
|
(GHIDRA_CAST<KAGE::System::UserProfile *>((offTargetNameProfile)))->KAGE::System::UserProfile::load_steam_avatar();
|
|
}
|
|
ehState = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x1))),0x1b);
|
|
(*(code *)offTargetNameProfile[0][1])();
|
|
KAGE_LogMessage(1,(uint8_t *)
|
|
"[Frame: %d] Recieved eDropMessageType::MSG_DROP_OFF for player \"%s\" %llu from player \"%s\" %llu \n"
|
|
);
|
|
offTargetNameProfile[0] = KAGE::System::UserProfileBase::vftable;
|
|
offTargetProfile = KAGE::System::UserProfileBase::vftable;
|
|
offSenderProfile[0] = KAGE::System::UserProfileBase::vftable;
|
|
offVoterIdLow = *messageData;
|
|
offVoterIdHigh = messageData[1];
|
|
FUN_00914480(&offVoterIdLow);
|
|
}
|
|
else if (iVar8 == 4) {
|
|
execSenderIdLow = *messageData;
|
|
execSenderIdHigh = messageData[1];
|
|
uStack_98 = CONCAT44(execSenderIdHigh,(uint32_t)uStack_98);
|
|
execSenderProfile[0] = KAGE::System::UserProfileBase::vftable;
|
|
logSenderIdLow = execSenderIdLow;
|
|
(GHIDRA_CAST<UserProfile *>((&execSenderIdLow)))->UserProfile::find_or_create();
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 0x1c;
|
|
execSenderProfile[0] = KAGE::System::UserProfile::vftable;
|
|
if (((extraout_EAX_10 != 0) &&
|
|
(*GHIDRA_CAST<int *>((extraout_EAX_10 + 8)) != 0 || *GHIDRA_CAST<int *>((extraout_EAX_10 + 0xc)) != 0)) &&
|
|
(*GHIDRA_CAST<int *>((extraout_EAX_10 + 0x14)) == 0)) {
|
|
(GHIDRA_CAST<KAGE::System::UserProfile *>((execSenderProfile)))->KAGE::System::UserProfile::load_steam_avatar();
|
|
}
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 0x1d;
|
|
local_a4 = (*(code *)execSenderProfile[0][1])();
|
|
execTargetProfile = KAGE::System::UserProfileBase::vftable;
|
|
(GHIDRA_CAST<UserProfile *>((dropEntry)))->UserProfile::find_or_create();
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 0x1e;
|
|
execTargetProfile = KAGE::System::UserProfile::vftable;
|
|
execTargetProfileData = extraout_EAX_11;
|
|
if (((extraout_EAX_11 != 0) &&
|
|
(*GHIDRA_CAST<int *>((extraout_EAX_11 + 8)) != 0 || *GHIDRA_CAST<int *>((extraout_EAX_11 + 0xc)) != 0)) &&
|
|
(*GHIDRA_CAST<int *>((extraout_EAX_11 + 0x14)) == 0)) {
|
|
(GHIDRA_CAST<KAGE::System::UserProfile *>((&execTargetProfile)))->KAGE::System::UserProfile::load_steam_avatar();
|
|
}
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 0x1f;
|
|
if (execTargetProfileData == 0) {
|
|
local_90 = local_90 & 0xffffffff;
|
|
local_a0 = 0;
|
|
}
|
|
else {
|
|
local_a0 = CONCAT44(*GHIDRA_CAST<uint32_t *>((execTargetProfileData + 8)),(uint32_t)local_a0);
|
|
local_90 = CONCAT44(*GHIDRA_CAST<uint32_t *>((execTargetProfileData + 0xc)),(uint32_t)local_90);
|
|
}
|
|
execTargetNameProfile[0] = KAGE::System::UserProfileBase::vftable;
|
|
(GHIDRA_CAST<UserProfile *>((dropEntry)))->UserProfile::find_or_create();
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 0x20;
|
|
execTargetNameProfile[0] = KAGE::System::UserProfile::vftable;
|
|
if (((extraout_EAX_12 != 0) &&
|
|
(*GHIDRA_CAST<int *>((extraout_EAX_12 + 8)) != 0 || *GHIDRA_CAST<int *>((extraout_EAX_12 + 0xc)) != 0)) &&
|
|
(*GHIDRA_CAST<int *>((extraout_EAX_12 + 0x14)) == 0)) {
|
|
(GHIDRA_CAST<KAGE::System::UserProfile *>((execTargetNameProfile)))->KAGE::System::UserProfile::load_steam_avatar();
|
|
}
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 0x21;
|
|
(*(code *)execTargetNameProfile[0][1])();
|
|
KAGE_LogMessage(1,(uint8_t *)
|
|
"[Frame: %d] Recieved eDropMessageType::MSG_DROP_EXECUTE for player \"%s\" %llu from player \"%s\" %llu \n"
|
|
);
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 1;
|
|
execTargetNameProfile[0] = KAGE::System::UserProfileBase::vftable;
|
|
execTargetProfile = KAGE::System::UserProfileBase::vftable;
|
|
execSenderProfile[0] = KAGE::System::UserProfileBase::vftable;
|
|
execCheckProfile[0] = KAGE::System::UserProfileBase::vftable;
|
|
(GHIDRA_CAST<UserProfile *>((dropEntry)))->UserProfile::find_or_create();
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 0x22;
|
|
execCheckProfile[0] = KAGE::System::UserProfile::vftable;
|
|
if (((extraout_EAX_13 != 0) &&
|
|
(*GHIDRA_CAST<int *>((extraout_EAX_13 + 8)) != 0 || *GHIDRA_CAST<int *>((extraout_EAX_13 + 0xc)) != 0)) &&
|
|
(*GHIDRA_CAST<int *>((extraout_EAX_13 + 0x14)) == 0)) {
|
|
(GHIDRA_CAST<KAGE::System::UserProfile *>((execCheckProfile)))->KAGE::System::UserProfile::load_steam_avatar();
|
|
}
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 0x23;
|
|
cVar1 = (*(code *)execCheckProfile[0][5])();
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 1;
|
|
iVar8 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(dropEntry) + 4));
|
|
unused1 = GHIDRA_INT(*dropEntry);
|
|
execCheckProfile[0] = KAGE::System::UserProfileBase::vftable;
|
|
if (cVar1 == '\0') {
|
|
bVar2 = is_user_in_player_list(dropEntry,*dropEntry);
|
|
if (bVar2 != 0) {
|
|
kickedChatProfile[0] = KAGE::System::UserProfileBase::vftable;
|
|
(GHIDRA_CAST<UserProfile *>((dropEntry)))->UserProfile::find_or_create();
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 0x24;
|
|
kickedChatProfile[0] = KAGE::System::UserProfile::vftable;
|
|
if (((extraout_EAX_14 != 0) &&
|
|
(*GHIDRA_CAST<int *>((extraout_EAX_14 + 8)) != 0 || *GHIDRA_CAST<int *>((extraout_EAX_14 + 0xc)) != 0)) &&
|
|
(*GHIDRA_CAST<int *>((extraout_EAX_14 + 0x14)) == 0)) {
|
|
(GHIDRA_CAST<KAGE::System::UserProfile *>((kickedChatProfile)))->KAGE::System::UserProfile::load_steam_avatar();
|
|
}
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 0x25;
|
|
profileName = GHIDRA_CAST<uint8_t *>((*(code *)kickedChatProfile[0][1])());
|
|
acStack_34[8] = '\0';
|
|
acStack_34[9] = '\0';
|
|
acStack_34[10] = '\0';
|
|
acStack_34[0xb] = '\0';
|
|
nameTextCapacity = 0xf;
|
|
nameText = nameText & 0xffffffff00000000;
|
|
uStack_98 = CONCAT44(profileName + 1,(uint32_t)uStack_98);
|
|
nameEnd = profileName;
|
|
do {
|
|
bVar2 = *nameEnd;
|
|
nameEnd = nameEnd + 1;
|
|
} while (bVar2 != 0);
|
|
(GHIDRA_CAST<msvc::string *>((GHIDRA_CAST<char *>(&nameText))))->msvc::string::assign(profileName,GHIDRA_INT(nameEnd) - GHIDRA_INT((profileName + 1)))
|
|
;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 0x26;
|
|
puVar6 = (GHIDRA_CAST<msvc::string *>((GHIDRA_CAST<char *>(&nameText))))->msvc::string::append(GHIDRA_CAST<uint8_t *>(" WAS KICKED"),0xb);
|
|
kickedText = GHIDRA_CAST<uint8_t *******>(*puVar6);
|
|
kickedTextSize = puVar6[4];
|
|
kickedTextCapacity = puVar6[5];
|
|
uStack_68 = puVar6[1];
|
|
uStack_64 = puVar6[2];
|
|
uStack_60 = puVar6[3];
|
|
puVar6[4] = 0;
|
|
puVar6[5] = 0xf;
|
|
*GHIDRA_CAST<uint8_t *>(puVar6) = 0;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 0x27;
|
|
chatLineSize = 0;
|
|
textBuffer = GHIDRA_CAST<uint8_t *******>(&kickedText);
|
|
if (0xf < kickedTextCapacity) {
|
|
textBuffer = kickedText;
|
|
}
|
|
chatLineCapacity = 0xf;
|
|
chatLine[0] = (void *)0x0;
|
|
uStack_98 = CONCAT44(GHIDRA_CAST<uint8_t *>((GHIDRA_INT(textBuffer) + 1)),(uint32_t)uStack_98);
|
|
textEnd = textBuffer;
|
|
do {
|
|
bVar2 = *GHIDRA_CAST<uint8_t *>(textEnd);
|
|
textEnd = GHIDRA_CAST<uint8_t *******>((GHIDRA_INT(textEnd) + 1));
|
|
} while (bVar2 != 0);
|
|
uVar7 = GHIDRA_INT(textEnd) - (GHIDRA_INT(textBuffer) + 1);
|
|
(GHIDRA_CAST<msvc::string *>((GHIDRA_CAST<char *>(chatLine))))->msvc::string::assign(GHIDRA_CAST<uint8_t *>(textBuffer),uVar7);
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 0x28;
|
|
FUN_00428b60(chatLine,0x6e,textBuffer,uVar7);
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 0x27;
|
|
if (0xf < chatLineCapacity) {
|
|
uVar7 = chatLineCapacity + 1;
|
|
freeBlock = chatLine[0];
|
|
if (0xfff < uVar7) {
|
|
freeBlock = *(void **)(GHIDRA_INT(chatLine[0]) + -4);
|
|
uVar7 = chatLineCapacity + 0x24;
|
|
if (0x1f < GHIDRA_UINT((GHIDRA_INT(chatLine[0]) + (-4 - GHIDRA_INT(freeBlock))))) goto LAB_0091061f;
|
|
}
|
|
operator_delete(freeBlock,uVar7);
|
|
}
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 0x26;
|
|
if (0xf < kickedTextCapacity) {
|
|
uVar7 = kickedTextCapacity + 1;
|
|
textBuffer = kickedText;
|
|
if (0xfff < uVar7) {
|
|
textBuffer = GHIDRA_CAST<uint8_t *******>(kickedText[-1]);
|
|
uVar7 = kickedTextCapacity + 0x24;
|
|
if (GHIDRA_CAST<uint8_t *>(0x1f) < GHIDRA_CAST<uint8_t *>((GHIDRA_INT(kickedText) + (-4 - GHIDRA_INT(textBuffer)))))
|
|
goto LAB_0091061f;
|
|
}
|
|
operator_delete(textBuffer,uVar7);
|
|
}
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 0x25;
|
|
if (0xf < nameTextCapacity) {
|
|
uVar7 = nameTextCapacity + 1;
|
|
freeBlock = (void *)nameText;
|
|
if (0xfff < uVar7) {
|
|
freeBlock = *(void **)(GHIDRA_INT((void *)nameText) + -4);
|
|
uVar7 = nameTextCapacity + 0x24;
|
|
if (0x1f < GHIDRA_UINT((GHIDRA_INT((void *)nameText) + (-4 - GHIDRA_INT(freeBlock))))) goto LAB_0091061f;
|
|
}
|
|
operator_delete(freeBlock,uVar7);
|
|
}
|
|
ehState = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x1))),1);
|
|
kickedIdLow = (uint32_t)*dropEntry;
|
|
kickedIdHigh = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(dropEntry) + 4));
|
|
kickedChatProfile[0] = KAGE::System::UserProfileBase::vftable;
|
|
kickedPlayer = PlayerManager::get_player_by_user_id
|
|
(GHIDRA_CAST<PlayerManager *>(dropEntry),GHIDRA_CAST<uint64_t *>(&kickedIdLow));
|
|
RemoveRemotePlayer(dropEntry,&kickedPlayer->_size);
|
|
}
|
|
}
|
|
else {
|
|
bVar2 = is_user_in_player_list(dropEntry,*dropEntry);
|
|
if (bVar2 == 0) {
|
|
if (g_menuManager == GHIDRA_CAST<MenuManager *>(0x0)) {
|
|
netplay_leave_lobby(dropEntry,unused1,iVar8);
|
|
reset(dropEntry,1);
|
|
}
|
|
else {
|
|
Menu_OnlineLobby::handle_kicked();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
KAGE_LogMessage(8,(uint8_t *)
|
|
"[Frame: %d] Recieved Drop Player Message with invalid message type: %d \n"
|
|
);
|
|
}
|
|
}
|
|
ehState = 0x29;
|
|
if (((messageRefCount != GHIDRA_CAST<int *>(0x0)) &&
|
|
(cVar1 = (**(code **)(*messageRefCount + 0xc))(), cVar1 != '\0')) &&
|
|
(g_multiplayerRelease != (void *)0x0)) {
|
|
(*g_multiplayerRelease)(&messageData);
|
|
}
|
|
} while( true );
|
|
}
|
|
|
|
// 00910650
|
|
void NetplayManager::update_status_messages()
|
|
{
|
|
int64_t lVar1;
|
|
int64_t lVar2;
|
|
int64_t lVar3;
|
|
char isLastRef;
|
|
uint32_t uVar4;
|
|
int *receiveResult;
|
|
Entity_Player *pEVar5;
|
|
uint32_t *puVar6;
|
|
PlayerManager *in_ECX;
|
|
uint32_t uVar7;
|
|
uint32_t *messageData;
|
|
uint64_t uVar8;
|
|
uint8_t *message;
|
|
uint8_t *messageRefCount;
|
|
uint32_t *statusMessage;
|
|
int *statusMessageRefCount;
|
|
uint32_t local_38;
|
|
int *local_34;
|
|
uint32_t local_30;
|
|
int *local_2c;
|
|
uint32_t *local_28;
|
|
PlayerManager *netplay;
|
|
uint8_t *puStack_20;
|
|
void *local_1c;
|
|
uint8_t *puStack_18;
|
|
uint32_t local_14;
|
|
int isMessageAvailable;
|
|
Manager *manager;
|
|
PlayerManager *players;
|
|
|
|
puStack_20 = GHIDRA_CAST<uint8_t *>((GHIDRA_INT(register0x00000010) + -4));
|
|
puStack_18 = &LAB_00b09795;
|
|
local_1c = ExceptionList;
|
|
uVar4 = __security_cookie ^ GHIDRA_INT(register0x00000010) - 0x10U;
|
|
ExceptionList = &local_1c;
|
|
netplay = in_ECX;
|
|
while( true ) {
|
|
players = netplay;
|
|
local_14 = 0xffffffff;
|
|
if (g_multiplayerService == (void *)0x0) break;
|
|
receiveResult = (GHIDRA_CAST<NetworkManager *>((g_multiplayerService)))->NetworkManager::receive_message(&local_30,9,0);
|
|
isMessageAvailable = *receiveResult;
|
|
local_14 = 0;
|
|
if (((local_2c != GHIDRA_CAST<int *>(0x0)) &&
|
|
(isLastRef = (**(code **)(*local_2c + 0xc))(uVar4), isLastRef != '\0')) &&
|
|
(g_multiplayerRelease != (void *)0x0)) {
|
|
(*g_multiplayerRelease)(&local_30);
|
|
}
|
|
local_14 = 0xffffffff;
|
|
if (isMessageAvailable == 0) break;
|
|
if (g_multiplayerService == (void *)0x0) {
|
|
KAGE::SmartPointer<MessageData>::reset(0);
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<NetworkManager *>((g_multiplayerService)))->NetworkManager::receive_message(&statusMessage,9,1);
|
|
}
|
|
puVar6 = statusMessage;
|
|
local_14 = 1;
|
|
local_38 = *statusMessage;
|
|
local_34 = GHIDRA_CAST<int *>(statusMessage[1]);
|
|
pEVar5 = (GHIDRA_CAST<PlayerManager *>((players)))->PlayerManager::get_player_by_user_id(GHIDRA_CAST<uint64_t *>(&local_38));
|
|
if (pEVar5 != GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
_local_2c = CONCAT44(puVar6,local_2c);
|
|
messageData = puVar6;
|
|
if (puVar6[3] != 1) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("This function should only be called on consolidated messages"))
|
|
;
|
|
puVar6 = local_28;
|
|
messageData = statusMessage;
|
|
}
|
|
if (*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(puVar6[2]) + 0x14)) + 8)) == 0) {
|
|
if (messageData[3] != 1) {
|
|
KAGE_LogMessage(0x10,(uint8_t *)
|
|
"This function should only be called on consolidated messages");
|
|
}
|
|
pEVar5->_target = *GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(messageData[2]) + 0x14)) + 0xc));
|
|
}
|
|
}
|
|
local_14 = 2;
|
|
if (((statusMessageRefCount != GHIDRA_CAST<int *>(0x0)) &&
|
|
(isLastRef = (**(code **)(*statusMessageRefCount + 0xc))(), isLastRef != '\0')) &&
|
|
(g_multiplayerRelease != (void *)0x0)) {
|
|
(*g_multiplayerRelease)(&statusMessage);
|
|
}
|
|
}
|
|
local_14 = 0xffffffff;
|
|
if ((players->_playerList)._begin != (players->_playerList)._end) {
|
|
uVar8 = GetTimeNs();
|
|
lVar1 = (uVar8 & 0xffffffff) * 0x431bde82;
|
|
local_34 = GHIDRA_CAST<int *>(((uint64_t)lVar1 >> 0x20));
|
|
lVar2 = (uVar8 >> 0x20) * 0xd7b634db;
|
|
lVar3 = (uVar8 >> 0x20) * 0x431bde82;
|
|
uVar8 = lVar2 + ((uVar8 & 0xffffffff) * 0xd7b634db >> 0x20);
|
|
uVar7 = GHIDRA_UINT((uVar8 >> 0x20));
|
|
_local_2c = CONCAT44(GHIDRA_INT(lVar3),GHIDRA_INT(((uint64_t)lVar2 >> 0x20)));
|
|
lVar1 = lVar1 + (uVar8 & 0xffffffff);
|
|
local_30 = (uint32_t)lVar1;
|
|
uVar4 = GHIDRA_UINT(((uint64_t)lVar1 >> 0x20));
|
|
lVar3 = lVar3 + (uint64_t)CONCAT14(CARRY4(uVar7,uVar4),uVar7 + uVar4);
|
|
uVar4 = GHIDRA_UINT(((uint64_t)lVar3 >> 0x20));
|
|
uVar7 = GHIDRA_UINT(lVar3) >> 0x12 | uVar4 * 0x4000;
|
|
if (((uVar4 >> 0x12) - *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(netplay[0x1c])) + 0xac)))) !=
|
|
GHIDRA_UINT((uVar7 < *GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(netplay[0x1c])) + 0xa8))))))) ||
|
|
(1000 < uVar7 - *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(netplay[0x1c])) + 0xa8)))))) {
|
|
statusMessage = GHIDRA_CAST<uint32_t *>(0x0);
|
|
statusMessageRefCount = *GHIDRA_CAST<int **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((g_manager)) + 0x4b12c))));
|
|
if (g_multiplayerService == (void *)0x0) {
|
|
KAGE_LogMessage(0x10,(uint8_t *)
|
|
"Attempting to create a message when there is no multiplayer service\n"
|
|
);
|
|
}
|
|
messageRefCount = &DAT_00000009;
|
|
message = &DAT_00000008;
|
|
NetConnection::send_message(g_multiplayerService,&local_38,0,&statusMessage,8,9);
|
|
manager = g_manager;
|
|
local_14 = 3;
|
|
FUN_008ef1d0(&local_38);
|
|
send_message(GHIDRA_CAST<NetplayManager *>(&manager->_netplayManager),1,message,messageRefCount);
|
|
local_14 = 4;
|
|
if (((local_34 != GHIDRA_CAST<int *>(0x0)) &&
|
|
(isLastRef = (**(code **)(*local_34 + 0xc))(), isLastRef != '\0')) &&
|
|
(g_multiplayerRelease != (void *)0x0)) {
|
|
(*g_multiplayerRelease)(&local_38);
|
|
}
|
|
uVar8 = GetTimeNs();
|
|
lVar1 = (uVar8 & 0xffffffff) * 0x431bde82;
|
|
lVar2 = (uVar8 >> 0x20) * 0xd7b634db + ((uVar8 & 0xffffffff) * 0xd7b634db >> 0x20);
|
|
uVar7 = GHIDRA_UINT(((uint64_t)lVar2 >> 0x20));
|
|
uVar4 = GHIDRA_INT(((uint64_t)lVar1 >> 0x20)) + GHIDRA_UINT(CARRY4(GHIDRA_UINT(lVar1),GHIDRA_UINT(lVar2)));
|
|
lVar1 = (uVar8 >> 0x20) * 0x431bde82 + (uint64_t)CONCAT14(CARRY4(uVar7,uVar4),uVar7 + uVar4);
|
|
uVar4 = GHIDRA_UINT(((uint64_t)lVar1 >> 0x20));
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(netplay[0x1c])) + 0xa8)))) = GHIDRA_UINT(lVar1) >> 0x12 | uVar4 * 0x4000;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(netplay[0x1c])) + 0xac)))) = uVar4 >> 0x12;
|
|
}
|
|
}
|
|
ExceptionList = local_1c;
|
|
return;
|
|
}
|
|
|
|
// 00910980
|
|
uint8_t NetplayManager::try_advance_frame()
|
|
{
|
|
NetplayManager *pNVar1;
|
|
uint64_t qVar2;
|
|
uint8_t *puVar3;
|
|
char cVar4;
|
|
uint8_t bVar5;
|
|
uint8_t *pbVar6;
|
|
int *piVar7;
|
|
uint32_t uVar8;
|
|
int matchedPlayer;
|
|
uint32_t uVar9;
|
|
uint64_t *pqVar10;
|
|
uint32_t uVar11;
|
|
int iVar12;
|
|
uint32_t uVar13;
|
|
uint32_t uVar14;
|
|
Entity_Player *player;
|
|
bool bVar15;
|
|
float fVar16;
|
|
uint8_t auStack_62 [2];
|
|
int local_50;
|
|
uint32_t local_48;
|
|
int *piStack_44;
|
|
uint32_t local_40;
|
|
int *local_3c;
|
|
uint64_t local_38;
|
|
int inputState;
|
|
NetplayManager *local_28;
|
|
char emoteId;
|
|
uint8_t isReady;
|
|
uint8_t *puStack_20;
|
|
void *local_1c;
|
|
uint8_t *puStack_18;
|
|
uint32_t local_14;
|
|
uint8_t *currentAnimData;
|
|
Game *game;
|
|
|
|
puStack_20 = auStack_62 + 0x5e;
|
|
local_14 = 0xffffffff;
|
|
puStack_18 = &LAB_00b097c0;
|
|
local_1c = ExceptionList;
|
|
ExceptionList = &local_1c;
|
|
uVar11 = 0;
|
|
iVar12 = *GHIDRA_CAST<int *>(this);
|
|
isReady = 1;
|
|
local_28 = this;
|
|
puVar3 = auStack_62 + 0x5e;
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[1])) + 0x1)))) - iVar12 >> 2 != 0) {
|
|
do {
|
|
if (g_multiplayerService == (void *)0x0) {
|
|
KAGE::SmartPointer<ConnectionBase>::SmartPointer(auStack_62 + -10);
|
|
}
|
|
else {
|
|
iVar12 = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((iVar12 + uVar11 * 4)) + 0x374));
|
|
if (iVar12 == 0) {
|
|
piStack_44 = GHIDRA_CAST<int *>(0x0);
|
|
local_48 = 0;
|
|
}
|
|
else {
|
|
local_48 = *GHIDRA_CAST<uint32_t *>((iVar12 + 8));
|
|
piStack_44 = *GHIDRA_CAST<int **>((iVar12 + 0xc));
|
|
}
|
|
local_40 = local_48;
|
|
local_3c = piStack_44;
|
|
(GHIDRA_CAST<NetworkManager *>((g_multiplayerService)))->NetworkManager::get_peer(auStack_62 + -10,GHIDRA_CAST<uint64_t *>(&local_40));
|
|
}
|
|
cVar4 = NetInputDevice::is_input_ready();
|
|
if ((cVar4 == '\0') || (bVar15 = isReady == 0, isReady = 1, bVar15)) {
|
|
isReady = 0;
|
|
}
|
|
uVar11 = uVar11 + 1;
|
|
iVar12 = *GHIDRA_CAST<int *>(this);
|
|
puVar3 = puStack_20;
|
|
} while (uVar11 < GHIDRA_UINT((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[1])) + 0x1)))) - iVar12 >> 2)));
|
|
}
|
|
puStack_20 = puVar3;
|
|
iVar12 = (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x825])) + 0x1)))) - *GHIDRA_CAST<int *>((this + 0x824))) / 0x18;
|
|
if (iVar12 == 0) {
|
|
}
|
|
else {
|
|
piVar7 = GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((this + 0x824)) + 8));
|
|
do {
|
|
bVar5 = 0;
|
|
if (*piVar7 != *GHIDRA_CAST<int *>((this + 4))) {
|
|
bVar5 = isReady;
|
|
}
|
|
iVar12 = iVar12 + -1;
|
|
piVar7 = piVar7 + 6;
|
|
isReady = bVar5;
|
|
} while (iVar12 != 0);
|
|
this = local_28;
|
|
}
|
|
iVar12 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x829])) + 0x1)))) - *GHIDRA_CAST<int *>((this + 0x828)) >> 5;
|
|
if (iVar12 != 0) {
|
|
piVar7 = GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((this + 0x828)) + 0x10));
|
|
do {
|
|
bVar5 = 0;
|
|
if (*piVar7 != *GHIDRA_CAST<int *>((this + 4))) {
|
|
bVar5 = isReady;
|
|
}
|
|
iVar12 = iVar12 + -1;
|
|
piVar7 = piVar7 + 8;
|
|
isReady = bVar5;
|
|
} while (iVar12 != 0);
|
|
this = local_28;
|
|
}
|
|
iVar12 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x82d])) + 0x1)))) - *GHIDRA_CAST<int *>((this + 0x82c)) >> 4;
|
|
if (iVar12 != 0) {
|
|
piVar7 = GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((this + 0x82c)) + 0xc));
|
|
do {
|
|
bVar5 = 0;
|
|
if (*piVar7 != *GHIDRA_CAST<int *>((this + 4))) {
|
|
bVar5 = isReady;
|
|
}
|
|
iVar12 = iVar12 + -1;
|
|
piVar7 = piVar7 + 4;
|
|
isReady = bVar5;
|
|
} while (iVar12 != 0);
|
|
this = local_28;
|
|
}
|
|
if ((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x5ed])) + 0x1)))) != 0) &&
|
|
(*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x5f1])) + 0x1)))) <= *GHIDRA_CAST<uint32_t *>((this + 4)))) {
|
|
ExceptionList = local_1c;
|
|
return 0;
|
|
}
|
|
if (isReady == 0) {
|
|
ExceptionList = local_1c;
|
|
return 0;
|
|
}
|
|
*GHIDRA_CAST<uint8_t *>((this + 8)) = 0;
|
|
uVar11 = 0;
|
|
iVar12 = *GHIDRA_CAST<int *>(this);
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[1])) + 0x1)))) - iVar12 >> 2 == 0) {
|
|
LAB_00910f99:
|
|
uVar11 = *GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x12])) + 0x2))));
|
|
if (GHIDRA_UINT((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[5])) + 0x1)))) * 2)) < uVar11) {
|
|
do {
|
|
pNVar1 = (NetplayManager *)
|
|
**(uint32_t **)
|
|
(*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0xe])) + 0x2)))) +
|
|
(*GHIDRA_CAST<int *>((this + 0x10)) - 1U & *GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x11])) + 0x1))))) * 4);
|
|
local_28 = pNVar1;
|
|
_Find_lower_bound<>();
|
|
if (((*GHIDRA_CAST<char *>((local_50 + 0xd)) == '\0') &&
|
|
(*GHIDRA_CAST<NetplayManager **>((local_50 + 0x10)) <= pNVar1)) &&
|
|
(local_50 != *GHIDRA_CAST<int *>((this + 0x14)))) {
|
|
piVar7 = GHIDRA_CAST<int *>(std)::map<unsigned_int_8byte>::try_emplace();
|
|
if (*GHIDRA_CAST<int *>((*piVar7 + 0x14)) != 0) {
|
|
piVar7 = GHIDRA_CAST<int *>(std)::map<unsigned_int_8byte>::try_emplace();
|
|
iVar12 = *GHIDRA_CAST<int *>((*piVar7 + 0x14));
|
|
if (g_mainHeap == (void *)0x0) {
|
|
pqVar10 = &g_allocatedBytesNoHeap;
|
|
}
|
|
else {
|
|
pqVar10 = GHIDRA_CAST<uint64_t *>((GHIDRA_INT(g_mainHeap) + 0x30));
|
|
}
|
|
if (iVar12 != 0) {
|
|
uVar11 = *GHIDRA_CAST<uint32_t *>((iVar12 + -4));
|
|
qVar2 = *pqVar10;
|
|
*GHIDRA_CAST<uint32_t *>(pqVar10) = GHIDRA_UINT(*pqVar10) - uVar11;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(pqVar10) + 4)) =
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(pqVar10) + 4)) - GHIDRA_UINT((GHIDRA_UINT(qVar2) < uVar11));
|
|
free((void *)(iVar12 + -4));
|
|
}
|
|
local_14 = 0xffffffff;
|
|
piVar7 = GHIDRA_CAST<int *>(std)::map<unsigned_int_8byte>::try_emplace();
|
|
*GHIDRA_CAST<uint32_t *>((*piVar7 + 0x14)) = 0;
|
|
}
|
|
msvc::map<unsigned_int_8byte>::erase();
|
|
uVar11 = *GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x12])) + 0x2))));
|
|
}
|
|
uVar11 = uVar11 - 1;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x12])) + 0x2)))) = uVar11;
|
|
if (uVar11 == 0) {
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x11])) + 0x1)))) = 0;
|
|
}
|
|
else {
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x11])) + 0x1)))) = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x11])) + 0x1)))) + 1;
|
|
}
|
|
} while (GHIDRA_UINT((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[5])) + 0x1)))) * 2)) < uVar11);
|
|
}
|
|
save_frame_snapshot(this,0);
|
|
game = g_game;
|
|
if (((*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x83a])) + 0x2)))) != 0 || *GHIDRA_CAST<int *>((this + 0x83c)) != 0) &&
|
|
(*GHIDRA_CAST<int *>((this + 0x83c)) == 0)) && (*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x83a])) + 0x2)))) <= *GHIDRA_CAST<uint32_t *>((this + 4))))
|
|
{
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x83a])) + 0x2)))) = 0;
|
|
*GHIDRA_CAST<uint32_t *>((this + 0x83c)) = 0;
|
|
(GHIDRA_CAST<Game *>((game)))->Game::End(1);
|
|
}
|
|
*GHIDRA_CAST<int *>((this + 4)) = *GHIDRA_CAST<int *>((this + 4)) + 1;
|
|
ExceptionList = local_1c;
|
|
return isReady;
|
|
}
|
|
LAB_00910b70:
|
|
local_3c = *GHIDRA_CAST<int **>((iVar12 + uVar11 * 4));
|
|
if ((GHIDRA_UINT(local_3c[2]) & 1) == 0) {
|
|
local_3c[0xe2] = 0;
|
|
local_3c[0xe3] = 0;
|
|
local_3c[0xe0] = 0;
|
|
local_3c[0xe1] = 0;
|
|
local_3c[0xe4] = 0;
|
|
local_3c[0xe5] = 0;
|
|
local_3c[0xe6] = 0;
|
|
local_3c[0xe7] = 0;
|
|
}
|
|
else {
|
|
inputState = FUN_00901190();
|
|
uVar13 = 0;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_38)) + 0x4))) = 0;
|
|
local_38 = 0;
|
|
uVar14 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_38)) + 0x4)));
|
|
do {
|
|
iVar12 = FUN_00900f50();
|
|
if ((iVar12 != 0xff) &&
|
|
((GHIDRA_UINT(*GHIDRA_CAST<uint16_t *>((inputState + 4))) & 1 << ((uint8_t)iVar12 & 0x1f)) != 0)) {
|
|
uVar8 = 1 << (uVar13 & 0x1f);
|
|
uVar9 = 0;
|
|
if (0x1f < uVar13) {
|
|
uVar9 = uVar8;
|
|
}
|
|
uVar8 = uVar8 ^ uVar9;
|
|
if (0x3f < uVar13) {
|
|
uVar9 = uVar8;
|
|
}
|
|
local_38 = CONCAT44((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_38)) + 0x4))) | uVar8,(uint32_t)local_38);
|
|
uVar14 = uVar14 | uVar9;
|
|
}
|
|
uVar13 = uVar13 + 1;
|
|
} while (uVar13 < 0x20);
|
|
uVar13 = local_3c[0xe0];
|
|
local_3c[0xe0] = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_38)) + 0x4)));
|
|
local_3c[0xe2] = ~uVar13 & (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_38)) + 0x4)));
|
|
local_3c[0xe3] = ~local_3c[0xe1] & uVar14;
|
|
local_3c[0xe1] = uVar14;
|
|
local_3c[0xe4] = GHIDRA_INT(((float)*GHIDRA_CAST<uint16_t *>((inputState + 6)) / 32767.0 - 1.0));
|
|
local_3c[0xe5] = GHIDRA_INT(((float)*GHIDRA_CAST<uint16_t *>((inputState + 8)) / 32767.0 - 1.0));
|
|
bVar15 = (*GHIDRA_CAST<uint8_t *>((inputState + 0xf)) & 2) == 0;
|
|
if (bVar15) {
|
|
local_3c[0xe6] = GHIDRA_INT(((float)*GHIDRA_CAST<uint16_t *>((inputState + 10)) / 32767.0 - 1.0));
|
|
fVar16 = (float)*GHIDRA_CAST<uint16_t *>((inputState + 0xc)) / 32767.0 - 1.0;
|
|
}
|
|
else {
|
|
local_3c[0xe6] = GHIDRA_INT((float)GHIDRA_INT(*GHIDRA_CAST<short *>((inputState + 10))));
|
|
fVar16 = (float)GHIDRA_INT(*GHIDRA_CAST<short *>((inputState + 0xc)));
|
|
}
|
|
local_3c[0xe7] = GHIDRA_INT(fVar16);
|
|
*GHIDRA_CAST<bool *>((local_3c + 0xf5)) = !bVar15;
|
|
game = g_game;
|
|
uVar14 = 0;
|
|
iVar12 = local_3c[3];
|
|
local_3c[0xf4] = GHIDRA_INT(*GHIDRA_CAST<char *>((inputState + 0xf))) & 1;
|
|
piVar7 = (game->_playerManager)._playerList._begin;
|
|
uVar13 = GHIDRA_INT((game->_playerManager)._playerList._end) - GHIDRA_INT(piVar7) >> 2;
|
|
if (uVar13 != 0) {
|
|
do {
|
|
matchedPlayer = piVar7[uVar14];
|
|
local_38 = CONCAT44(matchedPlayer,(uint32_t)local_38);
|
|
if (*GHIDRA_CAST<int *>((matchedPlayer + 0x1618)) == iVar12) {
|
|
if (matchedPlayer != 0) {
|
|
uVar14 = 0;
|
|
if (*GHIDRA_CAST<char *>((inputState + 0xe)) == '\x15') goto LAB_00910d40;
|
|
goto LAB_00910d90;
|
|
}
|
|
break;
|
|
}
|
|
uVar14 = uVar14 + 1;
|
|
} while (uVar14 < uVar13);
|
|
}
|
|
}
|
|
goto LAB_00910f7e;
|
|
while( true ) {
|
|
uVar14 = uVar14 + 1;
|
|
piVar7 = piVar7 + 1;
|
|
if (uVar13 <= uVar14) break;
|
|
LAB_00910d90:
|
|
matchedPlayer = *piVar7;
|
|
if (*GHIDRA_CAST<int *>((matchedPlayer + 0x1618)) == iVar12) goto LAB_00910daa;
|
|
}
|
|
matchedPlayer = 0;
|
|
LAB_00910daa:
|
|
if ((*GHIDRA_CAST<char *>((matchedPlayer + 0x26d8)) != '\0') && (*GHIDRA_CAST<int *>((matchedPlayer + 0x26dc)) == 0x15)) {
|
|
*GHIDRA_CAST<uint8_t *>((matchedPlayer + 0x26d8)) = 0;
|
|
*GHIDRA_CAST<uint32_t *>((matchedPlayer + 0x26dc)) = 0x3c;
|
|
*GHIDRA_CAST<uint32_t *>((matchedPlayer + 0x26e0)) = 0;
|
|
*GHIDRA_CAST<uint32_t *>((matchedPlayer + 0x26e4)) = 0;
|
|
}
|
|
emoteId = *GHIDRA_CAST<char *>((inputState + 0xe));
|
|
if (emoteId == '<') goto LAB_00910f7e;
|
|
uVar14 = 0;
|
|
piVar7 = (g_game->_playerManager)._playerList._begin;
|
|
uVar13 = GHIDRA_INT((g_game->_playerManager)._playerList._end) - GHIDRA_INT(piVar7) >> 2;
|
|
if (uVar13 != 0) {
|
|
do {
|
|
player = GHIDRA_CAST<Entity_Player *>(*piVar7);
|
|
if (player->_controllerIndex == local_3c[3]) goto LAB_00910e26;
|
|
uVar14 = uVar14 + 1;
|
|
piVar7 = piVar7 + 1;
|
|
} while (uVar14 < uVar13);
|
|
}
|
|
player = GHIDRA_CAST<Entity_Player *>(0x0);
|
|
LAB_00910e26:
|
|
iVar12 = GHIDRA_INT(emoteId);
|
|
if (iVar12 != 0x15) {
|
|
Player_stats_add(&g_game->_onlinePlayerStats,8,player,1.0);
|
|
}
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((player)) + 0x26d8))) = 1;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((player)) + 0x26e4)))) = 0x78;
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((player)) + 0x26dc)))) == iVar12) goto LAB_00910f7e;
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((player)) + 0x26dc)))) = iVar12;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((player)) + 0x26e0)))) = 0;
|
|
if (iVar12 == 0x15) goto LAB_00910f7e;
|
|
local_3c = player->_ghostTrinkets + iVar12 * 6 + 0x212;
|
|
if ((void *)0xf < (void *)local_3c[5]) {
|
|
local_3c = GHIDRA_CAST<int *>(*local_3c);
|
|
}
|
|
currentAnimData = *GHIDRA_CAST<uint8_t **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((player)) + 0x2834))));
|
|
if (currentAnimData == GHIDRA_CAST<uint8_t *>(0x0)) {
|
|
LAB_00910ee9:
|
|
bVar5 = ANM2::SetAnimation(GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((player)) + 0x2800)))),GHIDRA_CAST<uint8_t *>(local_3c),1);
|
|
if (bVar5 != 0) {
|
|
AnimationState::Rewind(GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((player)) + 0x2830)))));
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((player)) + 0x2844))) = 1;
|
|
}
|
|
}
|
|
else {
|
|
pbVar6 = currentAnimData;
|
|
piVar7 = local_3c;
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((currentAnimData + 0x14))) {
|
|
pbVar6 = *GHIDRA_CAST<uint8_t **>(currentAnimData);
|
|
}
|
|
do {
|
|
bVar5 = *pbVar6;
|
|
bVar15 = bVar5 < (uint8_t)*piVar7;
|
|
if (bVar5 != (uint8_t)*piVar7) {
|
|
LAB_00910ed0:
|
|
uVar14 = -GHIDRA_UINT(bVar15) | 1;
|
|
goto LAB_00910ed5;
|
|
}
|
|
if (bVar5 == 0) break;
|
|
bVar5 = pbVar6[1];
|
|
bVar15 = bVar5 < *GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(piVar7) + 1));
|
|
if (bVar5 != *GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(piVar7) + 1))) goto LAB_00910ed0;
|
|
pbVar6 = pbVar6 + 2;
|
|
piVar7 = GHIDRA_CAST<int *>((GHIDRA_INT(piVar7) + 2));
|
|
} while (bVar5 != 0);
|
|
uVar14 = 0;
|
|
LAB_00910ed5:
|
|
if ((uVar14 != 0) || ((currentAnimData[0x34] != 0 && ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((player)) + 0x2844))) == '\0'))))
|
|
goto LAB_00910ee9;
|
|
}
|
|
if ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((player)) + 0x2909))) != '\0') {
|
|
AnimationState::Update(GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((player)) + 0x2830)))));
|
|
AnimationState::Update(GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((player)) + 0x2850)))));
|
|
}
|
|
LAB_00910f7e:
|
|
uVar11 = uVar11 + 1;
|
|
iVar12 = *GHIDRA_CAST<int *>(local_28);
|
|
this = local_28;
|
|
if (GHIDRA_UINT((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_28[1])) + 0x1)))) - iVar12 >> 2)) <= uVar11) goto LAB_00910f99;
|
|
goto LAB_00910b70;
|
|
while( true ) {
|
|
uVar14 = uVar14 + 1;
|
|
piVar7 = piVar7 + 1;
|
|
if (uVar13 <= uVar14) break;
|
|
LAB_00910d40:
|
|
matchedPlayer = *piVar7;
|
|
if (*GHIDRA_CAST<int *>((matchedPlayer + 0x1618)) == iVar12) goto LAB_00910d54;
|
|
}
|
|
matchedPlayer = 0;
|
|
LAB_00910d54:
|
|
*GHIDRA_CAST<uint8_t *>((matchedPlayer + 0x26d8)) = 1;
|
|
*GHIDRA_CAST<uint32_t *>((matchedPlayer + 0x26e4)) = 0;
|
|
if (*GHIDRA_CAST<int *>((matchedPlayer + 0x26dc)) != 0x15) {
|
|
*GHIDRA_CAST<uint32_t *>((matchedPlayer + 0x26dc)) = 0x15;
|
|
*GHIDRA_CAST<uint32_t *>((matchedPlayer + 0x26e0)) = 0;
|
|
}
|
|
goto LAB_00910f7e;
|
|
}
|
|
|
|
// 00911120
|
|
void NetplayManager::update_player_removal()
|
|
{
|
|
uint64_t uVar1;
|
|
uint8_t isInPlayerList;
|
|
char cVar2;
|
|
uint32_t uVar3;
|
|
int extraout_EAX;
|
|
void *extraout_EAX_00;
|
|
Entity_Player *removedPlayer;
|
|
void *pvVar4;
|
|
int iVar5;
|
|
NetplayManager *latestFrameSrc;
|
|
CoopJoinSlot *entryFrameSrc;
|
|
CoopJoinSlot *pCVar6;
|
|
NetplayManager *pNVar7;
|
|
uint32_t *dstField;
|
|
uint64_t *this_00;
|
|
int iVar8;
|
|
uint32_t uVar9;
|
|
void *ptr;
|
|
uint32_t *srcField;
|
|
int *piVar10;
|
|
uint8_t auStack_ba [2];
|
|
uint64_t targetUserId;
|
|
CoopJoinSlot removeMessage;
|
|
int *local_84;
|
|
uint64_t local_80;
|
|
PlayerManager *self;
|
|
uint64_t local_70;
|
|
uint64_t uStack_68;
|
|
uint64_t *message;
|
|
NetplayManager *local_5c;
|
|
uint8_t **local_58;
|
|
void *local_54;
|
|
uint64_t local_50;
|
|
char isMessageReceived;
|
|
NetplayManager *local_40;
|
|
int64_t local_3c;
|
|
char local_34 [4];
|
|
void *local_30;
|
|
uint32_t local_2c;
|
|
uint32_t local_28;
|
|
uint32_t stackCookie;
|
|
uint8_t *puStack_20;
|
|
void *savedExceptionList;
|
|
uint8_t *puStack_18;
|
|
uint32_t ehState;
|
|
uint32_t senderIdHigh;
|
|
int userImpl;
|
|
|
|
ehState = 0xffffffff;
|
|
puStack_18 = &LAB_00b09828;
|
|
savedExceptionList = ExceptionList;
|
|
stackCookie = __security_cookie ^ GHIDRA_UINT((local_34 + 0x24));
|
|
ExceptionList = &savedExceptionList;
|
|
self = GHIDRA_CAST<PlayerManager *>(this);
|
|
puStack_20 = local_34 + 0x30;
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[1])) + 0x1)))) - *GHIDRA_CAST<int *>(this) >> 2 != 0) {
|
|
iVar8 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x81d])) + 0x1))));
|
|
uVar3 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x81e])) + 0x2)))) - iVar8 >> 4;
|
|
local_5c = GHIDRA_CAST<NetplayManager *>((uVar3 - 1));
|
|
puStack_20 = local_34 + 0x30;
|
|
if (local_5c < uVar3) {
|
|
local_40 = GHIDRA_CAST<NetplayManager *>((GHIDRA_INT(local_5c) * 0x10));
|
|
puStack_20 = local_34 + 0x30;
|
|
do {
|
|
this_00 = GHIDRA_CAST<uint64_t *>((GHIDRA_INT(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((local_40)) + 0x0)))) + iVar8));
|
|
uStack_68 = CONCAT44(&g_manager->_netplayManager,GHIDRA_INT(uStack_68));
|
|
isInPlayerList =
|
|
is_user_in_player_list
|
|
(GHIDRA_CAST<NetplayManager *>(&g_manager->_netplayManager),
|
|
CONCAT44(*GHIDRA_CAST<uint32_t *>((&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_40[1])) + 0x1))) + iVar8)),GHIDRA_INT(*this_00)));
|
|
if (isInPlayerList == 0) {
|
|
uVar3 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(uStack_68)) + 0x4)))[1] - *(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(uStack_68)) + 0x4))) >> 2;
|
|
}
|
|
else {
|
|
uVar3 = ((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(uStack_68)) + 0x4)))[1] - *(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(uStack_68)) + 0x4))) >> 2) - 1;
|
|
}
|
|
if ((uVar3 <= *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(this_00) + 0xc))) &&
|
|
(isInPlayerList = is_player_removal_queued(this,*this_00), isInPlayerList == 0)) {
|
|
local_50 = CONCAT44((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_50)) + 0x4))),KAGE::System::UserProfileBase::vftable);
|
|
(GHIDRA_CAST<UserProfile *>((this_00)))->UserProfile::find_or_create();
|
|
ehState = 0;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_50)) + 0x0))) = KAGE::System::UserProfile::vftable;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_50)) + 0x4))) = GHIDRA_CAST<uint8_t *>(extraout_EAX);
|
|
if ((extraout_EAX != 0) &&
|
|
((*GHIDRA_CAST<int *>((extraout_EAX + 8)) != 0 || *GHIDRA_CAST<int *>((extraout_EAX + 0xc)) != 0 &&
|
|
(*GHIDRA_CAST<int *>((extraout_EAX + 0x14)) == 0)))) {
|
|
(GHIDRA_CAST<KAGE::System::UserProfile *>((&local_50)))->KAGE::System::UserProfile::load_steam_avatar();
|
|
}
|
|
ehState = 1;
|
|
cVar2 = (*(code *)(GHIDRA_CAST<uint8_t **>(local_50))[5])();
|
|
ehState = 0xffffffff;
|
|
local_50 = CONCAT44((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_50)) + 0x4))),KAGE::System::UserProfileBase::vftable);
|
|
if (cVar2 == '\0') {
|
|
ban_user();
|
|
local_58 = KAGE::System::UserProfileBase::vftable;
|
|
(GHIDRA_CAST<UserProfile *>((this_00)))->UserProfile::find_or_create();
|
|
ehState = 3;
|
|
local_58 = KAGE::System::UserProfile::vftable;
|
|
local_54 = extraout_EAX_00;
|
|
if (((extraout_EAX_00 != (void *)0x0) &&
|
|
(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(extraout_EAX_00) + 8)) != 0 ||
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(extraout_EAX_00) + 0xc)) != 0)) &&
|
|
(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(extraout_EAX_00) + 0x14)) == 0)) {
|
|
(GHIDRA_CAST<KAGE::System::UserProfile *>((&local_58)))->KAGE::System::UserProfile::load_steam_avatar();
|
|
}
|
|
ehState = 4;
|
|
QueueRemovePlayer();
|
|
ehState = 0xffffffff;
|
|
local_58 = KAGE::System::UserProfileBase::vftable;
|
|
}
|
|
else {
|
|
remove_drop_entry(this,*this_00);
|
|
if (1 < GHIDRA_UINT((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[1])) + 0x1)))) - *GHIDRA_CAST<int *>(this) >> 2))) {
|
|
builtin_strncpy(local_34," KIC",4);
|
|
local_28 = 0xf;
|
|
local_2c = 0xf;
|
|
local_3c = 0x4552455720554f59;
|
|
local_30 = (void *)0x44454b;
|
|
ehState = 2;
|
|
FUN_00428b60(&local_3c,0x6e);
|
|
ehState = 0xffffffff;
|
|
if (0xf < local_28) {
|
|
uVar3 = local_28 + 1;
|
|
pvVar4 = (void *)local_3c;
|
|
if (0xfff < uVar3) {
|
|
pvVar4 = *(void **)(GHIDRA_INT((void *)local_3c) + -4);
|
|
uVar3 = local_28 + 0x24;
|
|
if (0x1f < GHIDRA_UINT((GHIDRA_INT((void *)local_3c) + (-4 - GHIDRA_INT(pvVar4))))) goto LAB_00911409;
|
|
}
|
|
operator_delete(pvVar4,uVar3);
|
|
}
|
|
remove_drop_entry(this,*this_00);
|
|
FUN_00907830();
|
|
}
|
|
}
|
|
}
|
|
iVar8 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x81d])) + 0x1))));
|
|
local_5c = GHIDRA_CAST<NetplayManager *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_5c[-1])) + 0x2))));
|
|
local_40 = GHIDRA_CAST<NetplayManager *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_40[-6])) + 0x2))));
|
|
} while (local_5c < GHIDRA_CAST<uint8_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x81e])) + 0x2)))) - iVar8 >> 4)));
|
|
}
|
|
}
|
|
local_40 = this + 0x824;
|
|
local_54 = (void *)0x0;
|
|
iVar5 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x825])) + 0x1)))) - *GHIDRA_CAST<int *>(local_40);
|
|
iVar8 = iVar5 >> 0x1f;
|
|
if (iVar5 / 0x18 + iVar8 != iVar8) {
|
|
iVar8 = 0;
|
|
do {
|
|
if (*GHIDRA_CAST<int *>((iVar8 + *GHIDRA_CAST<int *>((this + 0x824)))) == 0) {
|
|
if (*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((iVar8 + 4 + *GHIDRA_CAST<int *>((this + 0x824)))) + 0x374)) == 0) {
|
|
local_50 = 0;
|
|
}
|
|
send_remove_frame();
|
|
local_50 = CONCAT44(*GHIDRA_CAST<int *>((this + 0x824)) + iVar8,GHIDRA_CAST<uint8_t **>(local_50));
|
|
local_5c = GHIDRA_CAST<NetplayManager *>((*GHIDRA_CAST<int *>((this + 0x824)) + iVar8 + 0xc));
|
|
iVar5 = FUN_0090b070();
|
|
iVar5 = *GHIDRA_CAST<int *>((iVar5 + 0x374));
|
|
if (iVar5 == 0) {
|
|
local_70 = 0;
|
|
uVar1 = local_70;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_70)) + 0x4))) = GHIDRA_CAST<int *>(0x0);
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_70)) + 0x0))) = 0;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_70)) + 0x1))) = 0;
|
|
local_84 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_70)) + 0x4)));
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(removeMessage)) + 0x10))) = (uint32_t)local_70;
|
|
local_70 = uVar1;
|
|
}
|
|
else {
|
|
local_84 = *GHIDRA_CAST<int **>((iVar5 + 0xc));
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(removeMessage)) + 0x10))) = *GHIDRA_CAST<uint32_t *>((iVar5 + 8));
|
|
}
|
|
uStack_68 = CONCAT44(local_84,GHIDRA_INT(uStack_68));
|
|
dstField = *GHIDRA_CAST<uint32_t **>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_INT(local_50))) + 0x4))) + 0x10));
|
|
if (dstField == *GHIDRA_CAST<uint32_t **>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_INT(local_50))) + 0x4))) + 0x14))) {
|
|
msvc::vector<8byte>::_Emplace_reallocate();
|
|
}
|
|
else {
|
|
*dstField = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(removeMessage)) + 0x10)));
|
|
dstField[1] = local_84;
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_5c[1])) + 0x1)))) = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_5c[1])) + 0x1)))) + 8;
|
|
}
|
|
latestFrameSrc = GHIDRA_CAST<NetplayManager *>((*GHIDRA_CAST<int *>((this + 0x824)) + 8 + iVar8));
|
|
if (*GHIDRA_CAST<uint32_t *>(latestFrameSrc) < *GHIDRA_CAST<uint32_t *>((this + 4))) {
|
|
latestFrameSrc = this + 4;
|
|
}
|
|
*GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>((this + 0x824)) + 8 + iVar8)) = *GHIDRA_CAST<uint32_t *>(latestFrameSrc);
|
|
*GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>((this + 0x824)) + iVar8)) = 1;
|
|
}
|
|
iVar8 = iVar8 + 0x18;
|
|
local_54 = (void *)(GHIDRA_INT(local_54) + 1);
|
|
} while (local_54 < (void *)((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_40[1])) + 0x1)))) - *GHIDRA_CAST<int *>(local_40)) / 0x18));
|
|
}
|
|
do {
|
|
if (g_multiplayerService == (void *)0x0) {
|
|
cVar2 = '\0';
|
|
}
|
|
else {
|
|
piVar10 = NetworkManager::receive_message
|
|
(g_multiplayerService,&removeMessage._isPlayerTypeForced,6,0);
|
|
isMessageReceived = *piVar10 != 0;
|
|
ehState = 5;
|
|
if (((local_84 != GHIDRA_CAST<int *>(0x0)) && (cVar2 = (**(code **)(*local_84 + 0xc))(), cVar2 != '\0')) &&
|
|
(g_multiplayerRelease != (void *)0x0)) {
|
|
(*g_multiplayerRelease)();
|
|
}
|
|
ehState = 0xffffffff;
|
|
cVar2 = isMessageReceived;
|
|
}
|
|
if (cVar2 == '\0') {
|
|
local_54 = *(void **)&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(((GHIDRA_CAST<PlayerManager *>((GHIDRA_INT(this) + 0x1810))))) + 0x60)));
|
|
iVar8 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(((GHIDRA_CAST<PlayerManager *>((GHIDRA_INT(this) + 0x1810))))) + 0x5c))));
|
|
uStack_68 = uStack_68 & 0xffffffff;
|
|
iVar5 = GHIDRA_INT(local_54) - iVar8 >> 0x1f;
|
|
if ((GHIDRA_INT(local_54) - iVar8) / 0x18 + iVar5 == iVar5) goto LAB_00911aa4;
|
|
iVar5 = 0;
|
|
local_70 = local_70 & 0xffffffff;
|
|
break;
|
|
}
|
|
if (g_multiplayerService == (void *)0x0) {
|
|
KAGE::SmartPointer<MessageData>::reset();
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<NetworkManager *>((g_multiplayerService)))->NetworkManager::receive_message(&message,6,1);
|
|
}
|
|
targetUserId = 0;
|
|
removeMessage._controllerIndex = 0;
|
|
removeMessage._playerType = 0;
|
|
removeMessage._state = 0;
|
|
removeMessage._menuPosition = 0.0;
|
|
ehState = 7;
|
|
piVar10 = GHIDRA_CAST<int *>(0x0);
|
|
local_50 = CONCAT44(local_5c,GHIDRA_CAST<uint8_t **>(local_50));
|
|
uStack_68 = CONCAT44(message,GHIDRA_INT(uStack_68));
|
|
if ((((local_5c != GHIDRA_CAST<NetplayManager *>(0x0)) &&
|
|
(cVar2 = (**(code **)(*GHIDRA_CAST<int *>(local_5c) + 4))(), cVar2 != '\0')) && (piVar10 != GHIDRA_CAST<int *>(0x0)))
|
|
&& ((cVar2 = (**(code **)(*piVar10 + 0xc))(), cVar2 != '\0' &&
|
|
(g_multiplayerRelease != (void *)0x0)))) {
|
|
(*g_multiplayerRelease)(auStack_ba + -10);
|
|
}
|
|
RemovePlayerMessage::read();
|
|
local_54 = (void *)removeMessage._playerType;
|
|
removedPlayer = (GHIDRA_CAST<PlayerManager *>((GHIDRA_CAST<PlayerManager *>(this))))->PlayerManager::get_player_by_user_id(&targetUserId);
|
|
local_70 = CONCAT44(removedPlayer,(uint32_t)local_70);
|
|
KAGE_LogMessage(1,(uint8_t *)
|
|
"[FRAME: %d] Recieved eRemoveMessageType::MSG_REMOVE_FRAME from User(%llu), for User(%llu) \n"
|
|
);
|
|
uVar9 = 0;
|
|
uVar3 = (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(((GHIDRA_CAST<PlayerManager *>((GHIDRA_INT(this) + 0x1810))))) + 0x60)))) -
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(((GHIDRA_CAST<PlayerManager *>((GHIDRA_INT(this) + 0x1810))))) + 0x5c))))) / 0x18;
|
|
local_50 = CONCAT44(uVar3,GHIDRA_CAST<uint8_t **>(local_50));
|
|
if (uVar3 != 0) {
|
|
piVar10 = GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(((GHIDRA_CAST<PlayerManager *>((GHIDRA_INT(this) + 0x1810))))) + 0x5c)))) + 4));
|
|
do {
|
|
iVar8 = *GHIDRA_CAST<int *>((*piVar10 + 0x374));
|
|
if (iVar8 == 0) {
|
|
uStack_68 = 0;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(uStack_68)) + 0x4))) = GHIDRA_CAST<int *>(0x0);
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(uStack_68)) + 0x0))) = 0;
|
|
iVar5 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_INT(uStack_68))) + 0x4)));
|
|
iVar8 = GHIDRA_INT(uStack_68);
|
|
}
|
|
else {
|
|
iVar5 = *GHIDRA_CAST<int *>((iVar8 + 0xc));
|
|
iVar8 = *GHIDRA_CAST<int *>((iVar8 + 8));
|
|
}
|
|
if ((iVar8 == GHIDRA_INT(targetUserId)) && (iVar5 == (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(targetUserId)) + 0x4))))) {
|
|
iVar8 = uVar9 * 0x18;
|
|
entryFrameSrc =
|
|
(CoopJoinSlot *)
|
|
(*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(((GHIDRA_CAST<PlayerManager *>((GHIDRA_INT(this) + 0x1810))))) + 0x5c)))) + 8 + iVar8);
|
|
pCVar6 = &removeMessage;
|
|
if (GHIDRA_UINT(removeMessage._controllerIndex) <= GHIDRA_UINT(entryFrameSrc->_controllerIndex)) {
|
|
pCVar6 = entryFrameSrc;
|
|
}
|
|
*GHIDRA_CAST<int *>((iVar8 + 8 + *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(((GHIDRA_CAST<PlayerManager *>((GHIDRA_INT(this) + 0x1810))))) + 0x5c)))))) =
|
|
pCVar6->_controllerIndex;
|
|
iVar8 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(((GHIDRA_CAST<PlayerManager *>((GHIDRA_INT(this) + 0x1810))))) + 0x5c)))) + iVar8;
|
|
senderIdHigh = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(message) + 4));
|
|
local_50 = CONCAT44(senderIdHigh,GHIDRA_CAST<uint8_t **>(local_50));
|
|
dstField = *GHIDRA_CAST<uint32_t **>((iVar8 + 0x10));
|
|
if (dstField == *GHIDRA_CAST<uint32_t **>((iVar8 + 0x14))) {
|
|
msvc::vector<8byte>::_Emplace_reallocate();
|
|
}
|
|
else {
|
|
*dstField = *GHIDRA_CAST<uint32_t *>(message);
|
|
dstField[1] = senderIdHigh;
|
|
*GHIDRA_CAST<int *>((iVar8 + 0x10)) = *GHIDRA_CAST<int *>((iVar8 + 0x10)) + 8;
|
|
}
|
|
if ((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_70)) + 0x4))) == GHIDRA_CAST<int *>(0x0)) goto LAB_0091189c;
|
|
goto LAB_00911863;
|
|
}
|
|
uVar9 = uVar9 + 1;
|
|
piVar10 = piVar10 + 6;
|
|
} while (uVar9 < uVar3);
|
|
}
|
|
if ((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_70)) + 0x4))) != GHIDRA_CAST<int *>(0x0)) {
|
|
local_3c = ZEXT48((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_70)) + 0x4)))) << 0x20;
|
|
local_34[0] = '\0';
|
|
local_34[1] = '\0';
|
|
local_34[2] = '\0';
|
|
local_34[3] = '\0';
|
|
local_30 = (void *)0x0;
|
|
local_2c = 0;
|
|
uStack_68 = uStack_68 & 0xffffffff;
|
|
local_28 = 0;
|
|
ehState = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x1))),8);
|
|
dstField = *GHIDRA_CAST<uint32_t **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(((GHIDRA_CAST<PlayerManager *>((GHIDRA_INT(this) + 0x1810))))) + 0x60))));
|
|
if (dstField == *GHIDRA_CAST<uint32_t **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(((GHIDRA_CAST<PlayerManager *>((GHIDRA_INT(this) + 0x1810))))) + 0x64))))) {
|
|
FUN_00914ba0();
|
|
uStack_68 = CONCAT44(local_28,GHIDRA_INT(uStack_68));
|
|
}
|
|
else {
|
|
*dstField = 0;
|
|
dstField[1] = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_70)) + 0x4)));
|
|
dstField[2] = 0;
|
|
dstField[3] = 0;
|
|
dstField[4] = 0;
|
|
dstField[5] = 0;
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(((GHIDRA_CAST<PlayerManager *>((GHIDRA_INT(this) + 0x1810))))) + 0x60)))) =
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(((GHIDRA_CAST<PlayerManager *>((GHIDRA_INT(this) + 0x1810))))) + 0x60)))) + 0x18;
|
|
}
|
|
pvVar4 = local_30;
|
|
pCVar6 = &removeMessage;
|
|
if (GHIDRA_UINT(removeMessage._controllerIndex) <
|
|
GHIDRA_UINT((GHIDRA_CAST<PlayerManager *>(this))->_coopSlots[0]._controllerIndex)) {
|
|
pCVar6 = (GHIDRA_CAST<PlayerManager *>(this))->_coopSlots;
|
|
}
|
|
*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(((GHIDRA_CAST<PlayerManager *>((GHIDRA_INT(this) + 0x1810))))) + 0x60)))) + -0x10)) =
|
|
pCVar6->_controllerIndex;
|
|
iVar8 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(((GHIDRA_CAST<PlayerManager *>((GHIDRA_INT(this) + 0x1810))))) + 0x60))));
|
|
senderIdHigh = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(message) + 4));
|
|
local_80 = *message;
|
|
local_50 = CONCAT44(senderIdHigh,GHIDRA_CAST<uint8_t **>(local_50));
|
|
dstField = *GHIDRA_CAST<uint32_t **>((iVar8 + -8));
|
|
if (dstField == *GHIDRA_CAST<uint32_t **>((iVar8 + -4))) {
|
|
msvc::vector<8byte>::_Emplace_reallocate();
|
|
}
|
|
else {
|
|
*dstField = *GHIDRA_CAST<uint32_t *>(message);
|
|
dstField[1] = senderIdHigh;
|
|
*GHIDRA_CAST<int *>((iVar8 + -8)) = *GHIDRA_CAST<int *>((iVar8 + -8)) + 8;
|
|
}
|
|
ehState = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x1))),7);
|
|
if (pvVar4 != (void *)0x0) {
|
|
uVar3 = ((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_INT(uStack_68))) + 0x4))) - GHIDRA_INT(pvVar4) >> 3) * 8;
|
|
ptr = pvVar4;
|
|
if (0xfff < uVar3) {
|
|
ptr = *(void **)(GHIDRA_CAST<char *>(pvVar4) + -4);
|
|
uVar3 = uVar3 + 0x23;
|
|
if (0x1f < GHIDRA_UINT((GHIDRA_INT(pvVar4) + (-4 - GHIDRA_INT(ptr))))) {
|
|
LAB_00911409:
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(ptr,uVar3);
|
|
}
|
|
LAB_00911863:
|
|
uVar3 = 0;
|
|
iVar8 = removeMessage._state - GHIDRA_INT(local_54) >> 4;
|
|
local_50 = CONCAT44(iVar8,GHIDRA_CAST<uint8_t **>(local_50));
|
|
if (iVar8 != 0) {
|
|
uStack_68 = CONCAT44((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_INT(local_70))) + 0x4))) + 0x3a0,GHIDRA_INT(uStack_68));
|
|
do {
|
|
FUN_00901070();
|
|
uVar3 = uVar3 + 1;
|
|
this = GHIDRA_CAST<NetplayManager *>(self);
|
|
} while (uVar3 < (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_50)) + 0x4))));
|
|
}
|
|
}
|
|
LAB_0091189c:
|
|
ehState = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x1))),6);
|
|
if (local_54 != (void *)0x0) {
|
|
uVar3 = GHIDRA_INT(removeMessage._menuPosition) - GHIDRA_INT(local_54) & 0xfffffff0;
|
|
pvVar4 = local_54;
|
|
if (0xfff < uVar3) {
|
|
pvVar4 = *(void **)(GHIDRA_INT(local_54) - 4);
|
|
uVar3 = uVar3 + 0x23;
|
|
if (0x1f < GHIDRA_UINT((GHIDRA_INT(local_54) + (-4 - GHIDRA_INT(pvVar4))))) goto LAB_00911409;
|
|
}
|
|
operator_delete(pvVar4,uVar3);
|
|
}
|
|
ehState = 9;
|
|
if (((local_5c != GHIDRA_CAST<NetplayManager *>(0x0)) &&
|
|
(cVar2 = (**(code **)(*GHIDRA_CAST<int *>(local_5c) + 0xc))(), cVar2 != '\0')) &&
|
|
(g_multiplayerRelease != (void *)0x0)) {
|
|
(*g_multiplayerRelease)();
|
|
}
|
|
ehState = 0xffffffff;
|
|
} while( true );
|
|
LAB_00911940:
|
|
iVar5 = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((iVar8 + 4 + iVar5)) + 0x374));
|
|
if (iVar5 == 0) {
|
|
local_80 = 0;
|
|
local_40 = GHIDRA_CAST<NetplayManager *>(0x0);
|
|
local_5c = GHIDRA_CAST<NetplayManager *>(0x0);
|
|
}
|
|
else {
|
|
local_5c = *GHIDRA_CAST<NetplayManager **>((iVar5 + 8));
|
|
local_40 = *GHIDRA_CAST<NetplayManager **>((iVar5 + 0xc));
|
|
}
|
|
iVar5 = GHIDRA_INT(local_54) - iVar8;
|
|
local_54 = (void *)0x0;
|
|
iVar5 = iVar5 / 0x18;
|
|
local_50 = CONCAT44(iVar5,GHIDRA_CAST<uint8_t **>(local_50));
|
|
if (iVar5 == 0) {
|
|
LAB_00911c37:
|
|
KAGE_LogMessage(8,(uint8_t *)
|
|
"[Frame %d] IsPlayerRemoveConfirmed() given User ID (%llu) that is not pending removal! \n"
|
|
);
|
|
LAB_00911a68:
|
|
}
|
|
else {
|
|
do {
|
|
userImpl = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((iVar8 + 4)) + 0x374));
|
|
if (userImpl == 0) {
|
|
local_80 = 0;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_80)) + 0x4))) = GHIDRA_CAST<NetplayManager *>(0x0);
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_80)) + 0x0))) = GHIDRA_CAST<NetplayManager *>(0x0);
|
|
latestFrameSrc = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_80)) + 0x4)));
|
|
pNVar7 = GHIDRA_CAST<NetplayManager *>(local_80);
|
|
}
|
|
else {
|
|
latestFrameSrc = *GHIDRA_CAST<NetplayManager **>((userImpl + 0xc));
|
|
pNVar7 = *GHIDRA_CAST<NetplayManager **>((userImpl + 8));
|
|
}
|
|
if ((pNVar7 == local_5c) && (latestFrameSrc == local_40)) {
|
|
local_54 = (void *)iVar8;
|
|
}
|
|
iVar8 = iVar8 + 0x18;
|
|
iVar5 = iVar5 + -1;
|
|
} while (iVar5 != 0);
|
|
this = GHIDRA_CAST<NetplayManager *>(self);
|
|
if (local_54 == (void *)0x0) goto LAB_00911c37;
|
|
local_40 = (self->_playerList)._begin;
|
|
iVar8 = GHIDRA_INT((self->_playerList)._end) - GHIDRA_INT(local_40) >> 2;
|
|
local_50 = CONCAT44(iVar8,GHIDRA_CAST<uint8_t **>(local_50));
|
|
local_5c = GHIDRA_CAST<NetplayManager *>(0x0);
|
|
latestFrameSrc = GHIDRA_CAST<NetplayManager *>(0x0);
|
|
if (iVar8 != 0) {
|
|
do {
|
|
iVar8 = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(local_40) + 0x374));
|
|
if (iVar8 == 0) {
|
|
local_80 = 0;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_80)) + 0x4))) = GHIDRA_CAST<NetplayManager *>(0x0);
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_80)) + 0x0))) = GHIDRA_CAST<NetplayManager *>(0x0);
|
|
iVar5 = GHIDRA_INT(GHIDRA_CAST<NetplayManager *>(local_80));
|
|
iVar8 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_INT(local_80))) + 0x4)));
|
|
}
|
|
else {
|
|
iVar5 = *GHIDRA_CAST<int *>((iVar8 + 8));
|
|
iVar8 = *GHIDRA_CAST<int *>((iVar8 + 0xc));
|
|
}
|
|
isInPlayerList = is_player_removal_queued(GHIDRA_CAST<NetplayManager *>(self),CONCAT44(iVar8,iVar5));
|
|
if (isInPlayerList == 0) {
|
|
uVar3 = 0;
|
|
piVar10 = *GHIDRA_CAST<int **>((GHIDRA_CAST<char *>(local_54) + 0xc));
|
|
uVar9 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_54) + 0x10)) - GHIDRA_INT(piVar10) >> 3;
|
|
if (uVar9 == 0) {
|
|
LAB_00911a65:
|
|
this = GHIDRA_CAST<NetplayManager *>(self);
|
|
goto LAB_00911a68;
|
|
}
|
|
while ((*piVar10 != iVar5 || (piVar10[1] != iVar8))) {
|
|
uVar3 = uVar3 + 1;
|
|
piVar10 = piVar10 + 2;
|
|
if (uVar9 <= uVar3) goto LAB_00911a65;
|
|
}
|
|
}
|
|
local_5c = GHIDRA_CAST<NetplayManager *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((local_5c)) + 0x1))));
|
|
local_40 = GHIDRA_CAST<NetplayManager *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_40[1])) + 0x1))));
|
|
} while (local_5c < (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_50)) + 0x4))));
|
|
latestFrameSrc = local_5c;
|
|
}
|
|
local_5c = latestFrameSrc;
|
|
this = GHIDRA_CAST<NetplayManager *>(self);
|
|
if (*GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(self[0x1c])) + 0x5c)))) + 8 + (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_INT(local_70))) + 0x4))))) <=
|
|
GHIDRA_UINT(self->_coopSlots[0]._controllerIndex)) {
|
|
*GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(self[0x1c])) + 0x5c)))) + (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_INT(local_70))) + 0x4))))) = 2;
|
|
}
|
|
}
|
|
local_54 = *(void **)&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(((GHIDRA_CAST<PlayerManager *>((GHIDRA_INT(this) + 0x1810))))) + 0x60)));
|
|
iVar5 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_INT(local_70))) + 0x4))) + 0x18;
|
|
iVar8 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(((GHIDRA_CAST<PlayerManager *>((GHIDRA_INT(this) + 0x1810))))) + 0x5c))));
|
|
uVar3 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_INT(uStack_68))) + 0x4))) + 1;
|
|
uStack_68 = CONCAT44(uVar3,GHIDRA_INT(uStack_68));
|
|
local_70 = CONCAT44(iVar5,(uint32_t)local_70);
|
|
if (GHIDRA_UINT(((GHIDRA_INT(local_54) - iVar8) / 0x18)) <= uVar3) {
|
|
LAB_00911aa4:
|
|
uVar9 = (GHIDRA_INT(local_54) - iVar8) / 0x18;
|
|
uVar3 = uVar9 - 1;
|
|
uStack_68 = CONCAT44(uVar3,GHIDRA_INT(uStack_68));
|
|
if (uVar3 < uVar9) {
|
|
local_54 = (void *)(uVar3 * 0x18);
|
|
do {
|
|
if (*GHIDRA_CAST<int *>((iVar8 + GHIDRA_INT(local_54))) == 2) {
|
|
RemoveRemotePlayer(this,(void *)(*GHIDRA_CAST<int *>((iVar8 + GHIDRA_INT(local_54) + 4)) + 0x370));
|
|
local_40 = (NetplayManager *)
|
|
(*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(((GHIDRA_CAST<PlayerManager *>((GHIDRA_INT(this) + 0x1810))))) + 0x5c)))) + GHIDRA_INT(local_54));
|
|
pNVar7 = *GHIDRA_CAST<NetplayManager **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(((GHIDRA_CAST<PlayerManager *>((GHIDRA_INT(this) + 0x1810))))) + 0x60))));
|
|
latestFrameSrc = local_40 + 8;
|
|
local_50 = CONCAT44(latestFrameSrc,GHIDRA_CAST<uint8_t **>(local_50));
|
|
local_5c = pNVar7;
|
|
if (latestFrameSrc != pNVar7) {
|
|
dstField = GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_40[6])) + 0x2))));
|
|
srcField = GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_40[0xe])) + 0x2))));
|
|
local_70 = CONCAT44(dstField,(uint32_t)local_70);
|
|
do {
|
|
*GHIDRA_CAST<int *>(local_40) = *GHIDRA_CAST<int *>(latestFrameSrc);
|
|
dstField[-4] = srcField[-4];
|
|
dstField[-3] = srcField[-3];
|
|
if (dstField != srcField) {
|
|
msvc::vector<Vector>::_Tidy();
|
|
dstField[-2] = srcField[-2];
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_70)) + 0x4)))[-1] = srcField[-1];
|
|
*(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_70)) + 0x4))) = *srcField;
|
|
srcField[-2] = 0;
|
|
srcField[-1] = 0;
|
|
*srcField = 0;
|
|
dstField = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_70)) + 0x4)));
|
|
pNVar7 = local_5c;
|
|
}
|
|
local_40 = local_40 + 8;
|
|
latestFrameSrc = GHIDRA_CAST<NetplayManager *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_INT(local_50))) + 0x4))) + 0x18));
|
|
dstField = dstField + 6;
|
|
local_50 = CONCAT44(latestFrameSrc,GHIDRA_CAST<uint8_t **>(local_50));
|
|
srcField = srcField + 6;
|
|
local_70 = CONCAT44(dstField,(uint32_t)local_70);
|
|
} while (latestFrameSrc != pNVar7);
|
|
this = GHIDRA_CAST<NetplayManager *>(self);
|
|
}
|
|
msvc::vector<Vector>::_Tidy();
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(((GHIDRA_CAST<PlayerManager *>((GHIDRA_INT(this) + 0x1810))))) + 0x60)))) =
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(((GHIDRA_CAST<PlayerManager *>((GHIDRA_INT(this) + 0x1810))))) + 0x60)))) + -0x18;
|
|
uVar3 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(uStack_68))) + 0x4)));
|
|
}
|
|
local_54 = (void *)(GHIDRA_INT(local_54) + -0x18);
|
|
iVar8 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(((GHIDRA_CAST<PlayerManager *>((GHIDRA_INT(this) + 0x1810))))) + 0x5c))));
|
|
uVar3 = uVar3 - 1;
|
|
uStack_68 = CONCAT44(uVar3,GHIDRA_INT(uStack_68));
|
|
} while (uVar3 < GHIDRA_UINT(((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(((GHIDRA_CAST<PlayerManager *>((GHIDRA_INT(this) + 0x1810))))) + 0x60)))) - iVar8)
|
|
/ 0x18)));
|
|
}
|
|
ExceptionList = savedExceptionList;
|
|
return;
|
|
}
|
|
goto LAB_00911940;
|
|
}
|
|
|
|
// 00911c70
|
|
void NetplayManager::update_revives()
|
|
{
|
|
uint32_t *puVar1;
|
|
char isLastRef;
|
|
uint32_t uVar2;
|
|
PlayerManager **entryFramePtr;
|
|
int iVar3;
|
|
int *piVar4;
|
|
Entity_Player *player;
|
|
PlayerManager **ppPVar5;
|
|
NetplayManager *pNVar6;
|
|
uint32_t *puVar7;
|
|
PlayerManager *pPVar8;
|
|
uint32_t uVar9;
|
|
int queueEntry;
|
|
int *piVar10;
|
|
PlayerManager *playerManager;
|
|
int iVar11;
|
|
void *pvVar12;
|
|
void *pvVar13;
|
|
uint8_t *messageRefCount;
|
|
uint32_t newRevive [2];
|
|
int iStack_88;
|
|
int iStack_84;
|
|
int iStack_80;
|
|
void *pvStack_7c;
|
|
uint32_t uStack_78;
|
|
int iStack_74;
|
|
uint32_t reviveMessage;
|
|
uint32_t reviveUserIdHigh;
|
|
uint64_t local_68;
|
|
uint64_t confirmUserId;
|
|
uint64_t senderUserId;
|
|
PlayerManager *local_4c;
|
|
uint64_t local_48;
|
|
PlayerManager *local_40;
|
|
PlayerManager *local_3c;
|
|
uint32_t local_38;
|
|
int *local_34;
|
|
PlayerManager *local_30;
|
|
int *local_2c;
|
|
NetplayManager *reviveQueue;
|
|
PlayerManager *netplayManager;
|
|
uint8_t *puStack_20;
|
|
void *local_1c;
|
|
uint8_t *puStack_18;
|
|
uint32_t local_14;
|
|
Game *game;
|
|
Manager *manager;
|
|
PlayerManager *playerListBegin;
|
|
|
|
local_14 = 0xffffffff;
|
|
puStack_18 = &LAB_00b0987d;
|
|
local_1c = ExceptionList;
|
|
puStack_20 = GHIDRA_CAST<uint8_t *>((GHIDRA_INT(register0x00000010) + -4));
|
|
uVar2 = __security_cookie ^ GHIDRA_UINT((newRevive + 0x20));
|
|
ExceptionList = &local_1c;
|
|
netplayManager = GHIDRA_CAST<PlayerManager *>(this);
|
|
iVar3 = *GHIDRA_CAST<int *>((this + 0x828));
|
|
pNVar6 = this + 0x828;
|
|
local_30 = GHIDRA_CAST<PlayerManager *>(0x0);
|
|
reviveQueue = pNVar6;
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x829])) + 0x1)))) - iVar3 >> 5 != 0) {
|
|
iVar11 = 0;
|
|
do {
|
|
if (*GHIDRA_CAST<int *>((iVar11 + iVar3)) == 0) {
|
|
local_4c = (PlayerManager *)
|
|
(netplayManager->_coopSlots[0]._playerType +
|
|
netplayManager->_coopSlots[0]._controllerIndex);
|
|
entryFramePtr = GHIDRA_CAST<PlayerManager **>((iVar3 + 0x10 + iVar11));
|
|
ppPVar5 = &local_4c;
|
|
if (local_4c <= *entryFramePtr) {
|
|
ppPVar5 = entryFramePtr;
|
|
}
|
|
reviveMessage = *GHIDRA_CAST<uint32_t *>((iVar11 + 8 + iVar3));
|
|
local_4c = *ppPVar5;
|
|
reviveUserIdHigh = *GHIDRA_CAST<uint32_t *>((iVar11 + 0xc + iVar3));
|
|
local_68 = CONCAT44((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_68)) + 0x4))),local_4c);
|
|
if (g_multiplayerService == (void *)0x0) {
|
|
KAGE_LogMessage(0x10,(uint8_t *)
|
|
"Attempting to create a message when there is no multiplayer service\n"
|
|
);
|
|
}
|
|
messageRefCount = &DAT_00000007;
|
|
pvVar13 = (void *)0x10;
|
|
NetConnection::send_message(g_multiplayerService,&local_40,1,&reviveMessage,0x10,7);
|
|
manager = g_manager;
|
|
local_14 = 0;
|
|
FUN_008ef1d0(&local_40);
|
|
send_message(GHIDRA_CAST<NetplayManager *>(&manager->_netplayManager),8,pvVar13,messageRefCount);
|
|
local_14 = 1;
|
|
if (((local_3c != GHIDRA_CAST<PlayerManager *>(0x0)) &&
|
|
(isLastRef = (**(code **)(GHIDRA_INT((local_3c->_playerList)._begin) + 0xc))(),
|
|
isLastRef != '\0')) && (g_multiplayerRelease != (void *)0x0)) {
|
|
(*g_multiplayerRelease)(&local_40);
|
|
}
|
|
local_14 = 0xffffffff;
|
|
queueEntry = *GHIDRA_CAST<int *>(reviveQueue) + iVar11;
|
|
iVar3 = FUN_0090b070();
|
|
iVar3 = *GHIDRA_CAST<int *>((iVar3 + 0x374));
|
|
if (iVar3 == 0) {
|
|
local_48 = 0;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_48)) + 0x4))) = GHIDRA_CAST<uint32_t *>(0x0);
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_48)) + 0x0))) = 0;
|
|
local_38 = (uint32_t)local_48;
|
|
local_34 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<int *>(local_48))) + 0x4)));
|
|
}
|
|
else {
|
|
local_38 = *GHIDRA_CAST<uint32_t *>((iVar3 + 8));
|
|
local_34 = *GHIDRA_CAST<int **>((iVar3 + 0xc));
|
|
}
|
|
puVar1 = *GHIDRA_CAST<uint32_t **>((queueEntry + 0x18));
|
|
if (puVar1 == *GHIDRA_CAST<uint32_t **>((queueEntry + 0x1c))) {
|
|
msvc::vector<8byte>::_Emplace_reallocate(puVar1,&local_38);
|
|
}
|
|
else {
|
|
*puVar1 = local_38;
|
|
puVar1[1] = local_34;
|
|
*GHIDRA_CAST<int *>((queueEntry + 0x18)) = *GHIDRA_CAST<int *>((queueEntry + 0x18)) + 8;
|
|
}
|
|
*GHIDRA_CAST<PlayerManager **>((*GHIDRA_CAST<int *>(reviveQueue) + 0x10 + iVar11)) = local_4c;
|
|
*GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(reviveQueue) + iVar11)) = 1;
|
|
pNVar6 = reviveQueue;
|
|
}
|
|
local_30 = GHIDRA_CAST<PlayerManager *>((GHIDRA_INT(&(local_30->_playerList)._begin) + 1));
|
|
iVar3 = *GHIDRA_CAST<int *>(pNVar6);
|
|
iVar11 = iVar11 + 0x20;
|
|
} while (local_30 < GHIDRA_CAST<PlayerManager *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(pNVar6[1])) + 0x1)))) - iVar3 >> 5)));
|
|
}
|
|
LAB_00911e30:
|
|
pNVar6 = reviveQueue;
|
|
if (g_multiplayerService != (void *)0x0) {
|
|
piVar4 = (GHIDRA_CAST<NetworkManager *>((g_multiplayerService)))->NetworkManager::receive_message(&local_38,7,0);
|
|
iVar3 = *piVar4;
|
|
local_14 = 2;
|
|
if (((local_34 != GHIDRA_CAST<int *>(0x0)) &&
|
|
(isLastRef = (**(code **)(*local_34 + 0xc))(uVar2), isLastRef != '\0')) &&
|
|
(g_multiplayerRelease != (void *)0x0)) {
|
|
(*g_multiplayerRelease)(&local_38);
|
|
}
|
|
local_14 = 0xffffffff;
|
|
if (iVar3 != 0) {
|
|
if (g_multiplayerService == (void *)0x0) {
|
|
KAGE::SmartPointer<MessageData>::reset(0);
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<NetworkManager *>((g_multiplayerService)))->NetworkManager::receive_message(&local_40,7,1);
|
|
}
|
|
pPVar8 = local_40;
|
|
local_14 = 3;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(senderUserId)) + 0x0))) = (local_40->_playerList)._begin;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(senderUserId)) + 0x4))) = (local_40->_playerList)._end;
|
|
player = (GHIDRA_CAST<PlayerManager *>((netplayManager)))->PlayerManager::get_player_by_user_id(&senderUserId);
|
|
if (player != GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
local_4c = pPVar8;
|
|
if (pPVar8->_coopSlots[0]._controllerIndex != 1) {
|
|
KAGE_LogMessage(0x10,(uint8_t *)
|
|
"This function should only be called on consolidated messages");
|
|
}
|
|
iVar3 = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((local_4c->_playerList)._capacity) + 0x14));
|
|
local_2c = GHIDRA_CAST<int *>((iVar3 + 8));
|
|
local_48 = CONCAT44(iVar3 + 0x10,(uint32_t)local_48);
|
|
KAGE_LogMessage(1,(uint8_t *)
|
|
"[FRAME: %d] Recieved Message_RevivePlayer from User(%llu), for User(%llu), Revive Frame = %d \n"
|
|
);
|
|
piVar4 = local_2c;
|
|
iVar3 = *GHIDRA_CAST<int *>(pNVar6);
|
|
local_30 = GHIDRA_CAST<PlayerManager *>(0x0);
|
|
local_4c = GHIDRA_CAST<PlayerManager *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(pNVar6[1])) + 0x1)))) - iVar3 >> 5));
|
|
if (local_4c != GHIDRA_CAST<PlayerManager *>(0x0)) {
|
|
do {
|
|
if ((*GHIDRA_CAST<int *>((iVar3 + 8)) == *local_2c) && (*GHIDRA_CAST<int *>((iVar3 + 0xc)) == local_2c[1])) {
|
|
if (iVar3 != 0) {
|
|
pPVar8 = GHIDRA_CAST<PlayerManager *>(0x0);
|
|
puVar7 = *GHIDRA_CAST<uint32_t **>((iVar3 + 0x14));
|
|
local_4c = GHIDRA_CAST<PlayerManager *>((*GHIDRA_CAST<int *>((iVar3 + 0x18)) - GHIDRA_INT(puVar7) >> 3));
|
|
if (local_4c == GHIDRA_CAST<PlayerManager *>(0x0)) goto LAB_00912059;
|
|
local_30 = (local_40->_playerList)._begin;
|
|
goto LAB_00912042;
|
|
}
|
|
break;
|
|
}
|
|
local_30 = GHIDRA_CAST<PlayerManager *>((GHIDRA_INT(&(local_30->_playerList)._begin) + 1));
|
|
iVar3 = iVar3 + 0x20;
|
|
} while (local_30 < local_4c);
|
|
}
|
|
KAGE_LogMessage(1,(uint8_t *)
|
|
"[FRAME: %d] - No pending revival found for user(%llu), creating one \n");
|
|
iStack_88 = *piVar4;
|
|
iStack_84 = piVar4[1];
|
|
newRevive[0] = 0;
|
|
iStack_80 = 0;
|
|
pvStack_7c = (void *)0x0;
|
|
uStack_78 = 0;
|
|
iStack_74 = 0;
|
|
local_14 = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))),4);
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_68)) + 0x0))) = (local_40->_playerList)._begin;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_68)) + 0x4))) = (local_40->_playerList)._end;
|
|
msvc::vector<8byte>::_Emplace_reallocate(0,&local_68);
|
|
iStack_80 = piVar4[2];
|
|
puVar1 = *GHIDRA_CAST<uint32_t **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(netplayManager[0x1c])) + 0x6c))));
|
|
if (puVar1 == netplayManager[0x1c]._coopPlayerTypes._begin) {
|
|
FUN_009149f0(puVar1,newRevive);
|
|
}
|
|
else {
|
|
*puVar1 = newRevive[0];
|
|
puVar1[2] = iStack_88;
|
|
puVar1[3] = iStack_84;
|
|
puVar1[4] = iStack_80;
|
|
FUN_00915d70(&pvStack_7c);
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(pNVar6[1])) + 0x1)))) = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(pNVar6[1])) + 0x1)))) + 0x20;
|
|
}
|
|
local_14 = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))),3);
|
|
if (pvStack_7c != (void *)0x0) {
|
|
uVar9 = (iStack_74 - GHIDRA_INT(pvStack_7c) >> 3) * 8;
|
|
pvVar13 = pvStack_7c;
|
|
if (0xfff < uVar9) {
|
|
pvVar13 = *(void **)(GHIDRA_CAST<char *>(pvStack_7c) + -4);
|
|
uVar9 = uVar9 + 0x23;
|
|
if (0x1f < GHIDRA_UINT((GHIDRA_INT(pvStack_7c) + (-4 - GHIDRA_INT(pvVar13))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(pvVar13,uVar9);
|
|
}
|
|
}
|
|
goto LAB_0091211f;
|
|
}
|
|
}
|
|
iVar3 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(pNVar6[1])) + 0x1))));
|
|
pPVar8 = *GHIDRA_CAST<PlayerManager **>(pNVar6);
|
|
local_30 = GHIDRA_CAST<PlayerManager *>(0x0);
|
|
if (iVar3 - GHIDRA_INT(pPVar8) >> 5 == 0) {
|
|
LAB_009122d0:
|
|
uVar2 = iVar3 - GHIDRA_INT(pPVar8) >> 5;
|
|
local_30 = GHIDRA_CAST<PlayerManager *>((uVar2 - 1));
|
|
if (local_30 < uVar2) {
|
|
local_2c = GHIDRA_CAST<int *>((GHIDRA_INT(local_30) * 0x20));
|
|
do {
|
|
game = g_game;
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pPVar8->_coopSlots) + GHIDRA_INT(local_2c) + -0xc)) == 2) {
|
|
playerManager = &g_game->_playerManager;
|
|
local_4c = playerManager;
|
|
player = PlayerManager::get_player_by_user_id
|
|
(netplayManager,
|
|
GHIDRA_CAST<uint64_t *>((GHIDRA_INT(pPVar8->_coopSlots) + GHIDRA_INT(local_2c) + -4)));
|
|
uVar2 = 0;
|
|
piVar4 = (playerManager->_playerList)._begin;
|
|
uVar9 = GHIDRA_INT((game->_playerManager)._playerList._end) - GHIDRA_INT(piVar4) >> 2;
|
|
if (uVar9 != 0) {
|
|
do {
|
|
iVar3 = piVar4[uVar2];
|
|
if (*GHIDRA_CAST<int *>((iVar3 + 0x1618)) == *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((player)) + 0xc))))) goto LAB_00912346;
|
|
uVar2 = uVar2 + 1;
|
|
} while (uVar2 < uVar9);
|
|
}
|
|
iVar3 = 0;
|
|
if (uVar9 != 0) {
|
|
LAB_00912346:
|
|
uVar2 = 0;
|
|
do {
|
|
if (*piVar4 == iVar3) goto LAB_00912357;
|
|
uVar2 = uVar2 + 1;
|
|
piVar4 = piVar4 + 1;
|
|
} while (uVar2 < uVar9);
|
|
}
|
|
uVar2 = 0xffffffff;
|
|
LAB_00912357:
|
|
PlayerManager::ReviveCoopPlayer(uVar2);
|
|
local_34 = GHIDRA_CAST<int *>((GHIDRA_INT(local_2c) + *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(netplayManager[0x1c])) + 0x68))))));
|
|
pPVar8 = *GHIDRA_CAST<PlayerManager **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(netplayManager[0x1c])) + 0x6c))));
|
|
local_4c = GHIDRA_CAST<PlayerManager *>((local_34 + 8));
|
|
local_3c = pPVar8;
|
|
if (local_4c != pPVar8) {
|
|
piVar4 = local_34 + 7;
|
|
piVar10 = local_34 + 0xf;
|
|
local_48 = CONCAT44(piVar4,(uint32_t)local_48);
|
|
do {
|
|
*local_34 = GHIDRA_INT((local_4c->_playerList)._begin);
|
|
iVar3 = piVar10[-4];
|
|
piVar4[-5] = piVar10[-5];
|
|
piVar4[-4] = iVar3;
|
|
piVar4[-3] = piVar10[-3];
|
|
if (piVar4 != piVar10) {
|
|
msvc::vector<Vector>::_Tidy();
|
|
piVar4[-2] = piVar10[-2];
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_48)) + 0x4)))[-1] = piVar10[-1];
|
|
*(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_48)) + 0x4))) = *piVar10;
|
|
piVar10[-2] = 0;
|
|
piVar10[-1] = 0;
|
|
*piVar10 = 0;
|
|
piVar4 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<int *>(local_48))) + 0x4)));
|
|
pPVar8 = local_3c;
|
|
}
|
|
piVar4 = piVar4 + 8;
|
|
local_4c = GHIDRA_CAST<PlayerManager *>((local_4c->_coopSlots + 1));
|
|
local_34 = local_34 + 8;
|
|
local_48 = CONCAT44(piVar4,(uint32_t)local_48);
|
|
piVar10 = piVar10 + 8;
|
|
} while (local_4c != pPVar8);
|
|
}
|
|
pPVar8 = netplayManager;
|
|
msvc::vector<Vector>::_Tidy();
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(pPVar8[0x1c])) + 0x6c)))) = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(pPVar8[0x1c])) + 0x6c)))) + -0x20;
|
|
pNVar6 = reviveQueue;
|
|
}
|
|
local_30 = GHIDRA_CAST<PlayerManager *>((GHIDRA_INT(local_30) - 1));
|
|
pPVar8 = *GHIDRA_CAST<PlayerManager **>(pNVar6);
|
|
local_2c = GHIDRA_CAST<int *>((GHIDRA_INT(local_2c) + -0x20));
|
|
} while (local_30 < GHIDRA_UINT((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(pNVar6[1])) + 0x1)))) - GHIDRA_INT(pPVar8) >> 5)));
|
|
}
|
|
ExceptionList = local_1c;
|
|
return;
|
|
}
|
|
local_2c = GHIDRA_CAST<int *>(0x0);
|
|
LAB_00912180:
|
|
piVar4 = local_2c;
|
|
uVar9 = 0;
|
|
uVar2 = iVar3 - GHIDRA_INT(pPVar8) >> 5;
|
|
playerManager = pPVar8;
|
|
if (uVar2 != 0) {
|
|
local_4c = *GHIDRA_CAST<PlayerManager **>((GHIDRA_CAST<char *>(pPVar8->_coopSlots) + GHIDRA_INT(local_2c) + -4));
|
|
iVar3 = *GHIDRA_CAST<int *>((GHIDRA_INT(&pPVar8->_coopSlots[0]._controllerIndex) + GHIDRA_INT(local_2c)));
|
|
local_48 = CONCAT44(iVar3,(uint32_t)local_48);
|
|
local_3c = pPVar8;
|
|
do {
|
|
if (((pPVar8->_playerList)._capacity == local_4c) &&
|
|
(pPVar8->_coopSlots[0]._controllerIndex == iVar3)) {
|
|
playerManager = local_3c;
|
|
if (pPVar8 != GHIDRA_CAST<PlayerManager *>(0x0)) {
|
|
local_34 = GHIDRA_CAST<int *>(0x0);
|
|
playerListBegin = (netplayManager->_playerList)._begin;
|
|
piVar10 = GHIDRA_CAST<int *>((GHIDRA_INT((netplayManager->_playerList)._end) - GHIDRA_INT(playerListBegin) >> 2));
|
|
local_48 = CONCAT44(piVar10,(uint32_t)local_48);
|
|
local_3c = playerListBegin;
|
|
if (piVar10 == GHIDRA_CAST<int *>(0x0)) goto LAB_00912262;
|
|
local_4c = GHIDRA_CAST<PlayerManager *>(pPVar8->_coopSlots[0]._state);
|
|
uVar2 = GHIDRA_INT(pPVar8->_coopSlots[0]._menuPosition) - GHIDRA_INT(local_4c) >> 3;
|
|
goto LAB_00912202;
|
|
}
|
|
break;
|
|
}
|
|
uVar9 = uVar9 + 1;
|
|
pPVar8 = GHIDRA_CAST<PlayerManager *>((pPVar8->_coopSlots + 1));
|
|
playerManager = *GHIDRA_CAST<PlayerManager **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(netplayManager[0x1c])) + 0x68))));
|
|
local_3c = playerManager;
|
|
} while (uVar9 < uVar2);
|
|
}
|
|
goto LAB_00912283;
|
|
while( true ) {
|
|
pPVar8 = GHIDRA_CAST<PlayerManager *>((GHIDRA_INT(&(pPVar8->_playerList)._begin) + 1));
|
|
puVar7 = puVar7 + 2;
|
|
if (local_4c <= pPVar8) break;
|
|
LAB_00912042:
|
|
if ((GHIDRA_CAST<PlayerManager *>(*puVar7) == local_30) &&
|
|
((void *)puVar7[1] == (local_40->_playerList)._end)) {
|
|
KAGE_LogMessage(8,(uint8_t *)
|
|
"[FRAME: %d] - User(%llu) has already confirmed revival for User(%llu)! \n")
|
|
;
|
|
goto LAB_0091211f;
|
|
}
|
|
}
|
|
LAB_00912059:
|
|
KAGE_LogMessage(1,(uint8_t *)
|
|
"[FRAME: %d] - Adding revival confirmation to existing pending revival \n");
|
|
puVar7 = GHIDRA_CAST<uint32_t *>((iVar3 + 0x10));
|
|
if (*GHIDRA_CAST<uint32_t *>((iVar3 + 0x10)) < *(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_48)) + 0x4)))) {
|
|
puVar7 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_48)) + 0x4)));
|
|
}
|
|
*GHIDRA_CAST<uint32_t *>((iVar3 + 0x10)) = *puVar7;
|
|
puVar1 = *GHIDRA_CAST<uint32_t **>((iVar3 + 0x18));
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(confirmUserId)) + 0x0))) = (local_40->_playerList)._begin;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(confirmUserId)) + 0x4))) = (local_40->_playerList)._end;
|
|
if (puVar1 == *GHIDRA_CAST<uint32_t **>((iVar3 + 0x1c))) {
|
|
msvc::vector<8byte>::_Emplace_reallocate(puVar1,&confirmUserId);
|
|
}
|
|
else {
|
|
*puVar1 = (void *)confirmUserId;
|
|
puVar1[1] = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(confirmUserId)) + 0x4)));
|
|
*GHIDRA_CAST<int *>((iVar3 + 0x18)) = *GHIDRA_CAST<int *>((iVar3 + 0x18)) + 8;
|
|
}
|
|
LAB_0091211f:
|
|
local_14 = 5;
|
|
if (((local_3c != GHIDRA_CAST<PlayerManager *>(0x0)) &&
|
|
(isLastRef = (**(code **)(GHIDRA_INT((local_3c->_playerList)._begin) + 0xc))(), isLastRef != '\0'))
|
|
&& (g_multiplayerRelease != (void *)0x0)) {
|
|
(*g_multiplayerRelease)(&local_40);
|
|
}
|
|
local_14 = 0xffffffff;
|
|
goto LAB_00911e30;
|
|
while( true ) {
|
|
pPVar8 = local_4c;
|
|
while (((pPVar8->_playerList)._begin != pvVar13 || ((pPVar8->_playerList)._end != pvVar12))) {
|
|
uVar9 = uVar9 + 1;
|
|
pPVar8 = GHIDRA_CAST<PlayerManager *>(&(pPVar8->_playerList)._capacity);
|
|
if (uVar2 <= uVar9) goto LAB_00912241;
|
|
}
|
|
local_34 = GHIDRA_CAST<int *>((GHIDRA_INT(local_34) + 1));
|
|
local_3c = GHIDRA_CAST<PlayerManager *>(&(local_3c->_playerList)._end);
|
|
if (piVar10 <= local_34) break;
|
|
LAB_00912202:
|
|
iVar3 = *GHIDRA_CAST<int *>((GHIDRA_INT((local_3c->_playerList)._begin) + 0x374));
|
|
if (iVar3 == 0) {
|
|
local_68 = 0;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_68)) + 0x4))) = (void *)0x0;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_68)) + 0x0))) = (void *)0x0;
|
|
pvVar13 = (void *)local_68;
|
|
pvVar12 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_68)) + 0x4)));
|
|
}
|
|
else {
|
|
pvVar13 = *(void **)(iVar3 + 8);
|
|
pvVar12 = *(void **)(iVar3 + 0xc);
|
|
}
|
|
uVar9 = 0;
|
|
if (uVar2 == 0) {
|
|
LAB_00912241:
|
|
playerManager = *GHIDRA_CAST<PlayerManager **>(reviveQueue);
|
|
goto LAB_00912283;
|
|
}
|
|
}
|
|
playerManager = *GHIDRA_CAST<PlayerManager **>(reviveQueue);
|
|
LAB_00912262:
|
|
puVar1 = GHIDRA_CAST<uint32_t *>((GHIDRA_INT(playerManager->_coopSlots) + GHIDRA_INT(local_2c) + -0xc));
|
|
if (netplayManager->_coopSlots[0]._controllerIndex == puVar1[4]) {
|
|
*puVar1 = 2;
|
|
}
|
|
else {
|
|
LAB_00912283:
|
|
if (*GHIDRA_CAST<uint32_t *>((GHIDRA_INT(&playerManager->_coopSlots[0]._playerType) + GHIDRA_INT(local_2c))) <
|
|
GHIDRA_UINT(netplayManager->_coopSlots[0]._controllerIndex)) {
|
|
KAGE_LogMessage(8,(uint8_t *)
|
|
"[FRAME: %d] Revival Frame for User(%llu) has passed without being revived! (Revive Frame = %d) \n"
|
|
);
|
|
}
|
|
}
|
|
local_2c = GHIDRA_CAST<int *>((GHIDRA_INT(piVar4) + 0x20));
|
|
local_30 = GHIDRA_CAST<PlayerManager *>((GHIDRA_INT(local_30) + 1));
|
|
iVar3 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(reviveQueue[1])) + 0x1))));
|
|
pPVar8 = *GHIDRA_CAST<PlayerManager **>(reviveQueue);
|
|
pNVar6 = reviveQueue;
|
|
if (GHIDRA_UINT((iVar3 - GHIDRA_INT(pPVar8) >> 5)) <= local_30) goto LAB_009122d0;
|
|
goto LAB_00912180;
|
|
}
|
|
|
|
// 00912450
|
|
void NetplayManager::remove_drop_entry(uint64_t userId)
|
|
{
|
|
int iVar1;
|
|
int *piVar2;
|
|
uint32_t *entriesEnd;
|
|
uint32_t index;
|
|
uint32_t *nextEntry;
|
|
uint32_t entryCount;
|
|
int *nextSet;
|
|
uint32_t userIdHigh;
|
|
|
|
piVar2 = *GHIDRA_CAST<int **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x81d])) + 0x1))));
|
|
index = 0;
|
|
entryCount = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x81e])) + 0x2)))) - GHIDRA_INT(piVar2) >> 4;
|
|
if (entryCount != 0) {
|
|
while ((*piVar2 != GHIDRA_INT(userId) || (GHIDRA_CAST<uint32_t *>(piVar2[1]) != (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(userId)) + 0x4)))))) {
|
|
index = index + 1;
|
|
piVar2 = piVar2 + 4;
|
|
if (entryCount <= index) {
|
|
return;
|
|
}
|
|
}
|
|
entriesEnd = *GHIDRA_CAST<uint32_t **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x81e])) + 0x2))));
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(userId)) + 0x4))) = GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x81d])) + 0x1)))) + index * 0x10));
|
|
nextEntry = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(userId)) + 0x4))) + 4;
|
|
if (nextEntry != entriesEnd) {
|
|
nextSet = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(userId)) + 0x4))) + 6;
|
|
piVar2 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(userId)) + 0x4))) + 2;
|
|
do {
|
|
userIdHigh = nextEntry[1];
|
|
*(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(userId)) + 0x4))) = *nextEntry;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(userId)) + 0x4)))[1] = userIdHigh;
|
|
if (piVar2 != nextSet) {
|
|
iVar1 = *piVar2;
|
|
FID_conflict__Erase_tree<fuzzer::fuzzer_allocator<msvc::_Tree_node<fuzzer::TracePC::PCTableEntry_const*,void*>_>_>
|
|
(piVar2,(fuzzer_allocator<msvc::_Tree_node<unsigned_int,void*>_> *)piVar2,
|
|
*(_Tree_node<unsigned_int,void*> **)(iVar1 + 4));
|
|
*GHIDRA_CAST<int *>((iVar1 + 4)) = iVar1;
|
|
*GHIDRA_CAST<int *>(iVar1) = iVar1;
|
|
*GHIDRA_CAST<int *>((iVar1 + 8)) = iVar1;
|
|
piVar2[1] = 0;
|
|
iVar1 = *piVar2;
|
|
*piVar2 = *nextSet;
|
|
*nextSet = iVar1;
|
|
iVar1 = piVar2[1];
|
|
piVar2[1] = nextSet[1];
|
|
nextSet[1] = iVar1;
|
|
}
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(userId)) + 0x4))) = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(userId)) + 0x4))) + 4;
|
|
nextEntry = nextEntry + 4;
|
|
nextSet = nextSet + 4;
|
|
piVar2 = piVar2 + 4;
|
|
} while (nextEntry != entriesEnd);
|
|
entriesEnd = *GHIDRA_CAST<uint32_t **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x81e])) + 0x2))));
|
|
}
|
|
piVar2 = entriesEnd + -2;
|
|
FID_conflict__Erase_tree<fuzzer::fuzzer_allocator<msvc::_Tree_node<fuzzer::TracePC::PCTableEntry_const*,void*>_>_>
|
|
(piVar2,(fuzzer_allocator<msvc::_Tree_node<unsigned_int,void*>_> *)piVar2,
|
|
*(_Tree_node<unsigned_int,void*> **)(*piVar2 + 4));
|
|
operator_delete((void *)*piVar2,0x20);
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x81e])) + 0x2)))) = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x81e])) + 0x2)))) + -0x10;
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 00912560
|
|
void NetplayManager::receive_vote_end_message()
|
|
{
|
|
uint32_t uVar1;
|
|
char isLastReference;
|
|
uint32_t uVar2;
|
|
int *peekResult;
|
|
int iVar3;
|
|
int iVar4;
|
|
void *pvVar5;
|
|
uint32_t *puVar6;
|
|
int iVar7;
|
|
void *missingProfiles;
|
|
uint32_t *missingProfilesEnd;
|
|
uint32_t *missingProfilesCapacity;
|
|
uint64_t local_50;
|
|
uint8_t local_48 [4];
|
|
int *peekRefCount;
|
|
uint32_t *voteMessage;
|
|
int *voteMessageRefCount;
|
|
Game *game;
|
|
NetplayManager *netplayManager;
|
|
uint32_t entryCount;
|
|
void *local_2c;
|
|
int *local_28;
|
|
void *local_24;
|
|
uint8_t *puStack_20;
|
|
void *local_1c;
|
|
uint8_t *puStack_18;
|
|
uint32_t local_14;
|
|
uint32_t *profileEntry;
|
|
|
|
puStack_20 = local_48 + 0x44;
|
|
puStack_18 = &LAB_00b098b5;
|
|
local_1c = ExceptionList;
|
|
uVar2 = __security_cookie ^ GHIDRA_UINT((local_48 + 0x38));
|
|
ExceptionList = &local_1c;
|
|
netplayManager = this;
|
|
while (local_14 = 0xffffffff, g_multiplayerService != (void *)0x0) {
|
|
peekResult = (GHIDRA_CAST<NetworkManager *>((g_multiplayerService)))->NetworkManager::receive_message(local_48,8,0);
|
|
iVar7 = *peekResult;
|
|
local_14 = 0;
|
|
if (((peekRefCount != GHIDRA_CAST<int *>(0x0)) &&
|
|
(isLastReference = (**(code **)(*peekRefCount + 0xc))(uVar2), isLastReference != '\0')) &&
|
|
(g_multiplayerRelease != (void *)0x0)) {
|
|
(*g_multiplayerRelease)(local_48);
|
|
}
|
|
local_14 = 0xffffffff;
|
|
if (iVar7 == 0) break;
|
|
if (g_multiplayerService == (void *)0x0) {
|
|
KAGE::SmartPointer<MessageData>::reset(0);
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<NetworkManager *>((g_multiplayerService)))->NetworkManager::receive_message(&voteMessage,8,1);
|
|
}
|
|
local_14 = 1;
|
|
KAGE_LogMessage(1,GHIDRA_CAST<uint8_t *>("[Frame: %d] Recieved Vote End message from user %llu \n"));
|
|
puVar6 = voteMessage;
|
|
if (voteMessage[3] != 1) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("This function should only be called on consolidated messages"));
|
|
}
|
|
FUN_0090a4b0(*voteMessage,voteMessage[1],*GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(puVar6[2]) + 0x14)) + 8))
|
|
,*GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(puVar6[2]) + 0x14)) + 0xc)));
|
|
local_14 = 2;
|
|
if (((voteMessageRefCount != GHIDRA_CAST<int *>(0x0)) &&
|
|
(isLastReference = (**(code **)(*voteMessageRefCount + 0xc))(), isLastReference != '\0')) &&
|
|
(g_multiplayerRelease != (void *)0x0)) {
|
|
(*g_multiplayerRelease)(&voteMessage);
|
|
}
|
|
}
|
|
local_14 = 0xffffffff;
|
|
entryCount = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x82d])) + 0x1)))) - GHIDRA_INT(*GHIDRA_CAST<int **>((this + 0x82c))) >> 4;
|
|
if (entryCount != 0) {
|
|
local_28 = *GHIDRA_CAST<int **>(this);
|
|
local_24 = (void *)0x0;
|
|
local_2c = (void *)(*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[1])) + 0x1)))) - GHIDRA_INT(local_28) >> 2);
|
|
if (local_2c != (void *)0x0) {
|
|
do {
|
|
uVar2 = 0;
|
|
iVar7 = *GHIDRA_CAST<int *>((*local_28 + 0x374));
|
|
peekResult = *GHIDRA_CAST<int **>((this + 0x82c));
|
|
while( true ) {
|
|
if (iVar7 == 0) {
|
|
local_50 = 0;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_50)) + 0x4))) = 0;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_50)) + 0x0))) = 0;
|
|
iVar3 = GHIDRA_INT(local_50);
|
|
iVar4 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_50)) + 0x4)));
|
|
}
|
|
else {
|
|
iVar3 = *GHIDRA_CAST<int *>((iVar7 + 8));
|
|
iVar4 = *GHIDRA_CAST<int *>((iVar7 + 0xc));
|
|
}
|
|
if (((*peekResult == iVar3) && (peekResult[1] == iVar4)) &&
|
|
(GHIDRA_UINT(peekResult[3]) <= *GHIDRA_CAST<uint32_t *>((netplayManager + 4)))) break;
|
|
uVar2 = uVar2 + 1;
|
|
peekResult = peekResult + 4;
|
|
if (entryCount <= uVar2) {
|
|
ExceptionList = local_1c;
|
|
return;
|
|
}
|
|
}
|
|
local_24 = (void *)(GHIDRA_INT(local_24) + 1);
|
|
local_28 = local_28 + 1;
|
|
} while (local_24 < local_2c);
|
|
}
|
|
game = g_game;
|
|
if (((g_game->_genericPrompt)._sprite._animState._animData != (void *)0x0) &&
|
|
((g_game->_genericPrompt)._sprite._animState._isPlaying != 0)) {
|
|
KAGE_LogMessage(1,GHIDRA_CAST<uint8_t *>("[Frame: %d] Victory lap vote processed \n"));
|
|
GenericPrompt::Disappear(&(g_game->_genericPrompt)._sprite);
|
|
local_24 = (void *)0x1;
|
|
puVar6 = GHIDRA_CAST<uint32_t *>(0x0);
|
|
missingProfiles = (void *)0x0;
|
|
missingProfilesEnd = GHIDRA_CAST<uint32_t *>(0x0);
|
|
local_28 = GHIDRA_CAST<uint32_t *>(0x0);
|
|
missingProfilesCapacity = GHIDRA_CAST<uint32_t *>(0x0);
|
|
local_14 = 3;
|
|
pvVar5 = *(void **)&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(g_manager[1]._gamestate)) + 0x8dc)));
|
|
entryCount = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(g_manager[1]._gamestate)) + 0x8e0)))) - GHIDRA_INT(pvVar5) >> 4;
|
|
if (entryCount != 0) {
|
|
iVar7 = 0;
|
|
do {
|
|
profileEntry = GHIDRA_CAST<uint32_t *>((GHIDRA_INT(pvVar5) + iVar7));
|
|
if (profileEntry[2] == 0) {
|
|
if (puVar6 == local_28) {
|
|
msvc::vector<8byte>::_Emplace_reallocate(puVar6,profileEntry);
|
|
local_28 = missingProfilesCapacity;
|
|
puVar6 = missingProfilesEnd;
|
|
}
|
|
else {
|
|
uVar1 = profileEntry[1];
|
|
*puVar6 = *profileEntry;
|
|
puVar6[1] = uVar1;
|
|
missingProfilesEnd = puVar6 + 2;
|
|
puVar6 = missingProfilesEnd;
|
|
}
|
|
}
|
|
if (g_userProfile == (void *)0x0) {
|
|
local_50 = 0;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_50)) + 0x4))) = 0;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_50)) + 0x0))) = 0;
|
|
iVar3 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_50)) + 0x4)));
|
|
iVar4 = GHIDRA_INT(local_50);
|
|
}
|
|
else {
|
|
iVar3 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_userProfile) + 0xc));
|
|
iVar4 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_userProfile) + 8));
|
|
}
|
|
pvVar5 = *(void **)&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(g_manager[1]._gamestate)) + 0x8dc)));
|
|
if ((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar5) + iVar7)) == iVar4) &&
|
|
(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar5) + iVar7 + 4)) == iVar3)) {
|
|
local_24 = *(void **)(GHIDRA_CAST<char *>(pvVar5) + iVar7 + 8);
|
|
}
|
|
iVar7 = iVar7 + 0x10;
|
|
entryCount = entryCount + -1;
|
|
local_2c = pvVar5;
|
|
} while (entryCount != 0);
|
|
peekResult = local_28;
|
|
if (local_24 == (void *)0x0) {
|
|
KAGE::Network::MultiplayerManager::request_user_profiles
|
|
(&DAT_00c79a60,&missingProfiles,pvVar5,game);
|
|
peekResult = missingProfilesCapacity;
|
|
}
|
|
if (missingProfiles != (void *)0x0) {
|
|
uVar2 = GHIDRA_INT(peekResult) - GHIDRA_INT(missingProfiles) & 0xfffffff8;
|
|
pvVar5 = missingProfiles;
|
|
if (0xfff < uVar2) {
|
|
pvVar5 = *(void **)(GHIDRA_CAST<char *>(missingProfiles) + -4);
|
|
uVar2 = uVar2 + 0x23;
|
|
if (0x1f < GHIDRA_UINT((GHIDRA_INT(missingProfiles) + (-4 - GHIDRA_INT(pvVar5))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(pvVar5,uVar2);
|
|
}
|
|
}
|
|
}
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(netplayManager[0x82d])) + 0x1)))) = *GHIDRA_CAST<uint32_t *>((netplayManager + 0x82c));
|
|
}
|
|
ExceptionList = local_1c;
|
|
return;
|
|
}
|
|
|
|
// 009128e0
|
|
void NetplayManager::update_lobby_stage_info()
|
|
{
|
|
uint8_t *puVar1;
|
|
char cVar2;
|
|
int ownerInfo;
|
|
void *message;
|
|
void *messageRefCount;
|
|
uint8_t auStack_62 [2];
|
|
uint8_t stageMessage [20];
|
|
uint8_t **local_40;
|
|
int *lobbyImpl;
|
|
int *lobbyRefCount;
|
|
uint8_t **local_34;
|
|
uint8_t **ownerProfile;
|
|
uint8_t *local_28;
|
|
uint8_t isLobbyOwner;
|
|
uint8_t *puStack_20;
|
|
void *local_1c;
|
|
uint8_t *puStack_18;
|
|
uint32_t local_14;
|
|
|
|
puStack_20 = stageMessage + 0x50;
|
|
puStack_18 = &LAB_00b0991d;
|
|
local_1c = ExceptionList;
|
|
ExceptionList = &local_1c;
|
|
local_40 = KAGE::Network::Multiplayer::ConstLobby::vftable;
|
|
lobbyImpl = GHIDRA_CAST<int *>(0x0);
|
|
lobbyRefCount = GHIDRA_CAST<int *>(0x0);
|
|
local_14 = 0;
|
|
(GHIDRA_CAST<msvc::shared_ptr *>((&lobbyImpl)))->msvc::shared_ptr::assign(&g_multiplayerLobbyPtr);
|
|
local_40 = KAGE::Network::Multiplayer::Lobby::vftable;
|
|
local_14 = 1;
|
|
if (lobbyImpl == GHIDRA_CAST<int *>(0x0)) {
|
|
local_28 = GHIDRA_CAST<uint8_t *>(0x0);
|
|
}
|
|
else {
|
|
ownerInfo = (**(code **)(*lobbyImpl + 0x20))();
|
|
local_28 = *GHIDRA_CAST<uint8_t **>((ownerInfo + 4));
|
|
local_34 = KAGE::System::UserProfileBase::vftable;
|
|
}
|
|
ownerProfile = KAGE::System::UserProfile::vftable;
|
|
local_14 = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))),2);
|
|
isLobbyOwner = (GHIDRA_CAST<KAGE::System::UserProfile *>((&ownerProfile)))->KAGE::System::UserProfile::is_local_user();
|
|
ownerProfile = KAGE::System::UserProfileBase::vftable;
|
|
local_40 = KAGE::Network::Multiplayer::ConstLobby::vftable;
|
|
local_14 = 3;
|
|
if (((lobbyRefCount != GHIDRA_CAST<int *>(0x0)) &&
|
|
(cVar2 = (**(code **)(*lobbyRefCount + 0xc))(), cVar2 != '\0')) &&
|
|
(g_lobbyReleaseFn != (void *)0x0)) {
|
|
(*g_lobbyReleaseFn)();
|
|
}
|
|
local_14 = 0xffffffff;
|
|
if (isLobbyOwner != 0) {
|
|
messageRefCount = *(void **)(this + 0x840);
|
|
message = (void *)0x9129f1;
|
|
FUN_009187f0();
|
|
local_28 = auStack_62 + -10;
|
|
puVar1 = auStack_62 + -10;
|
|
if (g_multiplayerService == (void *)0x0) {
|
|
KAGE_LogMessage(0x10,(uint8_t *)
|
|
"Attempting to create a message when there is no multiplayer service\n");
|
|
puVar1 = local_28;
|
|
}
|
|
local_28 = puVar1;
|
|
NetConnection::send_message(g_multiplayerService,auStack_62 + -10,1,stageMessage,0x14,0);
|
|
send_message(this,2,message,messageRefCount);
|
|
local_40 = KAGE::Network::Multiplayer::ConstLobby::vftable;
|
|
lobbyImpl = GHIDRA_CAST<int *>(0x0);
|
|
lobbyRefCount = GHIDRA_CAST<int *>(0x0);
|
|
local_14 = 4;
|
|
(GHIDRA_CAST<msvc::shared_ptr *>((&lobbyImpl)))->msvc::shared_ptr::assign(&g_multiplayerLobbyPtr);
|
|
local_40 = KAGE::Network::Multiplayer::Lobby::vftable;
|
|
local_14 = 5;
|
|
if (lobbyImpl != GHIDRA_CAST<int *>(0x0)) {
|
|
(**(code **)(*lobbyImpl + 0x24))();
|
|
}
|
|
local_40 = KAGE::Network::Multiplayer::ConstLobby::vftable;
|
|
local_14 = 6;
|
|
if (((lobbyRefCount != GHIDRA_CAST<int *>(0x0)) &&
|
|
(cVar2 = (**(code **)(*lobbyRefCount + 0xc))(), cVar2 != '\0')) &&
|
|
(g_lobbyReleaseFn != (void *)0x0)) {
|
|
(*g_lobbyReleaseFn)();
|
|
}
|
|
local_40 = KAGE::Network::Multiplayer::ConstLobby::vftable;
|
|
lobbyImpl = GHIDRA_CAST<int *>(0x0);
|
|
lobbyRefCount = GHIDRA_CAST<int *>(0x0);
|
|
local_14 = 7;
|
|
(GHIDRA_CAST<msvc::shared_ptr *>((&lobbyImpl)))->msvc::shared_ptr::assign(&g_multiplayerLobbyPtr);
|
|
local_40 = KAGE::Network::Multiplayer::Lobby::vftable;
|
|
local_14 = 8;
|
|
if (lobbyImpl != GHIDRA_CAST<int *>(0x0)) {
|
|
(**(code **)(*lobbyImpl + 0x24))();
|
|
}
|
|
local_40 = KAGE::Network::Multiplayer::ConstLobby::vftable;
|
|
local_14 = 9;
|
|
if (((lobbyRefCount != GHIDRA_CAST<int *>(0x0)) &&
|
|
(cVar2 = (**(code **)(*lobbyRefCount + 0xc))(), cVar2 != '\0')) &&
|
|
(g_lobbyReleaseFn != (void *)0x0)) {
|
|
(*g_lobbyReleaseFn)();
|
|
}
|
|
}
|
|
ExceptionList = local_1c;
|
|
return;
|
|
}
|
|
|
|
// 00916110
|
|
void NetplayManager::send_remove_frame(uint32_t param_1, uint32_t param_2)
|
|
{
|
|
uint32_t uVar1;
|
|
uint32_t uVar2;
|
|
uint32_t uVar3;
|
|
char isLastRef;
|
|
uint32_t uVar4;
|
|
uint32_t *entriesEnd;
|
|
uint32_t *entriesCapacity;
|
|
void *pvVar5;
|
|
Entity_Player *message;
|
|
uint8_t *messageRefCount;
|
|
uint8_t **local_80;
|
|
void *local_7c;
|
|
uint32_t local_78;
|
|
void *streamBuffer;
|
|
void *local_70;
|
|
void *streamHeapBuffer;
|
|
uint32_t local_64;
|
|
uint32_t local_60;
|
|
uint32_t local_5c;
|
|
uint8_t **streamWriter;
|
|
void *local_54;
|
|
uint32_t *local_50;
|
|
uint32_t *local_4c;
|
|
uint8_t netMessage [4];
|
|
int *netMessageRefCount;
|
|
uint32_t local_40;
|
|
Entity_Player *local_3c;
|
|
uint32_t *local_34;
|
|
float local_30;
|
|
void *local_2c;
|
|
uint32_t *local_28;
|
|
uint8_t entryCountByte;
|
|
uint8_t *puStack_20;
|
|
void *local_1c;
|
|
uint8_t *puStack_18;
|
|
uint32_t local_14;
|
|
Manager *manager;
|
|
|
|
puStack_20 = netMessage + 0x44;
|
|
local_14 = 0xffffffff;
|
|
puStack_18 = &LAB_00b09c8d;
|
|
local_1c = ExceptionList;
|
|
uVar4 = __security_cookie ^ GHIDRA_UINT((netMessage + 0x38));
|
|
ExceptionList = &local_1c;
|
|
(GHIDRA_CAST<KAGE::Filesys::BufferedStream *>((&local_80)))->KAGE::Filesys::BufferedStream::BufferedStream(0);
|
|
local_14 = 0;
|
|
local_34 = GHIDRA_CAST<uint32_t *>(0x0);
|
|
(*(code *)streamWriter[7])(&local_34,4,1,uVar4);
|
|
local_3c = GHIDRA_CAST<Entity_Player *>(param_2);
|
|
local_40 = param_1;
|
|
(*(code *)streamWriter[7])(&local_40,8,1);
|
|
(*(code *)streamWriter[7])(&local_34,4,1);
|
|
local_3c = PlayerManager::get_player_by_user_id
|
|
(GHIDRA_CAST<PlayerManager *>(&g_manager->_netplayManager),GHIDRA_CAST<uint64_t *>(¶m_1));
|
|
entriesCapacity = GHIDRA_CAST<uint32_t *>(0x0);
|
|
local_2c = (void *)0x0;
|
|
entriesEnd = GHIDRA_CAST<uint32_t *>(0x0);
|
|
local_54 = (void *)0x0;
|
|
local_50 = GHIDRA_CAST<uint32_t *>(0x0);
|
|
local_34 = GHIDRA_CAST<uint32_t *>(0x0);
|
|
local_4c = GHIDRA_CAST<uint32_t *>(0x0);
|
|
local_14 = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))),1);
|
|
if ((local_3c != GHIDRA_CAST<Entity_Player *>(0x0)) &&
|
|
(local_30 = *GHIDRA_CAST<float *>(local_3c->_slowingAmount),
|
|
GHIDRA_CAST<int *>(local_30) != GHIDRA_CAST<int *>(local_3c->_slowingAmount))) {
|
|
do {
|
|
if (entriesEnd == entriesCapacity) {
|
|
msvc::vector<16byte>::_Emplace_reallocate(entriesEnd,GHIDRA_CAST<uint32_t *>((GHIDRA_INT(local_30) + 0x14)));
|
|
local_28 = local_50;
|
|
entriesCapacity = local_4c;
|
|
}
|
|
else {
|
|
uVar1 = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(local_30) + 0x18));
|
|
uVar2 = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(local_30) + 0x1c));
|
|
uVar3 = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(local_30) + 0x20));
|
|
*entriesEnd = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(local_30) + 0x14));
|
|
entriesEnd[1] = uVar1;
|
|
entriesEnd[2] = uVar2;
|
|
entriesEnd[3] = uVar3;
|
|
local_28 = entriesEnd + 4;
|
|
}
|
|
local_50 = local_28;
|
|
msvc::
|
|
_Tree_unchecked_const_iterator<msvc::_Tree_val<msvc::_Tree_simple_types<unsigned_int>_>,msvc::_Iterator_base0>
|
|
::operator++((_Tree_unchecked_const_iterator<msvc::_Tree_val<msvc::_Tree_simple_types<unsigned_int>_>,msvc::_Iterator_base0>
|
|
*)&local_30);
|
|
entriesEnd = local_28;
|
|
} while (local_30 != local_3c->_slowingAmount);
|
|
local_2c = local_54;
|
|
local_34 = entriesCapacity;
|
|
}
|
|
entriesCapacity = local_34;
|
|
local_28 = GHIDRA_CAST<uint32_t *>((GHIDRA_INT(entriesEnd) - GHIDRA_INT(local_2c) >> 4));
|
|
entryCountByte = SUB41(local_28,0);
|
|
local_54 = local_2c;
|
|
(*(code *)streamWriter[7])(&entryCountByte,1,1);
|
|
entriesEnd = local_28;
|
|
local_30 = 0.0;
|
|
if (local_28 != GHIDRA_CAST<uint32_t *>(0x0)) {
|
|
pvVar5 = local_2c;
|
|
do {
|
|
buffered_stream_write(&streamWriter,pvVar5,0x10,1);
|
|
pvVar5 = (void *)(GHIDRA_INT(pvVar5) + 0x10);
|
|
local_30 = (float)(GHIDRA_INT(local_30) + 1);
|
|
} while (GHIDRA_UINT(local_30) < entriesEnd);
|
|
entriesCapacity = local_34;
|
|
}
|
|
local_3c = local_7c;
|
|
pvVar5 = streamBuffer;
|
|
if (streamHeapBuffer != (void *)0x0) {
|
|
pvVar5 = streamHeapBuffer;
|
|
}
|
|
if (g_multiplayerService == (void *)0x0) {
|
|
KAGE_LogMessage(0x10,(uint8_t *)
|
|
"Attempting to create a message when there is no multiplayer service\n");
|
|
}
|
|
messageRefCount = &DAT_00000006;
|
|
message = local_3c;
|
|
NetConnection::send_message(g_multiplayerService,netMessage,1,pvVar5,GHIDRA_UINT(local_3c),6);
|
|
manager = g_manager;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 2;
|
|
FUN_008ef1d0(netMessage);
|
|
send_message(GHIDRA_CAST<NetplayManager *>(&manager->_netplayManager),8,message,messageRefCount);
|
|
local_14 = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))),3);
|
|
if (((netMessageRefCount != GHIDRA_CAST<int *>(0x0)) &&
|
|
(isLastRef = (**(code **)(*netMessageRefCount + 0xc))(), isLastRef != '\0')) &&
|
|
(g_multiplayerRelease != (void *)0x0)) {
|
|
(*g_multiplayerRelease)(netMessage);
|
|
}
|
|
if (local_2c != (void *)0x0) {
|
|
uVar4 = GHIDRA_INT(entriesCapacity) - GHIDRA_INT(local_2c) & 0xfffffff0;
|
|
pvVar5 = local_2c;
|
|
if (0xfff < uVar4) {
|
|
pvVar5 = *(void **)(GHIDRA_CAST<char *>(local_2c) + -4);
|
|
uVar4 = uVar4 + 0x23;
|
|
if (0x1f < GHIDRA_UINT((GHIDRA_INT(local_2c) + (-4 - GHIDRA_INT(pvVar5))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(pvVar5,uVar4);
|
|
}
|
|
streamWriter = KAGE::Filesys::StreamBase::vftable;
|
|
local_80 = KAGE::Filesys::BufferedStreamBase::vftable;
|
|
local_7c = (void *)0x0;
|
|
local_78 = 0;
|
|
local_70 = streamBuffer;
|
|
streamHeapBuffer = (void *)0x0;
|
|
local_64 = 0;
|
|
local_60 = 0;
|
|
local_5c = 0;
|
|
FUN_007dcd30();
|
|
ExceptionList = local_1c;
|
|
return;
|
|
}
|
|
|
|
// 00916770
|
|
void NetplayManager::process_lobby_messages()
|
|
{
|
|
uint64_t *puVar1;
|
|
uint64_t *puVar2;
|
|
char cVar3;
|
|
int extraout_EAX;
|
|
void *member;
|
|
int *findResult;
|
|
int extraout_EAX_00;
|
|
uint32_t uVar4;
|
|
Manager *pMVar5;
|
|
int extraout_EAX_01;
|
|
int iVar6;
|
|
uint8_t *puVar7;
|
|
Manager *pMVar8;
|
|
uint8_t uStack_f0;
|
|
uint32_t uStack_e8;
|
|
void *pvStack_e4;
|
|
Manager *pMStack_e0;
|
|
void *pendingJoinNode;
|
|
uint8_t **stream;
|
|
int streamSize;
|
|
int local_d0;
|
|
void *local_cc;
|
|
int local_c8;
|
|
uint32_t local_c4;
|
|
void *streamData;
|
|
uint32_t local_bc;
|
|
uint32_t local_b8;
|
|
uint32_t local_b4;
|
|
uint8_t **streamVtable;
|
|
uint8_t **senderProfile [2];
|
|
uint64_t *local_a4;
|
|
int *messageRefCount;
|
|
Manager *pMStack_9c;
|
|
uint8_t replyMessage [4];
|
|
Manager *local_94;
|
|
Manager *senderIdLow;
|
|
Manager *senderIdHigh;
|
|
uint64_t uStack_88;
|
|
char *local_80;
|
|
uint8_t messageSubtype;
|
|
uint8_t saveData [84];
|
|
uint32_t stackCookie;
|
|
uint8_t *pbStack_20;
|
|
void *local_1c;
|
|
uint8_t *puStack_18;
|
|
uint8_t local_14 [4];
|
|
Manager *manager;
|
|
MenuManager *menuManager;
|
|
char *messageData;
|
|
|
|
pbStack_20 = local_14 + 0x10;
|
|
local_14[0] = 0xff;
|
|
local_14[1] = 0xff;
|
|
local_14[2] = 0xff;
|
|
local_14[3] = 0xff;
|
|
puStack_18 = &LAB_00b09d5f;
|
|
local_1c = ExceptionList;
|
|
stackCookie = __security_cookie ^ GHIDRA_UINT((local_14 + 4));
|
|
ExceptionList = &local_1c;
|
|
cVar3 = FUN_00a29b10(0);
|
|
if (cVar3 == '\0') {
|
|
ExceptionList = local_1c;
|
|
return;
|
|
}
|
|
if (g_multiplayerService == (void *)0x0) {
|
|
KAGE::SmartPointer<MessageData>::reset(0);
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<NetworkManager *>((g_multiplayerService)))->NetworkManager::receive_message(&local_a4,0,1);
|
|
}
|
|
puVar1 = local_a4;
|
|
local_14[0] = 0;
|
|
local_14[1] = 0;
|
|
local_14[2] = 0;
|
|
local_14[3] = 0;
|
|
senderIdLow = *GHIDRA_CAST<Manager **>(local_a4);
|
|
senderIdHigh = *GHIDRA_CAST<Manager **>((GHIDRA_CAST<char *>(local_a4) + 4));
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_a4) + 0xc)) != 1) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("This function should only be called on consolidated messages"));
|
|
}
|
|
puVar2 = local_a4;
|
|
local_80 = GHIDRA_CAST<char *>((*GHIDRA_CAST<int *>((**GHIDRA_CAST<int **>((puVar1 + 1)) + 0x14)) + 8));
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_a4) + 0xc)) != 1) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("This function should only be called on consolidated messages"));
|
|
}
|
|
puVar1 = local_a4;
|
|
iVar6 = *GHIDRA_CAST<int *>((**GHIDRA_CAST<int **>((puVar2 + 1)) + 0x18)) + -8;
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_a4) + 0xc)) != 1) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("This function should only be called on consolidated messages"));
|
|
}
|
|
pMVar8 = senderIdHigh;
|
|
streamData = (void *)(*GHIDRA_CAST<int *>((**GHIDRA_CAST<int **>((puVar1 + 1)) + 0x14)) + 8);
|
|
local_cc = (void *)0x0;
|
|
(*GHIDRA_CAST<uint16_t *>((GHIDRA_CAST<char *>(&(local_c4)) + 0x0))) = 0;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_c4)) + 0x2))) = 0;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_c4)) + 0x3))) = 0;
|
|
local_b4 = 0;
|
|
local_b8 = 0;
|
|
local_bc = 0;
|
|
local_c8 = 0;
|
|
stream = KAGE::Filesys::BufferedStream::vftable;
|
|
streamVtable = KAGE::Filesys::BufferedStream::vftable;
|
|
local_14[0] = 1;
|
|
local_94 = senderIdLow;
|
|
senderProfile[0] = KAGE::System::UserProfileBase::vftable;
|
|
streamSize = iVar6;
|
|
local_d0 = iVar6;
|
|
(GHIDRA_CAST<UserProfile *>((&senderIdLow)))->UserProfile::find_or_create();
|
|
local_14[0] = 2;
|
|
senderProfile[0] = KAGE::System::UserProfile::vftable;
|
|
if (((extraout_EAX != 0) && (*GHIDRA_CAST<int *>((extraout_EAX + 8)) != 0 || *GHIDRA_CAST<int *>((extraout_EAX + 0xc)) != 0)
|
|
) && (*GHIDRA_CAST<int *>((extraout_EAX + 0x14)) == 0)) {
|
|
(GHIDRA_CAST<KAGE::System::UserProfile *>((senderProfile)))->KAGE::System::UserProfile::load_steam_avatar();
|
|
}
|
|
local_14[0] = 3;
|
|
(*(code *)senderProfile[0][1])();
|
|
messageData = local_80;
|
|
pMVar5 = local_94;
|
|
KAGE_LogMessage(1,GHIDRA_CAST<uint8_t *>("[Frame %d] Received %s message from user %s [%llu]\n"));
|
|
menuManager = g_menuManager;
|
|
manager = g_manager;
|
|
local_14[0] = 1;
|
|
senderProfile[0] = KAGE::System::UserProfileBase::vftable;
|
|
switch(*messageData) {
|
|
case '\0':
|
|
if (g_menuManager == GHIDRA_CAST<MenuManager *>(0x0)) {
|
|
local_94 = g_manager;
|
|
for (member = (g_manager->_lobbyMembers)._begin; member != (g_manager->_lobbyMembers)._end;
|
|
member = (void *)(GHIDRA_INT(member) + 0x14)) {
|
|
iVar6 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(member) + 4));
|
|
if (iVar6 == 0) {
|
|
uStack_88 = 0;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(uStack_88)) + 0x4))) = GHIDRA_CAST<Manager *>(0x0);
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(uStack_88)) + 0x0))) = GHIDRA_CAST<Manager *>(0x0);
|
|
pMVar8 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(uStack_88)) + 0x4)));
|
|
pMVar5 = GHIDRA_CAST<Manager *>(uStack_88);
|
|
}
|
|
else {
|
|
pMVar8 = *GHIDRA_CAST<Manager **>((iVar6 + 0xc));
|
|
pMVar5 = *GHIDRA_CAST<Manager **>((iVar6 + 8));
|
|
}
|
|
if ((pMVar5 == senderIdLow) && (pMVar8 == senderIdHigh)) goto LAB_00916ee3;
|
|
}
|
|
puVar7 = &(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(g_manager[1]._gamestate)) + 0x8bc)));
|
|
findResult = GHIDRA_CAST<int *>(FUN_008fd870(&pMStack_9c,&senderIdLow));
|
|
if (*findResult == *GHIDRA_CAST<int *>(puVar7)) {
|
|
if ((local_80[1] & 2U) == 0) goto LAB_00916ee3;
|
|
KAGE_LogMessage(1,GHIDRA_CAST<uint8_t *>("[Frame %d] Adding pending join for player %llu \n"));
|
|
func_0x008e74a0();
|
|
local_14[0] = 4;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(uStack_88)) + 0x0))) = GHIDRA_CAST<Manager *>(KAGE)::System::UserProfileBase::vftable;
|
|
(GHIDRA_CAST<UserProfile *>((&senderIdLow)))->UserProfile::find_or_create();
|
|
local_14[0] = 5;
|
|
uStack_88 = CONCAT44(extraout_EAX_00,KAGE::System::UserProfile::vftable);
|
|
iVar6 = extraout_EAX_00;
|
|
if (((extraout_EAX_00 != 0) &&
|
|
(iVar6 = extraout_EAX_00,
|
|
*GHIDRA_CAST<int *>((extraout_EAX_00 + 8)) != 0 || *GHIDRA_CAST<int *>((extraout_EAX_00 + 0xc)) != 0)) &&
|
|
(iVar6 = extraout_EAX_00, *GHIDRA_CAST<int *>((extraout_EAX_00 + 0x14)) == 0)) {
|
|
(GHIDRA_CAST<KAGE::System::UserProfile *>((&uStack_88)))->KAGE::System::UserProfile::load_steam_avatar();
|
|
iVar6 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_INT(uStack_88))) + 0x4)));
|
|
}
|
|
local_14[0] = 4;
|
|
uVar4 = FUN_00949b90();
|
|
pMVar8 = GHIDRA_CAST<Manager *>(&senderIdLow);
|
|
pMVar5 = GHIDRA_CAST<Manager *>(&pvStack_e4);
|
|
FUN_00731ee0(pMVar5,pMVar8);
|
|
if (((*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(pendingJoinNode) + 0xd)) != '\0') ||
|
|
(senderIdHigh < *GHIDRA_CAST<Manager **>((GHIDRA_CAST<char *>(pendingJoinNode) + 0x14)))) ||
|
|
((senderIdHigh <= *GHIDRA_CAST<Manager **>((GHIDRA_CAST<char *>(pendingJoinNode) + 0x14)) &&
|
|
(senderIdLow < *GHIDRA_CAST<Manager **>((GHIDRA_CAST<char *>(pendingJoinNode) + 0x10)))))) {
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(manager[1]._gamestate)) + 0x8c0)))) == 0x5555555) {
|
|
/* WARNING: Subroutine does not return */
|
|
FUN_004170d0();
|
|
}
|
|
pMVar5 = *GHIDRA_CAST<Manager **>(puVar7);
|
|
local_14[0] = 6;
|
|
uStack_88 = ZEXT48(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_94[1]._gamestate)) + 0x8bc))));
|
|
pMVar8 = operator_new(0x30);
|
|
pMVar8->_currentSaveSlot = GHIDRA_INT(senderIdLow);
|
|
*GHIDRA_CAST<Manager **>(&pMVar8->_persistentGameData) = senderIdHigh;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((pMVar8->_persistentGameData))) + 0x8)))) = 0;
|
|
(pMVar8->_persistentGameData)._saveFile = KAGE::System::UserProfile::vftable;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((pMVar8->_persistentGameData))) + 0xc))) = 0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((pMVar8->_persistentGameData))) + 0x10)))) = 0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((pMVar8->_persistentGameData))) + 0x14)))) = 5;
|
|
*GHIDRA_CAST<Manager **>(pMVar8) = pMVar5;
|
|
*GHIDRA_CAST<Manager **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((pMVar8)) + 0x4)))) = pMVar5;
|
|
*GHIDRA_CAST<Manager **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((pMVar8)) + 0x8)))) = pMVar5;
|
|
*GHIDRA_CAST<uint16_t *>(&pMVar8->_previousState) = 0;
|
|
pendingJoinNode =
|
|
msvc::_Tree::_Insert_node
|
|
(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_94[1]._gamestate)) + 0x8bc))),pvStack_e4,GHIDRA_INT(pMStack_e0),pMVar8);
|
|
pMVar5 = pMStack_e0;
|
|
}
|
|
*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(pendingJoinNode) + 0x20)) = uStack_f0;
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pendingJoinNode) + 0x1c)) = iVar6;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(pendingJoinNode) + 0x24)) = uVar4;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(pendingJoinNode) + 0x28)) = uStack_e8;
|
|
local_14[0] = 1;
|
|
}
|
|
else {
|
|
if ((local_80[1] & 2U) != 0) goto LAB_00916ee3;
|
|
pMVar8 = GHIDRA_CAST<Manager *>(&senderIdLow);
|
|
pMVar5 = GHIDRA_CAST<Manager *>(0x916a2f);
|
|
FUN_00913c80(pMVar8);
|
|
}
|
|
break;
|
|
}
|
|
goto LAB_00916ec7;
|
|
case '\x02':
|
|
FUN_009193b0();
|
|
local_14[0] = 7;
|
|
messageSubtype = 0;
|
|
if ((code *)streamVtable[5] == memory_stream_read) {
|
|
(GHIDRA_CAST<KAGE::Filesys::BufferedStream *>((&stream)))->KAGE::Filesys::BufferedStream::read(&messageSubtype,1,1);
|
|
}
|
|
else {
|
|
(*(code *)streamVtable[5])(&messageSubtype);
|
|
}
|
|
if (messageSubtype != 2) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("Specified data is not a report save data message\n"));
|
|
}
|
|
local_80 = GHIDRA_CAST<char *>(0x0);
|
|
if ((code *)streamVtable[5] == memory_stream_read) {
|
|
(GHIDRA_CAST<KAGE::Filesys::BufferedStream *>((&stream)))->KAGE::Filesys::BufferedStream::read(&local_80,4,1);
|
|
}
|
|
else {
|
|
(*(code *)streamVtable[5])(&local_80);
|
|
}
|
|
if ((code *)streamVtable[2] != FUN_00a58260) {
|
|
(*(code *)streamVtable[2])();
|
|
}
|
|
FUN_0091ad50(saveData);
|
|
uStack_88 = *local_a4;
|
|
pMVar5 = GHIDRA_CAST<Manager *>(&uStack_88);
|
|
FUN_0090c2d0(pMVar5,saveData);
|
|
local_14[0] = 1;
|
|
pMVar8 = GHIDRA_CAST<Manager *>(0x916cbb);
|
|
FUN_00a58200();
|
|
break;
|
|
case '\x03':
|
|
pMVar5 = GHIDRA_CAST<Manager *>((**(code **)(*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(g_manager[1]._gamestate)) + 0x6c)))) + 4))());
|
|
iVar6 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(manager[1]._gamestate)) + 0x5c))));
|
|
if (iVar6 == 0) {
|
|
iVar6 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(manager[1]._gamestate)) + 0x50))));
|
|
}
|
|
FUN_00a296e0(replyMessage,1,iVar6,pMVar5,0);
|
|
local_14[0] = 8;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(uStack_88)) + 0x0))) = GHIDRA_CAST<Manager *>(KAGE)::System::UserProfileBase::vftable;
|
|
puVar7 = GHIDRA_CAST<uint8_t *>(0x916d0c);
|
|
(GHIDRA_CAST<UserProfile *>((&senderIdLow)))->UserProfile::find_or_create();
|
|
local_14[0] = 9;
|
|
uStack_88 = CONCAT44(extraout_EAX_01,KAGE::System::UserProfile::vftable);
|
|
if (((extraout_EAX_01 != 0) &&
|
|
(*GHIDRA_CAST<int *>((extraout_EAX_01 + 8)) != 0 || *GHIDRA_CAST<int *>((extraout_EAX_01 + 0xc)) != 0)) &&
|
|
(*GHIDRA_CAST<int *>((extraout_EAX_01 + 0x14)) == 0)) {
|
|
puVar7 = &LAB_00916d34;
|
|
(GHIDRA_CAST<KAGE::System::UserProfile *>((&uStack_88)))->KAGE::System::UserProfile::load_steam_avatar();
|
|
}
|
|
local_14[0] = 10;
|
|
FUN_008ef1d0(replyMessage);
|
|
multiplayer_send_message(&uStack_88,pMVar5,puVar7);
|
|
local_14[0] = 1;
|
|
pMVar8 = GHIDRA_CAST<Manager *>(0x916d61);
|
|
FUN_00708d40();
|
|
break;
|
|
case '\x04':
|
|
case '\x05':
|
|
pMStack_9c = GHIDRA_CAST<Manager *>(CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(pMStack_9c)) + 0x1))),*messageData == '\x04'));
|
|
if (g_menuManager == GHIDRA_CAST<MenuManager *>(0x0)) {
|
|
pMVar5 = GHIDRA_CAST<Manager *>(&stream);
|
|
pMVar8 = pMStack_9c;
|
|
FUN_0090ca40(pMVar5,pMStack_9c);
|
|
}
|
|
else {
|
|
KAGE_LogMessage(1,GHIDRA_CAST<uint8_t *>("Menu_OnlineLobby::notify_game_start() \n"));
|
|
puVar7 = &(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((menuManager)) + 0xe370)));
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((menuManager)) + 0xe3b0))) = 1;
|
|
if (*GHIDRA_CAST<int *>(puVar7) != -1) {
|
|
local_80 = GHIDRA_CAST<char *>(0xffffffff);
|
|
(GHIDRA_CAST<PopupManager *>((&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(g_manager[1]._gamestate)) + 0xcf0))))))->PopupManager::close(GHIDRA_CAST<int *>(puVar7),GHIDRA_CAST<int *>(&local_80));
|
|
*GHIDRA_CAST<uint32_t *>(puVar7) = 0xffffffff;
|
|
}
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((menuManager)) + 0xe374)))) != -1) {
|
|
local_94 = GHIDRA_CAST<Manager *>(0xffffffff);
|
|
(GHIDRA_CAST<PopupManager *>((&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(g_manager[1]._gamestate)) + 0xcf0))))))->PopupManager::close(GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((menuManager)) + 0xe374)))),
|
|
GHIDRA_CAST<int *>(&local_94));
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((menuManager)) + 0xe374)))) = 0xffffffff;
|
|
}
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((menuManager)) + 0xe378)))) != -1) {
|
|
pMStack_9c = GHIDRA_CAST<Manager *>(0xffffffff);
|
|
(GHIDRA_CAST<PopupManager *>((&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(g_manager[1]._gamestate)) + 0xcf0))))))->PopupManager::close(GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((menuManager)) + 0xe378)))),
|
|
GHIDRA_CAST<int *>(&pMStack_9c));
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((menuManager)) + 0xe378)))) = 0xffffffff;
|
|
}
|
|
FUN_0090ca40(&stream,1);
|
|
DAT_00c7ac68 = 1;
|
|
(GHIDRA_CAST<Menu_Character *>((&g_menuManager->_menuCharacter)))->Menu_Character::Reset();
|
|
iVar6 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((menuManager)) + 0xe37c))));
|
|
pMVar5 = GHIDRA_CAST<Manager *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((menuManager)) + 0xe37c))));
|
|
DAT_00c7ac68 = 0;
|
|
pMVar8 = *GHIDRA_CAST<Manager **>((iVar6 + 4));
|
|
FUN_008ef400(pMVar5,pMVar8);
|
|
*GHIDRA_CAST<int *>((iVar6 + 4)) = iVar6;
|
|
*GHIDRA_CAST<int *>(iVar6) = iVar6;
|
|
*GHIDRA_CAST<int *>((iVar6 + 8)) = iVar6;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((menuManager)) + 0xe380)))) = 0;
|
|
}
|
|
break;
|
|
case '\a':
|
|
pMVar8 = GHIDRA_CAST<Manager *>(0x916ebd);
|
|
read_player_game_states_message(GHIDRA_CAST<NetplayManager *>(&stream));
|
|
}
|
|
if (g_menuManager != GHIDRA_CAST<MenuManager *>(0x0)) {
|
|
LAB_00916ec7:
|
|
FUN_008ef1d0(&local_a4);
|
|
FUN_008ea6e0(pMVar5,pMVar8);
|
|
}
|
|
LAB_00916ee3:
|
|
FUN_00a58200();
|
|
local_14[0] = 0xb;
|
|
local_14[1] = 0;
|
|
local_14[2] = 0;
|
|
local_14[3] = 0;
|
|
if (((messageRefCount != GHIDRA_CAST<int *>(0x0)) &&
|
|
(cVar3 = (**(code **)(*messageRefCount + 0xc))(), cVar3 != '\0')) &&
|
|
(g_multiplayerRelease != (void *)0x0)) {
|
|
(*g_multiplayerRelease)(&local_a4);
|
|
}
|
|
ExceptionList = local_1c;
|
|
return;
|
|
}
|
|
|
|
// 00917a50
|
|
void NetplayManager::load_game_start_packet(void *message, void *netplayState)
|
|
{
|
|
int *piVar1;
|
|
uint8_t *puVar2;
|
|
KColor fadeColor;
|
|
Manager *pMVar3;
|
|
uint32_t *member;
|
|
int extraout_EAX;
|
|
void *treeHead;
|
|
std_vector *lobbyMembers;
|
|
uint32_t i;
|
|
void **ppvVar4;
|
|
bool bVar5;
|
|
uint8_t isCustomRun;
|
|
uint32_t local_ec;
|
|
uint32_t local_e8;
|
|
uint8_t **profile;
|
|
uint32_t local_dc;
|
|
uint8_t local_d8;
|
|
int local_d4;
|
|
uint32_t local_d0;
|
|
uint64_t entryCount;
|
|
void *local_c0;
|
|
uint32_t entryCountHigh;
|
|
void *local_b8;
|
|
uint64_t local_b4;
|
|
int challenge;
|
|
uint64_t local_a4;
|
|
uint64_t entry;
|
|
uint8_t **tmpProfile;
|
|
uint32_t local_8c;
|
|
uint32_t local_88;
|
|
int local_84;
|
|
uint8_t isCustomRunSaved [13];
|
|
uint32_t local_70;
|
|
int local_6c;
|
|
uint64_t local_68;
|
|
int local_60;
|
|
void *local_20;
|
|
int local_1c;
|
|
uint32_t local_14;
|
|
void *local_10;
|
|
uint8_t *puStack_c;
|
|
int local_8;
|
|
Manager *manager;
|
|
uint32_t *vecEnd;
|
|
|
|
manager = g_manager;
|
|
local_8 = 0xffffffff;
|
|
puStack_c = &LAB_00b09e13;
|
|
local_10 = ExceptionList;
|
|
local_14 = __security_cookie ^ GHIDRA_UINT((GHIDRA_INT(isCustomRunSaved) + 0x79U));
|
|
ExceptionList = &local_10;
|
|
piVar1 = GHIDRA_CAST<int *>((GHIDRA_INT(message) + 0x28));
|
|
isCustomRunSaved[8] = 0;
|
|
lobbyMembers = &g_manager->_lobbyMembers;
|
|
local_c0 = message;
|
|
local_b8 = netplayState;
|
|
(**(code **)(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(message) + 0x28)) + 0x14))
|
|
(GHIDRA_CAST<uint8_t *>((GHIDRA_INT(isCustomRunSaved) + 8)),1,1,local_14);
|
|
vecEnd = (manager->_lobbyMembers)._end;
|
|
member = lobbyMembers->_begin;
|
|
if (member != vecEnd) {
|
|
do {
|
|
*member = KAGE::System::UserProfileBase::vftable;
|
|
member = member + 5;
|
|
} while (member != vecEnd);
|
|
member = lobbyMembers->_begin;
|
|
}
|
|
(manager->_lobbyMembers)._end = member;
|
|
for ((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(isCustomRunSaved)) + 0x1))) = ZEXT14(isCustomRunSaved[8]); (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(isCustomRunSaved)) + 0x1))) != 0;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(isCustomRunSaved)) + 0x1))) = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(isCustomRunSaved)) + 0x1))) - 1) {
|
|
local_dc = 0;
|
|
profile = KAGE::System::UserProfile::vftable;
|
|
local_d8 = 0;
|
|
local_d4 = 0;
|
|
local_d0 = 5;
|
|
local_8 = 0;
|
|
local_b4 = 0;
|
|
(**(code **)(*piVar1 + 0x14))(&local_b4,8,1);
|
|
local_a4 = local_b4;
|
|
tmpProfile = KAGE::System::UserProfileBase::vftable;
|
|
(GHIDRA_CAST<UserProfile *>((&local_a4)))->UserProfile::find_or_create();
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 1;
|
|
tmpProfile = KAGE::System::UserProfile::vftable;
|
|
local_8c = extraout_EAX;
|
|
if (((extraout_EAX != 0) &&
|
|
(*GHIDRA_CAST<int *>((extraout_EAX + 8)) != 0 || *GHIDRA_CAST<int *>((extraout_EAX + 0xc)) != 0)) &&
|
|
(*GHIDRA_CAST<int *>((extraout_EAX + 0x14)) == 0)) {
|
|
(GHIDRA_CAST<KAGE::System::UserProfile *>((&tmpProfile)))->KAGE::System::UserProfile::load_steam_avatar();
|
|
}
|
|
local_8 = (*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(local_8))) + 0x1))) << 8;
|
|
tmpProfile = KAGE::System::UserProfileBase::vftable;
|
|
local_84 = 0;
|
|
(**(code **)(*piVar1 + 0x14))(&local_84,4,1);
|
|
local_d4 = local_84;
|
|
isCustomRunSaved[8] = 0;
|
|
(**(code **)(*piVar1 + 0x14))(GHIDRA_CAST<uint8_t *>((GHIDRA_INT(isCustomRunSaved) + 8)),1,1);
|
|
local_d8 = isCustomRunSaved[8];
|
|
local_88 = 0;
|
|
(**(code **)(*piVar1 + 0x14))(&local_88,4,1);
|
|
vecEnd = (manager->_lobbyMembers)._end;
|
|
local_d0 = local_88;
|
|
if (vecEnd == (manager->_lobbyMembers)._capacity) {
|
|
FUN_008ef230(vecEnd,&profile);
|
|
}
|
|
else {
|
|
*GHIDRA_CAST<uint8_t *>((vecEnd + 2)) = isCustomRunSaved[8];
|
|
vecEnd[1] = local_8c;
|
|
*vecEnd = KAGE::System::UserProfile::vftable;
|
|
vecEnd[3] = local_84;
|
|
vecEnd[4] = local_88;
|
|
ppvVar4 = &(manager->_lobbyMembers)._end;
|
|
*ppvVar4 = (void *)(GHIDRA_INT(*ppvVar4) + 0x14);
|
|
}
|
|
local_8 = 0xffffffff;
|
|
}
|
|
local_88 = 0;
|
|
(**(code **)(*piVar1 + 0x14))(&local_88,4,1);
|
|
isCustomRunSaved[8] = 0;
|
|
(**(code **)(*piVar1 + 0x14))(GHIDRA_CAST<uint8_t *>((GHIDRA_INT(isCustomRunSaved) + 8)),1,1);
|
|
isCustomRun = isCustomRunSaved[8] != 0;
|
|
local_84 = 0;
|
|
isCustomRunSaved[0] = isCustomRun;
|
|
(**(code **)(*piVar1 + 0x14))(&local_84,4,1);
|
|
isCustomRunSaved[8] = 0;
|
|
(**(code **)(*piVar1 + 0x14))(GHIDRA_CAST<uint8_t *>((GHIDRA_INT(isCustomRunSaved) + 8)),1,1);
|
|
local_8c = GHIDRA_UINT(isCustomRunSaved[8]);
|
|
challenge = 0;
|
|
(**(code **)(*piVar1 + 0x14))(&challenge,4,1);
|
|
local_a4 = 0;
|
|
(**(code **)(*piVar1 + 0x14))(&local_a4,8,1);
|
|
entryCount = 0;
|
|
(**(code **)(*piVar1 + 0x14))(&entryCount,8,1);
|
|
local_b4 = CONCAT44(GHIDRA_INT(entryCount),(uint32_t)local_b4);
|
|
entryCountHigh = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(entryCount)) + 0x4)));
|
|
entry = 0;
|
|
if (((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(entryCount)) + 0x4))) != 0) || (GHIDRA_INT(entryCount) != 0)) {
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(entry)) + 0x0))) = 0;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(isCustomRunSaved)) + 0x1))) = 0;
|
|
i = GHIDRA_UINT(entry);
|
|
do {
|
|
manager = g_manager;
|
|
entry = 0;
|
|
(**(code **)(*piVar1 + 0x14))(&entry,8,1);
|
|
vecEnd = *GHIDRA_CAST<uint32_t **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(manager[1]._persistentGameData)) + 0x30))));
|
|
local_ec = GHIDRA_UINT(entry);
|
|
local_e8 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(entry)) + 0x4)));
|
|
if (vecEnd == *GHIDRA_CAST<uint32_t **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(manager[1]._persistentGameData)) + 0x34))))) {
|
|
msvc::vector<8byte>::_Emplace_reallocate(vecEnd,&local_ec);
|
|
}
|
|
else {
|
|
*vecEnd = GHIDRA_UINT(entry);
|
|
vecEnd[1] = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(entry)) + 0x4)));
|
|
puVar2 = &(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(manager[1]._persistentGameData)) + 0x30)));
|
|
*GHIDRA_CAST<int *>(puVar2) = *GHIDRA_CAST<int *>(puVar2) + 8;
|
|
}
|
|
bVar5 = 0xfffffffe < i;
|
|
i = i + 1;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(isCustomRunSaved)) + 0x1))) = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(isCustomRunSaved)) + 0x1))) + GHIDRA_UINT(bVar5);
|
|
} while (((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(isCustomRunSaved))) + 0x1))) < entryCountHigh) ||
|
|
(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(isCustomRunSaved))) + 0x1))) <= entryCountHigh && (i < (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_b4)) + 0x4)))))));
|
|
isCustomRun = isCustomRunSaved[0];
|
|
}
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(isCustomRunSaved)) + 0x1))) = 0;
|
|
(**(code **)(*piVar1 + 0x14))(GHIDRA_CAST<uint32_t *>((GHIDRA_INT(isCustomRunSaved) + 1)),4,1);
|
|
(**(code **)(*piVar1 + 8))(local_b8);
|
|
FUN_0091ad50();
|
|
local_6c = -0x55e8beb1;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_68)) + 0x0))) = 5;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_68)) + 0x4))) = 9;
|
|
local_60 = 7;
|
|
local_20 = (void *)0x0;
|
|
local_1c = 0;
|
|
treeHead = operator_new(0x14);
|
|
*(void **)treeHead = treeHead;
|
|
*(void **)(GHIDRA_CAST<char *>(treeHead) + 4) = treeHead;
|
|
*(void **)(GHIDRA_CAST<char *>(treeHead) + 8) = treeHead;
|
|
*GHIDRA_CAST<uint16_t *>((GHIDRA_CAST<char *>(treeHead) + 0xc)) = 0x101;
|
|
local_70 = 0;
|
|
isCustomRunSaved[9] = 0;
|
|
local_20 = treeHead;
|
|
FID_conflict__Erase_tree<fuzzer::fuzzer_allocator<msvc::_Tree_node<fuzzer::TracePC::PCTableEntry_const*,void*>_>_>
|
|
(&local_20,(fuzzer_allocator<msvc::_Tree_node<unsigned_int,void*>_> *)&local_20,
|
|
*(_Tree_node<unsigned_int,void*> **)(GHIDRA_INT(treeHead) + 4));
|
|
*(void **)(GHIDRA_CAST<char *>(treeHead) + 4) = treeHead;
|
|
*(void **)treeHead = treeHead;
|
|
*(void **)(GHIDRA_CAST<char *>(treeHead) + 8) = treeHead;
|
|
local_1c = 0;
|
|
local_8 = 2;
|
|
(GHIDRA_CAST<Seeds *>((GHIDRA_CAST<Seeds *>((GHIDRA_INT(isCustomRunSaved) + 9)))))->Seeds::set_start_seed(local_88);
|
|
isCustomRunSaved[9] = isCustomRun;
|
|
(GHIDRA_CAST<Seeds *>((&g_manager->_startSeeds)))->Seeds::operator_assign(GHIDRA_CAST<Seeds *>((GHIDRA_INT(isCustomRunSaved) + 9)));
|
|
manager = g_manager;
|
|
ppvVar4 = &(g_manager->_startSeeds)._seedEffects;
|
|
treeHead = *ppvVar4;
|
|
FID_conflict__Erase_tree<fuzzer::fuzzer_allocator<msvc::_Tree_node<fuzzer::TracePC::PCTableEntry_const*,void*>_>_>
|
|
(ppvVar4,(fuzzer_allocator<msvc::_Tree_node<unsigned_int,void*>_> *)ppvVar4,
|
|
*(_Tree_node<unsigned_int,void*> **)(GHIDRA_INT(treeHead) + 4));
|
|
pMVar3 = g_manager;
|
|
*(void **)(GHIDRA_CAST<char *>(treeHead) + 4) = treeHead;
|
|
*(void **)treeHead = treeHead;
|
|
*(void **)(GHIDRA_CAST<char *>(treeHead) + 8) = treeHead;
|
|
(manager->_startSeeds)._seedEffectsCount = 0;
|
|
(GHIDRA_CAST<Seeds *>((&pMVar3->_startSeeds)))->Seeds::AddSeedEffect(local_84);
|
|
manager = g_manager;
|
|
g_manager->_startDifficulty = local_8c;
|
|
manager->_startChallenge = challenge;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(manager[1]._persistentGameData)) + 0xc)))) = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_a4)) + 0x4)));
|
|
manager->_rerunAvailable = 0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(manager[1]._persistentGameData)) + 0x8)))) = (uint32_t)local_a4;
|
|
reset(GHIDRA_CAST<NetplayManager *>(&manager->_netplayManager),0);
|
|
if (g_menuManager == GHIDRA_CAST<MenuManager *>(0x0)) {
|
|
g_manager->_starting = 1;
|
|
}
|
|
else {
|
|
fadeColor._alpha = 1.0;
|
|
fadeColor._red = 0.0;
|
|
fadeColor._green = 0.0;
|
|
fadeColor._blue = 0.0;
|
|
fadeColor._unk = 0;
|
|
MenuManager::start_game(fadeColor);
|
|
}
|
|
FID_conflict__Erase_tree<fuzzer::fuzzer_allocator<msvc::_Tree_node<fuzzer::TracePC::PCTableEntry_const*,void*>_>_>
|
|
(&local_20,(fuzzer_allocator<msvc::_Tree_node<unsigned_int,void*>_> *)&local_20,
|
|
*(_Tree_node<unsigned_int,void*> **)(GHIDRA_INT(local_20) + 4));
|
|
operator_delete(local_20,0x14);
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 00918870
|
|
void NetplayManager::write_player_game_states_message()
|
|
{
|
|
uint64_t qVar1;
|
|
uint32_t uVar2;
|
|
int iVar3;
|
|
int iVar4;
|
|
int iVar5;
|
|
int iVar6;
|
|
void *pvVar7;
|
|
uint32_t compressedSize;
|
|
int extraout_ECX;
|
|
uint32_t extraout_ECX_00;
|
|
uint64_t *allocCounter;
|
|
int *piVar8;
|
|
uint32_t totalSize;
|
|
uint8_t **stream;
|
|
int *streamSize;
|
|
uint32_t local_50;
|
|
int local_4c;
|
|
int local_48;
|
|
int local_44;
|
|
int local_40;
|
|
uint32_t local_3c;
|
|
uint32_t local_38;
|
|
uint32_t local_34;
|
|
uint8_t **local_30;
|
|
uint32_t playerKey;
|
|
uint32_t playerKeyHigh;
|
|
int *local_20;
|
|
uint32_t *local_1c;
|
|
int playerStateNode;
|
|
uint8_t writeByte;
|
|
void *local_10;
|
|
uint8_t *puStack_c;
|
|
uint32_t local_8;
|
|
Manager *manager;
|
|
|
|
manager = g_manager;
|
|
local_8 = 0xffffffff;
|
|
puStack_c = &LAB_00b09e9d;
|
|
local_10 = ExceptionList;
|
|
uVar2 = __security_cookie ^ GHIDRA_INT(register0x00000010) - 4U;
|
|
ExceptionList = &local_10;
|
|
totalSize = 1;
|
|
(GHIDRA_CAST<KAGE::Filesys::BufferedStream *>((&stream)))->KAGE::Filesys::BufferedStream::BufferedStream(0);
|
|
local_8 = 0;
|
|
piVar8 = *GHIDRA_CAST<int **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(manager[1]._gamestate)) + 0xc8))));
|
|
playerStateNode = *piVar8;
|
|
if (GHIDRA_CAST<int *>(playerStateNode) != piVar8) {
|
|
do {
|
|
iVar6 = playerStateNode;
|
|
iVar3 = (**(code **)(*GHIDRA_CAST<int *>((playerStateNode + 0x48)) + 4))(uVar2);
|
|
iVar4 = (**(code **)(*GHIDRA_CAST<int *>((iVar6 + 0x7c)) + 4))();
|
|
iVar5 = (**(code **)(*GHIDRA_CAST<int *>((iVar6 + 0xb0)) + 4))();
|
|
iVar6 = (**(code **)(*GHIDRA_CAST<int *>((iVar6 + 0xe4)) + 4))();
|
|
totalSize = totalSize + iVar3 + iVar4 + iVar5 + 0x18 + iVar6;
|
|
msvc::
|
|
_Tree_unchecked_const_iterator<msvc::_Tree_val<msvc::_Tree_simple_types<unsigned_int>_>,msvc::_Iterator_base0>
|
|
::operator++((_Tree_unchecked_const_iterator<msvc::_Tree_val<msvc::_Tree_simple_types<unsigned_int>_>,msvc::_Iterator_base0>
|
|
*)&playerStateNode);
|
|
} while (playerStateNode != *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(manager[1]._gamestate)) + 0xc8)))));
|
|
}
|
|
if (GHIDRA_UINT((local_44 - local_4c)) < totalSize) {
|
|
if (0x7fffffff < totalSize) {
|
|
/* WARNING: Subroutine does not return */
|
|
msvc::_Xlen();
|
|
}
|
|
FUN_00a2c860(totalSize);
|
|
}
|
|
writeByte = (*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(manager[1]._gamestate)) + 0xcc)));
|
|
(*(code *)local_30[7])(&writeByte,1,1);
|
|
piVar8 = *GHIDRA_CAST<int **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(manager[1]._gamestate)) + 0xc8))));
|
|
playerStateNode = *piVar8;
|
|
if (GHIDRA_CAST<int *>(playerStateNode) != piVar8) {
|
|
do {
|
|
iVar6 = playerStateNode;
|
|
playerKey = *GHIDRA_CAST<uint32_t *>((playerStateNode + 0x10));
|
|
playerKeyHigh = *GHIDRA_CAST<uint32_t *>((playerStateNode + 0x14));
|
|
(*(code *)local_30[7])(&playerKey,8,1);
|
|
writeByte = *GHIDRA_CAST<uint8_t *>((iVar6 + 0x18));
|
|
(*(code *)local_30[7])(&writeByte,1,1);
|
|
writeByte = *GHIDRA_CAST<uint8_t *>((iVar6 + 0x1c));
|
|
(*(code *)local_30[7])(&writeByte,1,1);
|
|
uVar2 = (**(code **)(*GHIDRA_CAST<int *>((iVar6 + 0x48)) + 4))();
|
|
local_1c = GHIDRA_CAST<uint32_t *>((uVar2 & 0xffff));
|
|
(*(code *)local_30[7])(&local_1c,2,1);
|
|
iVar3 = (**(code **)(*GHIDRA_CAST<int *>((iVar6 + 0x48)) + 4))();
|
|
if (iVar3 != 0) {
|
|
uVar2 = (**(code **)(*GHIDRA_CAST<int *>((iVar6 + 0x48)) + 4))();
|
|
pvVar7 = *(void **)(iVar6 + 0x38);
|
|
if (pvVar7 == (void *)0x0) {
|
|
pvVar7 = *(void **)(iVar6 + 0x2c);
|
|
}
|
|
buffered_stream_write(&local_30,pvVar7,1,uVar2);
|
|
}
|
|
writeByte = *GHIDRA_CAST<uint8_t *>((iVar6 + 0x4c));
|
|
(*(code *)local_30[7])(&writeByte,1,1);
|
|
writeByte = *GHIDRA_CAST<uint8_t *>((iVar6 + 0x50));
|
|
(*(code *)local_30[7])(&writeByte,1,1);
|
|
uVar2 = (**(code **)(*GHIDRA_CAST<int *>((iVar6 + 0x7c)) + 4))();
|
|
local_1c = GHIDRA_CAST<uint32_t *>((uVar2 & 0xffff));
|
|
(*(code *)local_30[7])(&local_1c,2,1);
|
|
iVar3 = (**(code **)(*GHIDRA_CAST<int *>((iVar6 + 0x7c)) + 4))();
|
|
if (iVar3 != 0) {
|
|
uVar2 = (**(code **)(*GHIDRA_CAST<int *>((iVar6 + 0x7c)) + 4))();
|
|
pvVar7 = *(void **)(iVar6 + 0x6c);
|
|
if (pvVar7 == (void *)0x0) {
|
|
pvVar7 = *(void **)(iVar6 + 0x60);
|
|
}
|
|
buffered_stream_write(&local_30,pvVar7,1,uVar2);
|
|
}
|
|
writeByte = *GHIDRA_CAST<uint8_t *>((iVar6 + 0x80));
|
|
(*(code *)local_30[7])(&writeByte,1,1);
|
|
writeByte = *GHIDRA_CAST<uint8_t *>((iVar6 + 0x84));
|
|
(*(code *)local_30[7])(&writeByte,1,1);
|
|
uVar2 = (**(code **)(*GHIDRA_CAST<int *>((iVar6 + 0xb0)) + 4))();
|
|
local_1c = GHIDRA_CAST<uint32_t *>((uVar2 & 0xffff));
|
|
(*(code *)local_30[7])(&local_1c,2,1);
|
|
iVar3 = (**(code **)(*GHIDRA_CAST<int *>((iVar6 + 0xb0)) + 4))();
|
|
if (iVar3 != 0) {
|
|
uVar2 = (**(code **)(*GHIDRA_CAST<int *>((iVar6 + 0xb0)) + 4))();
|
|
pvVar7 = *(void **)(iVar6 + 0xa0);
|
|
if (pvVar7 == (void *)0x0) {
|
|
pvVar7 = *(void **)(iVar6 + 0x94);
|
|
}
|
|
buffered_stream_write(&local_30,pvVar7,1,uVar2);
|
|
}
|
|
writeByte = *GHIDRA_CAST<uint8_t *>((iVar6 + 0xb4));
|
|
(*(code *)local_30[7])(&writeByte,1,1);
|
|
writeByte = *GHIDRA_CAST<uint8_t *>((iVar6 + 0xb8));
|
|
(*(code *)local_30[7])(&writeByte,1,1);
|
|
uVar2 = (**(code **)(*GHIDRA_CAST<int *>((iVar6 + 0xe4)) + 4))();
|
|
local_1c = GHIDRA_CAST<uint32_t *>((uVar2 & 0xffff));
|
|
(*(code *)local_30[7])(&local_1c,2,1);
|
|
iVar3 = (**(code **)(*GHIDRA_CAST<int *>((iVar6 + 0xe4)) + 4))();
|
|
if (iVar3 != 0) {
|
|
uVar2 = (**(code **)(*GHIDRA_CAST<int *>((iVar6 + 0xe4)) + 4))();
|
|
pvVar7 = *(void **)(iVar6 + 0xd4);
|
|
if (pvVar7 == (void *)0x0) {
|
|
pvVar7 = *(void **)(iVar6 + 200);
|
|
}
|
|
buffered_stream_write(&local_30,pvVar7,1,uVar2);
|
|
}
|
|
msvc::
|
|
_Tree_unchecked_const_iterator<msvc::_Tree_val<msvc::_Tree_simple_types<unsigned_int>_>,msvc::_Iterator_base0>
|
|
::operator++((_Tree_unchecked_const_iterator<msvc::_Tree_val<msvc::_Tree_simple_types<unsigned_int>_>,msvc::_Iterator_base0>
|
|
*)&playerStateNode);
|
|
} while (playerStateNode != *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(manager[1]._gamestate)) + 0xc8)))));
|
|
}
|
|
piVar8 = streamSize;
|
|
pvVar7 = operator_new_tracked(GHIDRA_UINT(streamSize));
|
|
iVar6 = local_4c;
|
|
if (local_40 != 0) {
|
|
iVar6 = local_40;
|
|
}
|
|
if (g_deflateCompressor == (void *)0x0) {
|
|
local_1c = operator_new(0x14);
|
|
if (local_1c == GHIDRA_CAST<uint32_t *>(0x0)) {
|
|
g_deflateCompressor = GHIDRA_CAST<uint32_t *>(0x0);
|
|
}
|
|
else {
|
|
*local_1c = 0;
|
|
local_1c[1] = 0;
|
|
local_1c[3] = 0;
|
|
g_deflateCompressor = local_1c;
|
|
}
|
|
local_40 = extraout_ECX;
|
|
}
|
|
FUN_00a89ba0(local_40);
|
|
compressedSize = tdefl_compress(pvVar7,piVar8,iVar6,piVar8,extraout_ECX_00);
|
|
(**(code **)(*local_20 + 4))(0,0xffffffff);
|
|
piVar8 = local_20 + 10;
|
|
writeByte = 7;
|
|
(**(code **)(local_20[10] + 0x1c))(&writeByte,1,1);
|
|
local_20 = streamSize;
|
|
(**(code **)(*piVar8 + 0x1c))(&local_20,4,1);
|
|
(**(code **)(*piVar8 + 0x1c))(pvVar7,1,compressedSize);
|
|
if (pvVar7 != (void *)0x0) {
|
|
if (g_mainHeap == (void *)0x0) {
|
|
allocCounter = &g_allocatedBytesNoHeap;
|
|
}
|
|
else {
|
|
allocCounter = GHIDRA_CAST<uint64_t *>((GHIDRA_INT(g_mainHeap) + 0x30));
|
|
}
|
|
uVar2 = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(pvVar7) + -4));
|
|
qVar1 = *allocCounter;
|
|
*GHIDRA_CAST<uint32_t *>(allocCounter) = GHIDRA_UINT(*allocCounter) - uVar2;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocCounter) + 4)) =
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocCounter) + 4)) - GHIDRA_UINT((GHIDRA_UINT(qVar1) < uVar2));
|
|
free((void *)(GHIDRA_INT(pvVar7) + -4));
|
|
}
|
|
local_30 = KAGE::Filesys::StreamBase::vftable;
|
|
stream = KAGE::Filesys::BufferedStreamBase::vftable;
|
|
streamSize = GHIDRA_CAST<int *>(0x0);
|
|
local_50 = 0;
|
|
local_48 = local_4c;
|
|
local_40 = 0;
|
|
local_3c = 0;
|
|
local_38 = 0;
|
|
local_34 = 0;
|
|
FUN_007dcd30();
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 00918d00
|
|
void NetplayManager::read_player_game_states_message()
|
|
{
|
|
uint32_t uVar1;
|
|
int iVar2;
|
|
int iVar3;
|
|
uint32_t *peerState;
|
|
void *stateBlob;
|
|
uint8_t shift;
|
|
uint32_t uVar4;
|
|
uint64_t *allocatedBytes;
|
|
code *freeFn;
|
|
uint8_t **stream;
|
|
uint32_t peerIdLow;
|
|
uint32_t peerIdHigh;
|
|
Manager *local_28;
|
|
void *decompressBuffer;
|
|
uint32_t local_20;
|
|
uint64_t local_1c;
|
|
uint8_t readByte;
|
|
void *local_10;
|
|
uint8_t *puStack_c;
|
|
uint32_t local_8;
|
|
Manager *manager;
|
|
uint64_t oldAllocatedBytes;
|
|
|
|
local_8 = 0xffffffff;
|
|
puStack_c = &LAB_00b09ecd;
|
|
local_10 = ExceptionList;
|
|
ExceptionList = &local_10;
|
|
local_28 = g_manager;
|
|
readByte = 0;
|
|
(**(code **)(*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0xd])) + 0x1)))) + 0x14))
|
|
(&readByte,1,1,__security_cookie ^ GHIDRA_INT(register0x00000010) - 4U);
|
|
if (readByte != 7) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("Specified data is not a report player game states message\n"));
|
|
}
|
|
local_1c = (uint64_t)GHIDRA_UINT(local_1c);
|
|
(**(code **)(*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0xd])) + 0x1)))) + 0x14))(GHIDRA_INT(&local_1c) + 4,4,1);
|
|
shift = 1;
|
|
uVar4 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_1c)) + 0x4))) - 1;
|
|
uVar1 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_1c)) + 0x4))) >> 1;
|
|
while (uVar1 != 0) {
|
|
uVar4 = uVar4 | uVar1;
|
|
shift = shift + 1;
|
|
uVar1 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_1c)) + 0x4))) >> (shift & 0x1f);
|
|
}
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_1c)) + 0x4))) = uVar4 + 1;
|
|
decompressBuffer = operator_new_tracked(uVar4 + 1);
|
|
iVar2 = (**(code **)(*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0xd])) + 0x1)))) + 8))();
|
|
iVar3 = (**(code **)(*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0xd])) + 0x1)))) + 4))();
|
|
local_20 = iVar3 - iVar2;
|
|
iVar2 = *GHIDRA_CAST<int *>((this + 8));
|
|
if (iVar2 == 0) {
|
|
iVar2 = *GHIDRA_CAST<int *>((this + 4));
|
|
}
|
|
iVar3 = (**(code **)(*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0xd])) + 0x1)))) + 8))();
|
|
buffer_decompress(decompressBuffer,(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_1c)) + 0x4))),(void *)(iVar3 + iVar2),local_20);
|
|
stream = KAGE::Filesys::BufferedStream::vftable;
|
|
local_8 = 0;
|
|
readByte = 0;
|
|
memory_stream_read(&stream,&readByte,1,1);
|
|
manager = local_28;
|
|
uVar4 = GHIDRA_UINT(readByte);
|
|
local_28 = GHIDRA_CAST<Manager *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_28[1]._gamestate)) + 0xc8))));
|
|
iVar2 = *GHIDRA_CAST<int *>(local_28);
|
|
local_20 = uVar4;
|
|
msvc::map<unsigned_long_long_PeerStreams>::destroy_subtree(local_28,*GHIDRA_CAST<uint32_t *>((iVar2 + 4)));
|
|
*GHIDRA_CAST<int *>((iVar2 + 4)) = iVar2;
|
|
*GHIDRA_CAST<int *>(iVar2) = iVar2;
|
|
*GHIDRA_CAST<int *>((iVar2 + 8)) = iVar2;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(manager[1]._gamestate)) + 0xcc)))) = 0;
|
|
freeFn = free_exref;
|
|
do {
|
|
if (uVar4 == 0) {
|
|
if (decompressBuffer != (void *)0x0) {
|
|
if (g_mainHeap == (void *)0x0) {
|
|
allocatedBytes = &g_allocatedBytesNoHeap;
|
|
}
|
|
else {
|
|
allocatedBytes = GHIDRA_CAST<uint64_t *>((GHIDRA_INT(g_mainHeap) + 0x30));
|
|
}
|
|
uVar4 = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(decompressBuffer) + -4));
|
|
oldAllocatedBytes = *allocatedBytes;
|
|
*GHIDRA_CAST<uint32_t *>(allocatedBytes) = GHIDRA_UINT(*allocatedBytes) - uVar4;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocatedBytes) + 4)) =
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocatedBytes) + 4)) - GHIDRA_UINT((GHIDRA_UINT(oldAllocatedBytes) < uVar4));
|
|
(*freeFn)(GHIDRA_CAST<uint32_t *>((GHIDRA_INT(decompressBuffer) + -4)));
|
|
}
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
local_1c = 0;
|
|
if ((code *)stream[5] == memory_stream_read) {
|
|
memory_stream_read(&stream,&local_1c,8,1);
|
|
}
|
|
else {
|
|
(*(code *)stream[5])(&local_1c);
|
|
}
|
|
peerIdLow = GHIDRA_UINT(local_1c);
|
|
peerIdHigh = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_1c)) + 0x4)));
|
|
peerState = GHIDRA_CAST<uint32_t *>(FUN_00913e50(&peerIdLow));
|
|
readByte = 0;
|
|
if ((code *)stream[5] == memory_stream_read) {
|
|
memory_stream_read(&stream,&readByte,1,1);
|
|
}
|
|
else {
|
|
(*(code *)stream[5])(&readByte);
|
|
}
|
|
*peerState = GHIDRA_UINT(readByte);
|
|
readByte = 0;
|
|
if ((code *)stream[5] == memory_stream_read) {
|
|
memory_stream_read(&stream,&readByte,1,1);
|
|
}
|
|
else {
|
|
(*(code *)stream[5])(&readByte);
|
|
}
|
|
peerState[1] = GHIDRA_UINT(readByte);
|
|
(**(code **)(peerState[2] + 4))(0,0xffffffff);
|
|
local_1c = local_1c & 0xffffffff;
|
|
if ((code *)stream[5] == memory_stream_read) {
|
|
memory_stream_read(&stream,(void *)(GHIDRA_INT(&local_1c) + 4),2,1);
|
|
}
|
|
else {
|
|
(*(code *)stream[5])(GHIDRA_INT(&local_1c) + 4);
|
|
}
|
|
if ((short)(local_1c >> 0x20) != 0) {
|
|
uVar4 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_1c)) + 0x4))) & 0xffff;
|
|
stateBlob = operator_new_tracked(uVar4);
|
|
memory_stream_read(&stream,stateBlob,1,uVar4);
|
|
(**(code **)(peerState[0xc] + 0x1c))(stateBlob,1,uVar4);
|
|
if (stateBlob != (void *)0x0) {
|
|
if (g_mainHeap == (void *)0x0) {
|
|
allocatedBytes = &g_allocatedBytesNoHeap;
|
|
}
|
|
else {
|
|
allocatedBytes = GHIDRA_CAST<uint64_t *>((GHIDRA_INT(g_mainHeap) + 0x30));
|
|
}
|
|
uVar4 = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(stateBlob) + -4));
|
|
oldAllocatedBytes = *allocatedBytes;
|
|
*GHIDRA_CAST<uint32_t *>(allocatedBytes) = GHIDRA_UINT(*allocatedBytes) - uVar4;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocatedBytes) + 4)) =
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocatedBytes) + 4)) - GHIDRA_UINT((GHIDRA_UINT(oldAllocatedBytes) < uVar4));
|
|
free((void *)(GHIDRA_INT(stateBlob) + -4));
|
|
local_8 = local_8 & 0xffffff00;
|
|
}
|
|
}
|
|
readByte = 0;
|
|
if ((code *)stream[5] == memory_stream_read) {
|
|
memory_stream_read(&stream,&readByte,1,1);
|
|
}
|
|
else {
|
|
(*(code *)stream[5])(&readByte);
|
|
}
|
|
peerState[0xd] = GHIDRA_UINT(readByte);
|
|
readByte = 0;
|
|
if ((code *)stream[5] == memory_stream_read) {
|
|
memory_stream_read(&stream,&readByte,1,1);
|
|
}
|
|
else {
|
|
(*(code *)stream[5])(&readByte);
|
|
}
|
|
peerState[0xe] = GHIDRA_UINT(readByte);
|
|
(**(code **)(peerState[0xf] + 4))(0,0xffffffff);
|
|
local_1c = local_1c & 0xffffffff;
|
|
if ((code *)stream[5] == memory_stream_read) {
|
|
memory_stream_read(&stream,(void *)(GHIDRA_INT(&local_1c) + 4),2,1);
|
|
}
|
|
else {
|
|
(*(code *)stream[5])(GHIDRA_INT(&local_1c) + 4);
|
|
}
|
|
if ((short)(local_1c >> 0x20) != 0) {
|
|
uVar4 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_1c)) + 0x4))) & 0xffff;
|
|
stateBlob = operator_new_tracked(uVar4);
|
|
memory_stream_read(&stream,stateBlob,1,uVar4);
|
|
(**(code **)(peerState[0x19] + 0x1c))(stateBlob,1,uVar4);
|
|
if (stateBlob != (void *)0x0) {
|
|
if (g_mainHeap == (void *)0x0) {
|
|
allocatedBytes = &g_allocatedBytesNoHeap;
|
|
}
|
|
else {
|
|
allocatedBytes = GHIDRA_CAST<uint64_t *>((GHIDRA_INT(g_mainHeap) + 0x30));
|
|
}
|
|
uVar4 = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(stateBlob) + -4));
|
|
oldAllocatedBytes = *allocatedBytes;
|
|
*GHIDRA_CAST<uint32_t *>(allocatedBytes) = GHIDRA_UINT(*allocatedBytes) - uVar4;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocatedBytes) + 4)) =
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocatedBytes) + 4)) - GHIDRA_UINT((GHIDRA_UINT(oldAllocatedBytes) < uVar4));
|
|
free((void *)(GHIDRA_INT(stateBlob) + -4));
|
|
local_8 = local_8 & 0xffffff00;
|
|
}
|
|
}
|
|
readByte = 0;
|
|
if ((code *)stream[5] == memory_stream_read) {
|
|
memory_stream_read(&stream,&readByte,1,1);
|
|
}
|
|
else {
|
|
(*(code *)stream[5])(&readByte);
|
|
}
|
|
peerState[0x1a] = GHIDRA_UINT(readByte);
|
|
readByte = 0;
|
|
if ((code *)stream[5] == memory_stream_read) {
|
|
memory_stream_read(&stream,&readByte,1,1);
|
|
}
|
|
else {
|
|
(*(code *)stream[5])(&readByte);
|
|
}
|
|
peerState[0x1b] = GHIDRA_UINT(readByte);
|
|
(**(code **)(peerState[0x1c] + 4))(0,0xffffffff);
|
|
local_1c = local_1c & 0xffffffff;
|
|
if ((code *)stream[5] == memory_stream_read) {
|
|
memory_stream_read(&stream,(void *)(GHIDRA_INT(&local_1c) + 4),2,1);
|
|
}
|
|
else {
|
|
(*(code *)stream[5])(GHIDRA_INT(&local_1c) + 4);
|
|
}
|
|
if ((short)(local_1c >> 0x20) != 0) {
|
|
uVar4 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_1c)) + 0x4))) & 0xffff;
|
|
stateBlob = operator_new_tracked(uVar4);
|
|
memory_stream_read(&stream,stateBlob,1,uVar4);
|
|
(**(code **)(peerState[0x26] + 0x1c))(stateBlob,1,uVar4);
|
|
if (stateBlob != (void *)0x0) {
|
|
if (g_mainHeap == (void *)0x0) {
|
|
allocatedBytes = &g_allocatedBytesNoHeap;
|
|
}
|
|
else {
|
|
allocatedBytes = GHIDRA_CAST<uint64_t *>((GHIDRA_INT(g_mainHeap) + 0x30));
|
|
}
|
|
uVar4 = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(stateBlob) + -4));
|
|
oldAllocatedBytes = *allocatedBytes;
|
|
*GHIDRA_CAST<uint32_t *>(allocatedBytes) = GHIDRA_UINT(*allocatedBytes) - uVar4;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocatedBytes) + 4)) =
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocatedBytes) + 4)) - GHIDRA_UINT((GHIDRA_UINT(oldAllocatedBytes) < uVar4));
|
|
free((void *)(GHIDRA_INT(stateBlob) + -4));
|
|
local_8 = local_8 & 0xffffff00;
|
|
}
|
|
}
|
|
readByte = 0;
|
|
if ((code *)stream[5] == memory_stream_read) {
|
|
memory_stream_read(&stream,&readByte,1,1);
|
|
}
|
|
else {
|
|
(*(code *)stream[5])(&readByte);
|
|
}
|
|
peerState[0x27] = GHIDRA_UINT(readByte);
|
|
readByte = 0;
|
|
if ((code *)stream[5] == memory_stream_read) {
|
|
memory_stream_read(&stream,&readByte,1,1);
|
|
}
|
|
else {
|
|
(*(code *)stream[5])(&readByte);
|
|
}
|
|
peerState[0x28] = GHIDRA_UINT(readByte);
|
|
(**(code **)(peerState[0x29] + 4))(0,0xffffffff);
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_1c)) + 0x4))) = 0;
|
|
if ((code *)stream[5] == memory_stream_read) {
|
|
memory_stream_read(&stream,(void *)(GHIDRA_INT(&local_1c) + 4),2,1);
|
|
}
|
|
else {
|
|
(*(code *)stream[5])(GHIDRA_INT(&local_1c) + 4);
|
|
}
|
|
if ((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((short)local_1c)) + 0x4))) == 0) {
|
|
LAB_009192e4:
|
|
freeFn = free_exref;
|
|
}
|
|
else {
|
|
uVar4 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_1c)) + 0x4))) & 0xffff;
|
|
stateBlob = operator_new_tracked(uVar4);
|
|
memory_stream_read(&stream,stateBlob,1,uVar4);
|
|
(**(code **)(peerState[0x33] + 0x1c))(stateBlob,1,uVar4);
|
|
if (stateBlob == (void *)0x0) goto LAB_009192e4;
|
|
if (g_mainHeap == (void *)0x0) {
|
|
allocatedBytes = &g_allocatedBytesNoHeap;
|
|
}
|
|
else {
|
|
allocatedBytes = GHIDRA_CAST<uint64_t *>((GHIDRA_INT(g_mainHeap) + 0x30));
|
|
}
|
|
uVar4 = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(stateBlob) + -4));
|
|
oldAllocatedBytes = *allocatedBytes;
|
|
*GHIDRA_CAST<uint32_t *>(allocatedBytes) = GHIDRA_UINT(*allocatedBytes) - uVar4;
|
|
freeFn = free_exref;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocatedBytes) + 4)) =
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocatedBytes) + 4)) - GHIDRA_UINT((GHIDRA_UINT(oldAllocatedBytes) < uVar4));
|
|
free((void *)(GHIDRA_INT(stateBlob) + -4));
|
|
local_8 = local_8 & 0xffffff00;
|
|
}
|
|
local_20 = local_20 - 1;
|
|
uVar4 = local_20;
|
|
} while( true );
|
|
}
|
|
|
|
// 0091f780
|
|
void NetplayManager::load_mute_list()
|
|
{
|
|
char *pcVar1;
|
|
char isEof;
|
|
uint32_t uVar2;
|
|
int *file;
|
|
int iVar3;
|
|
uint8_t *newlinePos;
|
|
char *lineCursor;
|
|
int *errnoPtr;
|
|
uint8_t *mutedFlag;
|
|
int in_ECX;
|
|
uint32_t ****ppppuVar4;
|
|
code *pcVar5;
|
|
uint64_t userId;
|
|
uint64_t userIdKey;
|
|
int *muteSet;
|
|
uint32_t ****parseEnd;
|
|
uint32_t ****lineString [4];
|
|
uint32_t lineSize;
|
|
uint32_t lineCapacity;
|
|
uint32_t local_14;
|
|
void *local_10;
|
|
uint8_t *puStack_c;
|
|
uint32_t ***local_8;
|
|
|
|
local_8 = GHIDRA_CAST<uint32_t ***>(0xffffffff);
|
|
puStack_c = &LAB_00af32ed;
|
|
local_10 = ExceptionList;
|
|
uVar2 = __security_cookie ^ GHIDRA_UINT((lineString + 10));
|
|
ExceptionList = &local_10;
|
|
local_14 = uVar2;
|
|
if (DAT_00c72620 == '\0') {
|
|
sprintf_s(GHIDRA_CAST<uint8_t *>(&DAT_00c72620),0x400,&DAT_00b60c28);
|
|
}
|
|
muteSet = GHIDRA_CAST<int *>((in_ECX + 0x620));
|
|
iVar3 = *muteSet;
|
|
FID_conflict__Erase_tree<fuzzer::fuzzer_allocator<msvc::_Tree_node<fuzzer::TracePC::PCTableEntry_const*,void*>_>_>
|
|
(muteSet,(fuzzer_allocator<msvc::_Tree_node<unsigned_int,void*>_> *)muteSet,
|
|
*(_Tree_node<unsigned_int,void*> **)(iVar3 + 4));
|
|
*GHIDRA_CAST<int *>((iVar3 + 4)) = iVar3;
|
|
*GHIDRA_CAST<int *>(iVar3) = iVar3;
|
|
*GHIDRA_CAST<int *>((iVar3 + 8)) = iVar3;
|
|
*GHIDRA_CAST<uint32_t *>((in_ECX + 0x624)) = 0;
|
|
file = (GHIDRA_CAST<SaveDataManager *>((&PTR_vftable_00c5aa80)))->SaveDataManager::open_file_read(GHIDRA_CAST<uint8_t *>(&DAT_00c72620));
|
|
if (file != GHIDRA_CAST<int *>(0x0)) {
|
|
isEof = (**(code **)(*file + 0x10))(uVar2);
|
|
if (isEof == '\0') {
|
|
pcVar5 = strchr_exref;
|
|
do {
|
|
iVar3 = (**(code **)(*file + 0x18))(&DAT_00c93a50,0x400);
|
|
if (iVar3 != 0) {
|
|
newlinePos = GHIDRA_CAST<uint8_t *>((*pcVar5)(&DAT_00c93a50,0xd));
|
|
if (newlinePos != GHIDRA_CAST<uint8_t *>(0x0)) {
|
|
*newlinePos = 0;
|
|
}
|
|
newlinePos = GHIDRA_CAST<uint8_t *>((*pcVar5)(&DAT_00c93a50,10));
|
|
if (newlinePos != GHIDRA_CAST<uint8_t *>(0x0)) {
|
|
*newlinePos = 0;
|
|
}
|
|
lineSize = 0;
|
|
lineCapacity = 0xf;
|
|
lineString[0] = GHIDRA_CAST<uint32_t ****>(0x0);
|
|
pcVar1 = &DAT_00c93a50;
|
|
do {
|
|
lineCursor = pcVar1;
|
|
pcVar1 = lineCursor + 1;
|
|
} while (*lineCursor != '\0');
|
|
(GHIDRA_CAST<msvc::string *>((GHIDRA_CAST<char *>(lineString))))->msvc::string::assign(&DAT_00c93a50,GHIDRA_UINT((lineCursor + -0xc93a50)));
|
|
local_8 = GHIDRA_CAST<uint32_t ***>(0x0);
|
|
errnoPtr = _errno();
|
|
ppppuVar4 = lineString;
|
|
if (0xf < lineCapacity) {
|
|
ppppuVar4 = lineString[0];
|
|
}
|
|
*errnoPtr = 0;
|
|
userId = strtoull(ppppuVar4,&parseEnd,10);
|
|
if (ppppuVar4 == parseEnd) {
|
|
msvc::_Xinvalid_argument("invalid stoull argument");
|
|
pcVar5 = (code *)swi(3);
|
|
(*pcVar5)();
|
|
return;
|
|
}
|
|
if (*errnoPtr == 0x22) {
|
|
/* WARNING: Subroutine does not return */
|
|
msvc::_Xout_of_range("stoull argument out of range");
|
|
}
|
|
userIdKey = userId;
|
|
mutedFlag = map_u64_bool_subscript(muteSet,&userIdKey);
|
|
local_8 = GHIDRA_CAST<uint32_t ***>(0xffffffff);
|
|
*mutedFlag = 1;
|
|
if (0xf < lineCapacity) {
|
|
uVar2 = lineCapacity + 1;
|
|
ppppuVar4 = lineString[0];
|
|
if (0xfff < uVar2) {
|
|
ppppuVar4 = GHIDRA_CAST<uint32_t ****>(lineString[0][-1]);
|
|
uVar2 = lineCapacity + 0x24;
|
|
if (0x1f < GHIDRA_UINT((GHIDRA_INT(lineString[0]) + (-4 - GHIDRA_INT(ppppuVar4))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(ppppuVar4,uVar2);
|
|
}
|
|
lineSize = 0;
|
|
lineCapacity = 0xf;
|
|
lineString[0] = GHIDRA_CAST<uint32_t ****>((GHIDRA_UINT(lineString[0]) & 0xffffff00));
|
|
pcVar5 = strchr_exref;
|
|
}
|
|
isEof = (**(code **)(*file + 0x10))();
|
|
} while (isEof == '\0');
|
|
}
|
|
(**(code **)*file)(1);
|
|
}
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 00923920
|
|
void NetplayManager::update_text_popup()
|
|
{
|
|
uint32_t *puVar1;
|
|
uint8_t *pbVar2;
|
|
bool bVar3;
|
|
uint32_t uVar4;
|
|
uint8_t bVar5;
|
|
uint8_t *pbVar6;
|
|
std_string *psVar7;
|
|
std_string *psVar8;
|
|
uint32_t uVar9;
|
|
char *pcVar10;
|
|
int iVar11;
|
|
int iVar12;
|
|
bool bVar13;
|
|
std_string animName;
|
|
std_string *local_8;
|
|
int message;
|
|
int messageTimer;
|
|
|
|
local_8 = GHIDRA_CAST<std_string *>((__security_cookie ^ GHIDRA_UINT((GHIDRA_INT(&animName) + 0x1cU))));
|
|
bVar13 = false;
|
|
if (*GHIDRA_CAST<char *>((this + 0x5f)) != '\0') {
|
|
AnimationState::Update(GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x16])) + 0x2)))));
|
|
AnimationState::Update(GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x21])) + 0x1)))));
|
|
}
|
|
if (*(void **)(this + 0x18) == (void *)0x0) {
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(animName._buf)) + 0x0))) = GHIDRA_CAST<std_string *>(0x0);
|
|
animName._capacity = 0xf;
|
|
animName._size = 0;
|
|
LAB_00923989:
|
|
psVar7 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<std_string *>(animName._buf))) + 0x0)));
|
|
psVar8 = &animName;
|
|
if (0xf < animName._capacity) {
|
|
psVar8 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<std_string *>(animName._buf))) + 0x0)));
|
|
}
|
|
bVar13 = true;
|
|
bVar5 = str_eq(GHIDRA_CAST<uint8_t *>(psVar8),animName._size,GHIDRA_CAST<uint8_t *>("TextIn"),6);
|
|
bVar3 = true;
|
|
if (bVar5 == 0) goto LAB_009239ae;
|
|
}
|
|
else {
|
|
if ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x1d])) + 0x1))) == '\0') {
|
|
(GHIDRA_CAST<msvc::string *>((animName._buf)))->msvc::string::string(*(void **)(this + 0x18));
|
|
goto LAB_00923989;
|
|
}
|
|
psVar7 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<std_string *>(animName._buf))) + 0x0)));
|
|
LAB_009239ae:
|
|
bVar3 = false;
|
|
}
|
|
if ((bVar13) && (0xf < animName._capacity)) {
|
|
uVar9 = animName._capacity + 1;
|
|
psVar8 = psVar7;
|
|
if (0xfff < uVar9) {
|
|
psVar8 = GHIDRA_CAST<std_string *>(psVar7[-1]._capacity);
|
|
uVar9 = animName._capacity + 0x24;
|
|
if (GHIDRA_CAST<uint8_t *>(0x1f) < GHIDRA_CAST<uint8_t *>((GHIDRA_INT(psVar7) + (-4 - GHIDRA_INT(psVar8))))) goto LAB_00923ac5;
|
|
}
|
|
operator_delete(psVar8,uVar9);
|
|
}
|
|
bVar13 = false;
|
|
if (bVar3) {
|
|
pbVar2 = *GHIDRA_CAST<uint8_t **>((this + 0x18));
|
|
if (pbVar2 != GHIDRA_CAST<uint8_t *>(0x0)) {
|
|
pbVar6 = pbVar2;
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((pbVar2 + 0x14))) {
|
|
pbVar6 = *GHIDRA_CAST<uint8_t **>(pbVar2);
|
|
}
|
|
pcVar10 = "TextStay";
|
|
do {
|
|
bVar5 = *pbVar6;
|
|
bVar13 = bVar5 < (uint8_t)*pcVar10;
|
|
if (bVar5 != *pcVar10) {
|
|
LAB_00923a30:
|
|
uVar9 = -GHIDRA_UINT(bVar13) | 1;
|
|
goto LAB_00923a35;
|
|
}
|
|
if (bVar5 == 0) break;
|
|
bVar5 = pbVar6[1];
|
|
bVar13 = bVar5 < (uint8_t)pcVar10[1];
|
|
if (bVar5 != pcVar10[1]) goto LAB_00923a30;
|
|
pbVar6 = pbVar6 + 2;
|
|
pcVar10 = pcVar10 + 2;
|
|
} while (bVar5 != 0);
|
|
uVar9 = 0;
|
|
LAB_00923a35:
|
|
if (uVar9 == 0) {
|
|
if (pbVar2[0x34] == 0) {
|
|
return;
|
|
}
|
|
if ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x1d])) + 0x1))) != '\0') {
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
pcVar10 = "TextStay";
|
|
goto LAB_00923c61;
|
|
}
|
|
if (*(void **)(this + 0x18) == (void *)0x0) {
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(animName._buf)) + 0x0))) = GHIDRA_CAST<std_string *>(0x0);
|
|
animName._capacity = 0xf;
|
|
animName._size = 0;
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<msvc::string *>((animName._buf)))->msvc::string::string(*(void **)(this + 0x18));
|
|
}
|
|
uVar4 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(animName._buf)) + 0x0)));
|
|
psVar7 = &animName;
|
|
if (0xf < animName._capacity) {
|
|
psVar7 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<std_string *>(animName._buf))) + 0x0)));
|
|
}
|
|
bVar5 = str_eq(GHIDRA_CAST<uint8_t *>(psVar7),animName._size,GHIDRA_CAST<uint8_t *>("TextStay"),8);
|
|
if (0xf < animName._capacity) {
|
|
uVar9 = animName._capacity + 1;
|
|
psVar7 = GHIDRA_CAST<std_string *>(uVar4);
|
|
if (0xfff < uVar9) {
|
|
psVar7 = GHIDRA_CAST<std_string *>((GHIDRA_CAST<std_string *>((uVar4 + -0x18)))->_capacity);
|
|
uVar9 = animName._capacity + 0x24;
|
|
if (GHIDRA_CAST<uint8_t *>(0x1f) < GHIDRA_CAST<uint8_t *>((uVar4 + (-4 - GHIDRA_INT(psVar7))))) {
|
|
LAB_00923ac5:
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(psVar7,uVar9);
|
|
}
|
|
if (bVar5 != 0) {
|
|
iVar11 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[2])) + 0x2))));
|
|
uVar9 = *GHIDRA_CAST<uint32_t *>((this + 4));
|
|
iVar12 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[1])) + 0x1))));
|
|
message = *GHIDRA_CAST<int *>((iVar12 + (iVar11 - 1U & uVar9) * 4));
|
|
messageTimer = *GHIDRA_CAST<int *>((message + 0x18));
|
|
if (0 < messageTimer) {
|
|
*GHIDRA_CAST<int *>((message + 0x18)) = messageTimer + -1;
|
|
uVar9 = *GHIDRA_CAST<uint32_t *>((this + 4));
|
|
iVar11 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[2])) + 0x2))));
|
|
iVar12 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[1])) + 0x1))));
|
|
}
|
|
if (0 < *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((iVar12 + (iVar11 - 1U & uVar9) * 4)) + 0x18))) {
|
|
return;
|
|
}
|
|
pbVar2 = *GHIDRA_CAST<uint8_t **>((this + 0x18));
|
|
if (pbVar2 != GHIDRA_CAST<uint8_t *>(0x0)) {
|
|
pbVar6 = pbVar2;
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((pbVar2 + 0x14))) {
|
|
pbVar6 = *GHIDRA_CAST<uint8_t **>(pbVar2);
|
|
}
|
|
pcVar10 = "TextOut";
|
|
do {
|
|
bVar5 = *pbVar6;
|
|
bVar13 = bVar5 < (uint8_t)*pcVar10;
|
|
if (bVar5 != *pcVar10) {
|
|
LAB_00923b50:
|
|
uVar9 = -GHIDRA_UINT(bVar13) | 1;
|
|
goto LAB_00923b55;
|
|
}
|
|
if (bVar5 == 0) break;
|
|
bVar5 = pbVar6[1];
|
|
bVar13 = bVar5 < (uint8_t)pcVar10[1];
|
|
if (bVar5 != pcVar10[1]) goto LAB_00923b50;
|
|
pbVar6 = pbVar6 + 2;
|
|
pcVar10 = pcVar10 + 2;
|
|
} while (bVar5 != 0);
|
|
uVar9 = 0;
|
|
LAB_00923b55:
|
|
if (uVar9 == 0) {
|
|
if (pbVar2[0x34] == 0) {
|
|
return;
|
|
}
|
|
if ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x1d])) + 0x1))) != '\0') {
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
pcVar10 = "TextOut";
|
|
goto LAB_00923c61;
|
|
}
|
|
if ((*GHIDRA_CAST<int *>((this + 0x18)) == 0) || ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x1d])) + 0x1))) == '\0')) {
|
|
psVar7 = ANM2::GetAnimation(GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x16])) + 0x2)))),&animName);
|
|
bVar13 = true;
|
|
puVar1 = &psVar7->_size;
|
|
if (0xf < psVar7->_capacity) {
|
|
psVar7 = *GHIDRA_CAST<std_string **>(psVar7->_buf);
|
|
}
|
|
bVar5 = str_eq(GHIDRA_CAST<uint8_t *>(psVar7),*puVar1,GHIDRA_CAST<uint8_t *>("TextOut"),7);
|
|
if ((bVar5 == 0) || (bVar3 = true, *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[5])) + 0x1)))) == 0)) goto LAB_00923bbc;
|
|
}
|
|
else {
|
|
LAB_00923bbc:
|
|
bVar3 = false;
|
|
}
|
|
if ((bVar13) && (0xf < animName._capacity)) {
|
|
uVar9 = animName._capacity + 1;
|
|
psVar7 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<std_string *>(animName._buf))) + 0x0)));
|
|
if (0xfff < uVar9) {
|
|
psVar7 = GHIDRA_CAST<std_string *>((GHIDRA_CAST<std_string *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(animName._buf)) + 0x0))) + -0x18)))->_capacity);
|
|
uVar9 = animName._capacity + 0x24;
|
|
if (GHIDRA_CAST<uint8_t *>(0x1f) < GHIDRA_CAST<uint8_t *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(animName._buf)) + 0x0))) + (-4 - GHIDRA_INT(psVar7))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(psVar7,uVar9);
|
|
}
|
|
if (!bVar3) {
|
|
return;
|
|
}
|
|
FUN_00923d30();
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[5])) + 0x1)))) == 0) {
|
|
return;
|
|
}
|
|
pbVar2 = *GHIDRA_CAST<uint8_t **>((this + 0x18));
|
|
if (pbVar2 != GHIDRA_CAST<uint8_t *>(0x0)) {
|
|
pbVar6 = pbVar2;
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((pbVar2 + 0x14))) {
|
|
pbVar6 = *GHIDRA_CAST<uint8_t **>(pbVar2);
|
|
}
|
|
pcVar10 = "TextIn";
|
|
do {
|
|
bVar5 = *pbVar6;
|
|
bVar13 = bVar5 < (uint8_t)*pcVar10;
|
|
if (bVar5 != *pcVar10) {
|
|
LAB_00923c47:
|
|
uVar9 = -GHIDRA_UINT(bVar13) | 1;
|
|
goto LAB_00923c4c;
|
|
}
|
|
if (bVar5 == 0) break;
|
|
bVar5 = pbVar6[1];
|
|
bVar13 = bVar5 < (uint8_t)pcVar10[1];
|
|
if (bVar5 != pcVar10[1]) goto LAB_00923c47;
|
|
pbVar6 = pbVar6 + 2;
|
|
pcVar10 = pcVar10 + 2;
|
|
} while (bVar5 != 0);
|
|
uVar9 = 0;
|
|
LAB_00923c4c:
|
|
if (uVar9 == 0) {
|
|
if (pbVar2[0x34] == 0) {
|
|
return;
|
|
}
|
|
if ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x1d])) + 0x1))) != '\0') {
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
pcVar10 = "TextIn";
|
|
LAB_00923c61:
|
|
bVar5 = ANM2::SetAnimation(GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[6])) + 0x2)))),GHIDRA_CAST<uint8_t *>(pcVar10),1);
|
|
if (bVar5 != 0) {
|
|
AnimationState::Rewind(GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x16])) + 0x2)))));
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x1d])) + 0x1))) = 1;
|
|
}
|
|
return;
|
|
}
|