Reconstruction layout: generated-src/ (generated) and src/ (curated), CMake, the first takeover: RNG

The decompiled C++ tree moves to generated-src/ (classes.h, C++20); src/ is for code written by hand. A curated function
defines the generated declaration and starts its comment with its address, and source_tree.py stops emitting that body.
src/rng.cpp takes over RNG (SetSeed, the constructor, Next, RandomInt, RandomFloat, Shuffle) with the shift table read
from the exe as a constexpr array; src/log.h names KAGE_LogMessage's levels (1 INFO, 2 NET, 4 WARN, 8 ERROR, 16 ASSERT,
from its prefix jump table). CMakeLists.txt builds src/*.cpp against generated-src/classes.h (clean with -Wall -Wextra).
structs.hpp and headers.py are retired: scripts/merge_fields.py writes the merged field list, classes.h checks the layout.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
shweetandClaude Opus 5.5 committed 2026-11-19 21:10:23 -05:00
1 parent 2ff2d5d87f
commit 3ce74c6e2d
331 files changed
+485 -7835

No files matched your search

@@ -0,0 +1,537 @@
#include "classes.h"
// 00a289d0
undefined * KAGE::Network::MultiplayerManager::dynamic_initializer()
{
uint stackCookie;
undefined4 in_ECX;
undefined4 extraout_ECX;
void *local_10;
undefined1 *puStack_c;
undefined4 local_8;
puStack_c = &LAB_00b11d65;
local_10 = ExceptionList;
stackCookie = __security_cookie ^ GHIDRA_INT(register0x00000010) - 4U;
ExceptionList = &local_10;
_DAT_00c79a54 = 0;
local_8 = 0;
_DAT_00c79a50 = MultiplayerManagerBase::vftable;
g_multiplayerService = (void *)0x0;
DAT_00c79a60 = 0;
_DAT_00c79a64 = 0;
_DAT_00c79a68 = 0;
_DAT_00c79a70 = Multiplayer::ConstLobby::vftable;
SmartPointer<LobbyImplBase>::SmartPointer(in_ECX);
_DAT_00c79a70 = Multiplayer::Lobby::vftable;
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 1;
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(g_multiplayerCommandThreadFlags)) + 0x0))) = 0;
FUN_00a28c20(stackCookie);
DAT_00c79aac = 0;
DAT_00c79aa8 = Thread::vftable;
_DAT_00c79ab0 = 0;
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 3;
_DAT_00c79ab4 = (void *)0x0;
_DAT_00c79ab8 = 0;
_DAT_00c79ab4 = operator_new(0x10);
*(void **)_DAT_00c79ab4 = _DAT_00c79ab4;
*(void **)(GHIDRA_CAST<char *>(_DAT_00c79ab4) + 4) = _DAT_00c79ab4;
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 4;
FUN_00a28c20();
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 5;
_DAT_00c79ae4 = Multiplayer::ConstLobby::vftable;
SmartPointer<LobbyImplBase>::SmartPointer(extraout_ECX);
_DAT_00c79ae4 = Multiplayer::Lobby::vftable;
_DAT_00c79af0 = 0;
uRam00c79af4 = 0;
uRam00c79af8 = 0;
uRam00c79afc = 0;
_DAT_00c79b00 = 0;
DAT_00c79b08 = 0;
DAT_00c79b0c = 0;
_DAT_00c79b10 = 0;
DAT_00c79b14 = 0;
DAT_00c79b18 = 0;
uRam00c79b1c = 0;
_DAT_00c79b20 = 0;
DAT_00c79b24 = 0;
uRam00c79b28 = 0;
uRam00c79b2c = 0;
_DAT_00c79b30 = 0;
_DAT_00c79b34 = 0;
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 8;
FUN_00a28c20();
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 9;
DAT_00c79b60 = (void *)0x0;
_DAT_00c79b64 = 0;
DAT_00c79b60 = operator_new(0x10);
*(void **)DAT_00c79b60 = DAT_00c79b60;
*(void **)(GHIDRA_CAST<char *>(DAT_00c79b60) + 4) = DAT_00c79b60;
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 10;
_DAT_00c79b68 = (void *)0x0;
_DAT_00c79b6c = 0;
_DAT_00c79b68 = operator_new(0x10);
*(void **)_DAT_00c79b68 = _DAT_00c79b68;
*(void **)(GHIDRA_CAST<char *>(_DAT_00c79b68) + 4) = _DAT_00c79b68;
local_8 = CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x1))),0xb);
_DAT_00c79b70 = (void *)0x0;
_DAT_00c79b74 = 0;
_DAT_00c79b70 = operator_new(0x10);
*(void **)_DAT_00c79b70 = _DAT_00c79b70;
*(void **)(GHIDRA_CAST<char *>(_DAT_00c79b70) + 4) = _DAT_00c79b70;
ExceptionList = local_10;
return &DAT_00c79a50;
}
// 00a54f00
void KAGE::Network::MultiplayerManager::on_lobby_data_update(uint *param_1)
{
char cVar1;
uint uVar2;
undefined8 *callbackEntry;
uint uVar3;
void *lobbySteam;
uint uVar4;
undefined **local_24;
int local_20;
int *local_1c;
undefined8 local_18;
void *local_10;
undefined1 *puStack_c;
undefined4 local_8;
bool isCurrentLobby;
local_8 = 0xffffffff;
puStack_c = &LAB_00b126e5;
local_10 = ExceptionList;
uVar2 = __security_cookie ^ GHIDRA_INT(register0x00000010) - 4U;
ExceptionList = &local_10;
uVar3 = *param_1;
uVar4 = param_1[1];
if ((uVar3 == param_1[2]) && (uVar4 == param_1[3])) {
FUN_00a53660(&local_24,param_1);
if ((((*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(local_1c) + 0xd)) == '\0') && (*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(local_1c) + 0x14)) <= uVar4)) &&
((*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(local_1c) + 0x14)) < uVar4 || (*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(local_1c) + 0x10)) <= uVar3))))
&& (local_1c != GHIDRA_CAST<int *>(DAT_00c79a44))) {
callbackEntry = GHIDRA_CAST<undefined8 *>(FUN_00a533d0(param_1));
local_18 = *callbackEntry;
local_8 = 0;
if (*(code **)callbackEntry != (code *)0x0) {
(**(code **)callbackEntry)
((-GHIDRA_UINT(((char)param_1[4] != '\0')) & 0xfffffff0) + 0x10,param_1,
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(callbackEntry) + 4)),uVar2);
}
FUN_00a551c0(param_1);
ExceptionList = local_10;
return;
}
}
else {
local_24 = Multiplayer::ConstLobby::vftable;
local_20 = 0;
local_1c = GHIDRA_CAST<int *>(0x0);
local_8 = 1;
(GHIDRA_CAST<std::shared_ptr *>((&local_20)))->std::shared_ptr::assign(&g_multiplayerLobbyPtr);
if (local_20 == 0) {
local_18 = 0;
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_18)) + 0x4))) = 0;
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_18)) + 0x0))) = 0;
uVar3 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_18)) + 0x4)));
uVar4 = GHIDRA_UINT(local_18);
}
else {
uVar3 = *GHIDRA_CAST<uint *>((local_20 + 0xc));
uVar4 = *GHIDRA_CAST<uint *>((local_20 + 8));
}
if ((uVar4 == *param_1) && (uVar3 == param_1[1])) {
isCurrentLobby = true;
}
else {
isCurrentLobby = false;
}
local_24 = Multiplayer::ConstLobby::vftable;
local_8 = 2;
if (local_1c != GHIDRA_CAST<int *>(0x0)) {
cVar1 = (**(code **)(*local_1c + 0xc))();
if ((cVar1 != '\0') && (g_lobbyReleaseFn != (void *)0x0)) {
(*g_lobbyReleaseFn)(&local_20);
}
}
if (isCurrentLobby) {
local_24 = Multiplayer::ConstLobby::vftable;
local_20 = 0;
local_1c = GHIDRA_CAST<int *>(0x0);
local_8 = 3;
(GHIDRA_CAST<std::shared_ptr *>((&local_20)))->std::shared_ptr::assign(&g_multiplayerLobbyPtr);
local_24 = Multiplayer::Lobby::vftable;
local_8 = 4;
lobbySteam = (void *)0x0;
if (local_20 != 0) {
lobbySteam = (void *)__RTDynamicCast(local_20,0,
&Multiplayer::LobbyImplBase::RTTI_Type_Descriptor,
&Multiplayer::LobbySteam::RTTI_Type_Descriptor,0);
}
(GHIDRA_CAST<Lobby *>((lobbySteam)))->Lobby::refresh_members();
local_24 = Multiplayer::ConstLobby::vftable;
local_8 = 5;
if (local_1c != GHIDRA_CAST<int *>(0x0)) {
cVar1 = (**(code **)(*local_1c + 0xc))();
if ((cVar1 != '\0') && (g_lobbyReleaseFn != (void *)0x0)) {
(*g_lobbyReleaseFn)(&local_20);
}
}
}
}
ExceptionList = local_10;
return;
}
// 00a722c0
void KAGE::Network::MultiplayerManager::update_lobby_members()
{
char isLobbyValid;
int extraout_EAX;
int iVar1;
undefined4 memberIdHigh;
code *extraout_ECX;
undefined4 memberIdLow;
code *pcVar2;
uint uVar3;
code *pcVar4;
void *pvVar5;
void *ptr;
undefined8 memberId;
undefined4 command;
void *commandArgsBegin;
undefined4 uStack_54;
int commandArgsCapacityEnd;
undefined4 uStack_4c;
undefined4 local_48;
undefined4 queuedCommandType;
void *queuedArgsBegin;
int queuedArgsEnd;
code *local_38;
code *local_34;
undefined4 *local_30;
undefined8 local_2c;
undefined8 local_24;
undefined4 *local_1c;
code *local_18;
undefined4 *local_14;
void *local_10;
undefined1 *puStack_c;
undefined4 local_8;
int lobbyMemberIds;
int *queueCount;
local_8 = 0xffffffff;
puStack_c = &LAB_00b1383d;
local_10 = ExceptionList;
ExceptionList = &local_10;
if ((*GHIDRA_CAST<int **>((GHIDRA_CAST<char *>(this) + 0x88)) != GHIDRA_CAST<int *>(0x0)) &&
(isLobbyValid = (**(code **)(**GHIDRA_CAST<int **>((GHIDRA_CAST<char *>(this) + 0x88)) + 0xc))
(__security_cookie ^ GHIDRA_INT(register0x00000010) - 4U),
isLobbyValid != '\0')) {
uVar3 = 0;
iVar1 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x90));
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x94)) - iVar1 >> 3 != 0) {
do {
local_24 = CONCAT44((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_24)) + 0x4))),System::UserProfileBase::vftable);
(GHIDRA_CAST<UserProfile *>(((void *)(iVar1 + uVar3 * 8))))->UserProfile::find_or_create();
local_8 = 0;
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_24)) + 0x0))) = System::UserProfile::vftable;
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_24)) + 0x4))) = GHIDRA_CAST<int *>(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)) {
System::UserProfile::load_steam_avatar(&local_24);
}
local_8 = 0xffffffff;
iVar1 = FUN_00a28590(&local_24);
local_24 = CONCAT44((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_24)) + 0x4))),System::UserProfileBase::vftable);
if (iVar1 == -1) goto LAB_00a725ee;
uVar3 = uVar3 + 1;
iVar1 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x90));
} while (uVar3 < GHIDRA_UINT((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x94)) - iVar1 >> 3)));
}
local_38 = (code *)0x0;
local_34 = (code *)0x0;
local_30 = GHIDRA_CAST<undefined4 *>(0x0);
local_8 = 1;
Multiplayer::Lobby::get_members((void *)(GHIDRA_INT(this) + 0x10),&local_38,0);
local_1c = GHIDRA_CAST<undefined4 *>((GHIDRA_INT(local_34) - GHIDRA_INT(local_38) >> 3));
local_14 = GHIDRA_CAST<undefined4 *>(0x0);
if (local_1c != GHIDRA_CAST<undefined4 *>(0x0)) {
pcVar2 = local_38;
do {
iVar1 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x88));
local_18 = pcVar2;
if (iVar1 != 0) {
lobbyMemberIds = *GHIDRA_CAST<int *>((iVar1 + 0x10));
uVar3 = 0;
if (*GHIDRA_CAST<int *>((iVar1 + 0x14)) - lobbyMemberIds >> 3 != 0) {
do {
memberId = FUN_00a23920();
pcVar2 = extraout_ECX;
if ((*GHIDRA_CAST<int *>((lobbyMemberIds + uVar3 * 8)) == GHIDRA_INT(memberId)) &&
(*GHIDRA_CAST<int *>((lobbyMemberIds + 4 + uVar3 * 8)) == GHIDRA_INT(((ulonglong)memberId >> 0x20)))) {
if (uVar3 != 0xffffffff) {
local_18 = extraout_ECX;
goto LAB_00a72464;
}
break;
}
uVar3 = uVar3 + 1;
} while (uVar3 < GHIDRA_UINT((*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x88)) + 0x14)) - lobbyMemberIds >>
3)));
}
}
iVar1 = *GHIDRA_CAST<int *>((pcVar2 + 4));
if (iVar1 == 0) {
local_24 = 0;
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_24)) + 0x4))) = GHIDRA_CAST<int *>(0x0);
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_24)) + 0x0))) = GHIDRA_CAST<undefined **>(0x0);
memberIdHigh = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_24)) + 0x4)));
memberIdLow = GHIDRA_CAST<undefined **>(local_24);
}
else {
memberIdHigh = *GHIDRA_CAST<undefined4 *>((iVar1 + 0xc));
memberIdLow = *GHIDRA_CAST<undefined4 *>((iVar1 + 8));
}
local_2c = CONCAT44(memberIdHigh,memberIdLow);
::Multiplayer::handle_member_status((void *)(GHIDRA_INT(this) + 0x10),&local_2c,2);
LAB_00a72464:
pcVar2 = local_18 + 8;
local_14 = GHIDRA_CAST<undefined4 *>((GHIDRA_INT(local_14) + 1));
} while (local_14 < local_1c);
local_18 = pcVar2;
}
pcVar2 = local_38;
command = 3;
commandArgsBegin = (void *)0x0;
uStack_54 = 0;
commandArgsCapacityEnd = 0;
uStack_4c = 0;
local_48 = 0;
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 2;
local_2c = 0;
std::vector<8byte>::_Emplace_reallocate(0,&local_2c);
this->CommandThread::post_command(&command);
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 1;
if (commandArgsBegin != (void *)0x0) {
uVar3 = (commandArgsCapacityEnd - GHIDRA_INT(commandArgsBegin) >> 3) * 8;
pvVar5 = commandArgsBegin;
if (0xfff < uVar3) {
pvVar5 = *(void **)(GHIDRA_CAST<char *>(commandArgsBegin) + -4);
uVar3 = uVar3 + 0x23;
if (0x1f < GHIDRA_UINT((GHIDRA_INT(commandArgsBegin) + (-4 - GHIDRA_INT(pvVar5))))) goto LAB_00a7271d;
}
operator_delete(pvVar5,uVar3);
}
command = 6;
commandArgsBegin = (void *)0x0;
uStack_54 = 0;
commandArgsCapacityEnd = 0;
uStack_4c = 0;
local_48 = 0;
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 3;
local_2c = 1;
std::vector<8byte>::_Emplace_reallocate(0,&local_2c);
uStack_4c = *GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(this) + 0x9c));
local_48 = *GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(this) + 0xa0));
this->CommandThread::post_command(&command);
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 1;
if (commandArgsBegin != (void *)0x0) {
uVar3 = (commandArgsCapacityEnd - GHIDRA_INT(commandArgsBegin) >> 3) * 8;
pvVar5 = commandArgsBegin;
if (0xfff < uVar3) {
pvVar5 = *(void **)(GHIDRA_CAST<char *>(commandArgsBegin) + -4);
uVar3 = uVar3 + 0x23;
if (0x1f < GHIDRA_UINT((GHIDRA_INT(commandArgsBegin) + (-4 - GHIDRA_INT(pvVar5))))) goto LAB_00a7271d;
}
operator_delete(pvVar5,uVar3);
}
if (pcVar2 != (code *)0x0) {
local_8 = 4;
pcVar4 = pcVar2;
if (pcVar2 != local_34) {
do {
(*(code *)**GHIDRA_CAST<undefined4 **>(pcVar4))(0);
pcVar4 = pcVar4 + 8;
} while (pcVar4 != local_34);
}
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 0xff;
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x1))) = 0xffffff;
uVar3 = (GHIDRA_INT(local_30) - GHIDRA_INT(pcVar2) >> 3) * 8;
pcVar4 = pcVar2;
if (0xfff < uVar3) {
pcVar4 = *(code **)(pcVar2 + -4);
uVar3 = uVar3 + 0x23;
if ((code *)0x1f < pcVar2 + (-4 - GHIDRA_INT(pcVar4))) goto LAB_00a7271d;
}
operator_delete(pcVar4,uVar3);
}
}
LAB_00a725ee:
pvVar5 = (void *)0x0;
queuedCommandType = 0;
pcVar2 = (code *)0x0;
queuedArgsBegin = (void *)0x0;
queuedArgsEnd = 0;
local_38 = (code *)0x0;
local_34 = (code *)0x0;
local_30 = GHIDRA_CAST<undefined4 *>(0x0);
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 5;
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x1))) = 0;
local_24 = CONCAT44(GHIDRA_INT(this) + 0x78,GHIDRA_CAST<undefined **>(local_24));
while ((**(code **)(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x78)) + 0xc))(0xffffffff),
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x74)) != 0) {
local_14 = *(undefined4 **)
(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x68)) +
(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x6c)) - 1U & *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(this) + 0x70))) * 4);
queuedCommandType = *local_14;
if (&queuedArgsBegin != (void **)(local_14 + 1)) {
local_1c = GHIDRA_CAST<undefined4 *>(local_14[1]);
local_18 = (code *)(local_14[2] - GHIDRA_INT(local_1c));
if (GHIDRA_UINT((GHIDRA_INT(pcVar2) - GHIDRA_INT(pvVar5) >> 3)) < GHIDRA_UINT((GHIDRA_INT(local_18) >> 3))) {
std::vector<8byte>::_Clear_and_reserve(GHIDRA_INT(local_18) >> 3);
pcVar2 = local_38;
pvVar5 = queuedArgsBegin;
}
memmove(pvVar5,local_1c,(size_t)local_18);
queuedArgsEnd = GHIDRA_INT(local_18) + GHIDRA_INT(pvVar5);
}
local_30 = GHIDRA_CAST<undefined4 *>(local_14[5]);
local_34 = (code *)local_14[4];
iVar1 = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x68)) +
(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x6c)) - 1U & *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(this) + 0x70))) * 4));
*GHIDRA_CAST<undefined4 *>((iVar1 + 0x10)) = 0;
*GHIDRA_CAST<undefined4 *>((iVar1 + 0x14)) = 0;
local_1c = local_30;
local_18 = local_34;
std::vector<Vector>::_Tidy();
queueCount = GHIDRA_CAST<int *>((GHIDRA_INT(this) + 0x74));
*queueCount = *queueCount + -1;
if (*queueCount == 0) {
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(this) + 0x70)) = 0;
}
else {
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x70)) = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x70)) + 1;
}
(**(code **)(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x78)) + 0x10))();
(*local_18)(0,GHIDRA_INT(this) + 0x10,local_1c);
}
(**(code **)(*(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_24)) + 0x4))) + 0x10))();
if (pvVar5 != (void *)0x0) {
uVar3 = GHIDRA_INT(pcVar2) - GHIDRA_INT(pvVar5) & 0xfffffff8;
ptr = pvVar5;
if (0xfff < uVar3) {
ptr = *(void **)(GHIDRA_CAST<char *>(pvVar5) + -4);
uVar3 = uVar3 + 0x23;
if (0x1f < GHIDRA_UINT((GHIDRA_INT(pvVar5) + (-4 - GHIDRA_INT(ptr))))) {
LAB_00a7271d:
/* WARNING: Subroutine does not return */
_invalid_parameter_noinfo_noreturn();
}
}
operator_delete(ptr,uVar3);
}
ExceptionList = local_10;
return;
}
// 00a72a20
void KAGE::Network::MultiplayerManager::join_lobby(void *lobby, int unknown, void *userData)
{
char isInLobby;
void *allocBlock;
uint allocSize;
undefined4 command;
void *commandArgsBegin;
undefined4 *commandArgsEnd;
undefined4 *commandArgsCap;
code *commandCallback;
void *commandUserData;
undefined8 arg;
void *local_10;
undefined1 *puStack_c;
undefined4 local_8;
int lobbyId;
local_8 = 0xffffffff;
puStack_c = &LAB_00b138b5;
local_10 = ExceptionList;
ExceptionList = &local_10;
if (*GHIDRA_CAST<int **>((GHIDRA_CAST<char *>(this) + 0x14)) != GHIDRA_CAST<int *>(0x0)) {
isInLobby = (**(code **)(**GHIDRA_CAST<int **>((GHIDRA_CAST<char *>(this) + 0x14)) + 0xc))
(__security_cookie ^ GHIDRA_INT(register0x00000010) - 4U);
if (isInLobby != '\0') {
command = 3;
commandArgsBegin = (void *)0x0;
commandArgsEnd = GHIDRA_CAST<undefined4 *>(0x0);
commandArgsCap = GHIDRA_CAST<undefined4 *>(0x0);
commandCallback = (code *)0x0;
commandUserData = (void *)0x0;
local_8 = 0;
arg = 0;
std::vector<8byte>::_Emplace_reallocate(0,&arg);
this->CommandThread::post_command(&command);
local_8 = 0xffffffff;
if (commandArgsBegin != (void *)0x0) {
allocSize = (GHIDRA_INT(commandArgsCap) - GHIDRA_INT(commandArgsBegin) >> 3) * 8;
allocBlock = commandArgsBegin;
if (0xfff < allocSize) {
allocBlock = *(void **)(GHIDRA_CAST<char *>(commandArgsBegin) + -4);
allocSize = allocSize + 0x23;
if (0x1f < GHIDRA_UINT((GHIDRA_INT(commandArgsBegin) + (-4 - GHIDRA_INT(allocBlock))))) goto LAB_00a72b9e;
}
operator_delete(allocBlock,allocSize);
}
}
}
command = 2;
commandArgsBegin = (void *)0x0;
commandArgsEnd = GHIDRA_CAST<undefined4 *>(0x0);
commandArgsCap = GHIDRA_CAST<undefined4 *>(0x0);
commandCallback = (code *)0x0;
commandUserData = (void *)0x0;
local_8 = 1;
arg = 1;
std::vector<8byte>::_Emplace_reallocate(0,&arg);
lobbyId = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(lobby) + 4));
if (lobbyId == 0) {
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(arg)) + 0x4))) = 0;
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(arg)) + 0x0))) = 0;
}
else {
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(arg)) + 0x0))) = *GHIDRA_CAST<undefined4 *>((lobbyId + 8));
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(arg)) + 0x4))) = *GHIDRA_CAST<undefined4 *>((lobbyId + 0xc));
}
if (commandArgsEnd == commandArgsCap) {
std::vector<8byte>::_Emplace_reallocate(commandArgsEnd,&arg);
}
else {
*commandArgsEnd = (undefined4)arg;
commandArgsEnd[1] = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(arg)) + 0x4)));
commandArgsEnd = commandArgsEnd + 2;
}
commandUserData = userData;
commandCallback = FUN_00908660;
this->CommandThread::post_command(&command);
if (commandArgsBegin != (void *)0x0) {
allocSize = GHIDRA_INT(commandArgsCap) - GHIDRA_INT(commandArgsBegin) & 0xfffffff8;
allocBlock = commandArgsBegin;
if (0xfff < allocSize) {
allocBlock = *(void **)(GHIDRA_CAST<char *>(commandArgsBegin) + -4);
allocSize = allocSize + 0x23;
if (0x1f < GHIDRA_UINT((GHIDRA_INT(commandArgsBegin) + (-4 - GHIDRA_INT(allocBlock))))) {
LAB_00a72b9e:
/* WARNING: Subroutine does not return */
_invalid_parameter_noinfo_noreturn();
}
}
operator_delete(allocBlock,allocSize);
}
ExceptionList = local_10;
return;
}