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:
1 parent
2ff2d5d87f
commit
3ce74c6e2d
331 files changed
+485
-7835
No files matched your search
@@ -0,0 +1,127 @@
|
||||
#include "classes.h"
|
||||
|
||||
// 00a71c40
|
||||
void Lobby::refresh_members()
|
||||
{
|
||||
char cVar1;
|
||||
uint uVar2;
|
||||
int iVar3;
|
||||
void *ptr;
|
||||
uint memberCount;
|
||||
int iVar4;
|
||||
bool bVar5;
|
||||
int *oldMember;
|
||||
int oldMembersEnd;
|
||||
undefined4 memberEvent;
|
||||
void *local_30;
|
||||
undefined4 uStack_2c;
|
||||
undefined **ppuStack_28;
|
||||
int iStack_24;
|
||||
int *local_20;
|
||||
undefined8 local_1c;
|
||||
void *local_10;
|
||||
undefined1 *puStack_c;
|
||||
undefined4 local_8;
|
||||
int *members;
|
||||
|
||||
local_8 = 0xffffffff;
|
||||
puStack_c = &LAB_00b1371d;
|
||||
local_10 = ExceptionList;
|
||||
uVar2 = __security_cookie ^ GHIDRA_INT(register0x00000010) - 4U;
|
||||
ExceptionList = &local_10;
|
||||
members = GHIDRA_CAST<int *>((GHIDRA_INT(this) + 0x10));
|
||||
local_1c = (ulonglong)GHIDRA_UINT(local_1c);
|
||||
FUN_00915d70(members);
|
||||
local_8 = 0;
|
||||
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x14)) = *members;
|
||||
(**(code **)(*GHIDRA_CAST<int *>(this) + 0x18))(members,uVar2);
|
||||
memberCount = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x14)) - *members >> 3;
|
||||
bVar5 = oldMembersEnd - GHIDRA_INT(oldMember) >> 3 != memberCount;
|
||||
uVar2 = 0;
|
||||
if (memberCount != 0) {
|
||||
iVar4 = *members - GHIDRA_INT(oldMember);
|
||||
do {
|
||||
if (bVar5) goto LAB_00a71cd9;
|
||||
if ((*oldMember == *GHIDRA_CAST<int *>((iVar4 + GHIDRA_INT(oldMember)))) &&
|
||||
(oldMember[1] == *GHIDRA_CAST<int *>((iVar4 + 4 + GHIDRA_INT(oldMember))))) {
|
||||
bVar5 = false;
|
||||
}
|
||||
else {
|
||||
bVar5 = true;
|
||||
}
|
||||
uVar2 = uVar2 + 1;
|
||||
oldMember = oldMember + 2;
|
||||
} while (uVar2 < memberCount);
|
||||
}
|
||||
if (bVar5) {
|
||||
LAB_00a71cd9:
|
||||
cVar1 = (**(code **)(*GHIDRA_CAST<int *>(this) + 0xc))();
|
||||
if (cVar1 == '\0') goto LAB_00a71d47;
|
||||
ppuStack_28 = KAGE::Network::Multiplayer::ConstLobby::vftable;
|
||||
iStack_24 = 0;
|
||||
local_20 = GHIDRA_CAST<int *>(0x0);
|
||||
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 1;
|
||||
(GHIDRA_CAST<std::shared_ptr *>((&iStack_24)))->std::shared_ptr::assign(&g_multiplayerLobbyPtr);
|
||||
local_8 = (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(local_8))) + 0x1))) << 8;
|
||||
uVar2 = 7;
|
||||
ppuStack_28 = KAGE::Network::Multiplayer::Lobby::vftable;
|
||||
if (iStack_24 == 0) {
|
||||
local_1c = 0;
|
||||
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_1c)) + 0x4))) = 0;
|
||||
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_1c)) + 0x0))) = 0;
|
||||
iVar4 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_1c)) + 0x4)));
|
||||
iVar3 = GHIDRA_UINT(local_1c);
|
||||
}
|
||||
else {
|
||||
iVar4 = *GHIDRA_CAST<int *>((iStack_24 + 0xc));
|
||||
iVar3 = *GHIDRA_CAST<int *>((iStack_24 + 8));
|
||||
}
|
||||
if ((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 8)) == iVar3) && (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0xc)) == iVar4)) {
|
||||
bVar5 = true;
|
||||
goto LAB_00a71d4c;
|
||||
}
|
||||
}
|
||||
else {
|
||||
LAB_00a71d47:
|
||||
uVar2 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_1c)) + 0x4)));
|
||||
}
|
||||
bVar5 = false;
|
||||
LAB_00a71d4c:
|
||||
if ((uVar2 & 1) != 0) {
|
||||
ppuStack_28 = KAGE::Network::Multiplayer::ConstLobby::vftable;
|
||||
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 2;
|
||||
if (local_20 != GHIDRA_CAST<int *>(0x0)) {
|
||||
cVar1 = (**(code **)(*local_20 + 0xc))();
|
||||
if ((cVar1 != '\0') && (g_lobbyReleaseFn != (void *)0x0)) {
|
||||
(*g_lobbyReleaseFn)(&iStack_24);
|
||||
}
|
||||
}
|
||||
local_8 = (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(local_8))) + 0x1))) << 8;
|
||||
}
|
||||
if (bVar5) {
|
||||
memberEvent = 1;
|
||||
local_30 = (void *)0x0;
|
||||
uStack_2c = 0;
|
||||
ppuStack_28 = GHIDRA_CAST<undefined **>(0x0);
|
||||
iStack_24 = 0;
|
||||
local_20 = GHIDRA_CAST<int *>(0x0);
|
||||
local_8 = CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x1))),3);
|
||||
FUN_00a2a5a0(&memberEvent);
|
||||
if (local_30 != (void *)0x0) {
|
||||
uVar2 = GHIDRA_INT(ppuStack_28) - GHIDRA_INT(local_30) & 0xfffffff8;
|
||||
ptr = local_30;
|
||||
if (0xfff < uVar2) {
|
||||
ptr = *(void **)(GHIDRA_CAST<char *>(local_30) + -4);
|
||||
uVar2 = uVar2 + 0x23;
|
||||
if (0x1f < GHIDRA_UINT((GHIDRA_INT(local_30) + (-4 - GHIDRA_INT(ptr))))) {
|
||||
/* WARNING: Subroutine does not return */
|
||||
_invalid_parameter_noinfo_noreturn();
|
||||
}
|
||||
}
|
||||
operator_delete(ptr,uVar2);
|
||||
}
|
||||
}
|
||||
std::vector<Vector>::_Tidy();
|
||||
ExceptionList = local_10;
|
||||
return;
|
||||
}
|
||||
Reference in new issue
Block a user