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,166 @@
|
||||
#include "classes.h"
|
||||
|
||||
// 00a5f770
|
||||
undefined1 KAGE::EosManager::FUN_00a649b0()
|
||||
{
|
||||
char cVar1;
|
||||
int iVar2;
|
||||
uint extraout_EAX;
|
||||
uint uVar3;
|
||||
undefined4 lobbyInterface;
|
||||
int in_ECX;
|
||||
char *lengthCursor;
|
||||
undefined8 notifyId;
|
||||
undefined1 auStack_492 [2];
|
||||
undefined1 auStack_48c [8];
|
||||
undefined4 initOptions;
|
||||
undefined4 local_480;
|
||||
undefined4 local_47c;
|
||||
undefined4 local_478;
|
||||
undefined4 productName;
|
||||
undefined4 productVersion;
|
||||
undefined4 local_46c;
|
||||
undefined4 local_468;
|
||||
undefined4 local_464;
|
||||
undefined4 uStack_460;
|
||||
char *productId;
|
||||
char *sandboxId;
|
||||
char *clientId;
|
||||
char *clientSecret;
|
||||
undefined4 uStack_44c;
|
||||
char *encryptionKey;
|
||||
undefined4 uStack_444;
|
||||
undefined4 uStack_440;
|
||||
char *deploymentId;
|
||||
undefined4 uStack_438;
|
||||
undefined4 platformFlags;
|
||||
undefined4 uStack_430;
|
||||
CHAR *cacheDirectory;
|
||||
undefined8 uStack_428;
|
||||
undefined8 uStack_420;
|
||||
undefined4 uStack_418;
|
||||
CHAR tempPath [1032];
|
||||
uint local_c;
|
||||
|
||||
local_c = __security_cookie ^ GHIDRA_UINT(auStack_48c);
|
||||
if ((*GHIDRA_CAST<byte *>((in_ECX + 4)) & 1) == 0) {
|
||||
FUN_00a24530();
|
||||
FUN_00a24530();
|
||||
lengthCursor = DAT_00c79a14;
|
||||
do {
|
||||
cVar1 = *lengthCursor;
|
||||
lengthCursor = lengthCursor + 1;
|
||||
} while (cVar1 != '\0');
|
||||
if (0x40 < GHIDRA_UINT((GHIDRA_INT(lengthCursor) - GHIDRA_INT((DAT_00c79a14 + 1))))) {
|
||||
KAGE_LogMessage(0x10,(byte *)
|
||||
"Specified product ID is not valid: It is longer than the allowed size of %d\n"
|
||||
);
|
||||
}
|
||||
lengthCursor = DAT_00c79a18;
|
||||
do {
|
||||
cVar1 = *lengthCursor;
|
||||
lengthCursor = lengthCursor + 1;
|
||||
} while (cVar1 != '\0');
|
||||
if (0x40 < GHIDRA_UINT((GHIDRA_INT(lengthCursor) - GHIDRA_INT((DAT_00c79a18 + 1))))) {
|
||||
KAGE_LogMessage(0x10,(byte *)
|
||||
"Specified sandbox ID is not valid: It is longer than the allowed size of %d\n"
|
||||
);
|
||||
}
|
||||
lengthCursor = DAT_00c79a1c;
|
||||
do {
|
||||
cVar1 = *lengthCursor;
|
||||
lengthCursor = lengthCursor + 1;
|
||||
} while (cVar1 != '\0');
|
||||
if (0x40 < GHIDRA_UINT((GHIDRA_INT(lengthCursor) - GHIDRA_INT((DAT_00c79a1c + 1))))) {
|
||||
KAGE_LogMessage(0x10,(byte *)
|
||||
"Specified deployment ID is not valid: It is longer than the allowed size of %d\n"
|
||||
);
|
||||
}
|
||||
lengthCursor = DAT_00c79a20;
|
||||
do {
|
||||
cVar1 = *lengthCursor;
|
||||
lengthCursor = lengthCursor + 1;
|
||||
} while (cVar1 != '\0');
|
||||
if (0x40 < GHIDRA_UINT((GHIDRA_INT(lengthCursor) - GHIDRA_INT((DAT_00c79a20 + 1))))) {
|
||||
KAGE_LogMessage(0x10,(byte *)
|
||||
"Specified client ID is not valid: It is longer than the allowed size of %d\n"
|
||||
);
|
||||
}
|
||||
lengthCursor = DAT_00c79a24;
|
||||
do {
|
||||
cVar1 = *lengthCursor;
|
||||
lengthCursor = lengthCursor + 1;
|
||||
} while (cVar1 != '\0');
|
||||
if (0x40 < GHIDRA_UINT((GHIDRA_INT(lengthCursor) - GHIDRA_INT((DAT_00c79a24 + 1))))) {
|
||||
KAGE_LogMessage(0x10,(byte *)
|
||||
"Specified client secret is not valid: It is longer than the allowed size of %d\n"
|
||||
);
|
||||
}
|
||||
lengthCursor = DAT_00c79a28;
|
||||
do {
|
||||
cVar1 = *lengthCursor;
|
||||
lengthCursor = lengthCursor + 1;
|
||||
} while (cVar1 != '\0');
|
||||
if (0x40 < GHIDRA_UINT((GHIDRA_INT(lengthCursor) - GHIDRA_INT((DAT_00c79a28 + 1))))) {
|
||||
KAGE_LogMessage(0x10,(byte *)
|
||||
"Specified encryption key is not valid: It is longer than the allowed size of %d\n"
|
||||
);
|
||||
}
|
||||
productName = DAT_00c79a0c;
|
||||
productVersion = DAT_00c79a10;
|
||||
initOptions = 4;
|
||||
local_480 = 0;
|
||||
local_47c = 0;
|
||||
local_478 = 0;
|
||||
local_46c = 0;
|
||||
local_468 = 0;
|
||||
local_464 = 0;
|
||||
iVar2 = _EOS_Initialize_4();
|
||||
if (iVar2 != 0) {
|
||||
_EOS_EResult_ToString_4();
|
||||
KAGE_LogMessage(8,GHIDRA_CAST<byte *>("Failed to initialize EOS: %s\n"));
|
||||
return extraout_EAX & 0xffffff00;
|
||||
}
|
||||
productId = DAT_00c79a14;
|
||||
sandboxId = DAT_00c79a18;
|
||||
deploymentId = DAT_00c79a1c;
|
||||
clientId = DAT_00c79a20;
|
||||
clientSecret = DAT_00c79a24;
|
||||
encryptionKey = DAT_00c79a28;
|
||||
platformFlags = 2;
|
||||
if (DAT_00c79a2c != '\0') {
|
||||
platformFlags = 0x40;
|
||||
}
|
||||
uStack_460 = 0;
|
||||
uStack_438 = 0;
|
||||
uStack_428 = 0;
|
||||
uStack_420 = 0;
|
||||
uStack_418 = 0;
|
||||
local_464 = 0xe;
|
||||
uStack_44c = 0;
|
||||
uStack_444 = 0;
|
||||
uStack_440 = 0;
|
||||
uStack_430 = 0;
|
||||
memset(tempPath,0,0x400);
|
||||
GetTempPathA(0x400,tempPath);
|
||||
cacheDirectory = tempPath;
|
||||
iVar2 = _EOS_Platform_Create_4();
|
||||
*GHIDRA_CAST<int *>((in_ECX + 0x14)) = iVar2;
|
||||
if (iVar2 == 0) {
|
||||
KAGE_LogMessage(8,GHIDRA_CAST<byte *>("Failed to acquire EOS platform handle object\n"));
|
||||
uVar3 = _EOS_Shutdown_0();
|
||||
return uVar3 & 0xffffff00;
|
||||
}
|
||||
(**(code **)(*GHIDRA_CAST<int *>((in_ECX + 0x30)) + 4))();
|
||||
lobbyInterface = _EOS_Platform_GetLobbyInterface_4(g_eosPlatform);
|
||||
notifyId = _EOS_Lobby_AddNotifyLobbyInviteAccepted_16(lobbyInterface);
|
||||
*GHIDRA_CAST<undefined8 *>((in_ECX + 0x40)) = notifyId;
|
||||
lobbyInterface =
|
||||
_EOS_Platform_GetLobbyInterface_4(g_eosPlatform,auStack_492 + -0x12,0,FUN_00a60c50);
|
||||
notifyId = _EOS_Lobby_AddNotifyJoinLobbyAccepted_16(lobbyInterface);
|
||||
local_c = GHIDRA_UINT(notifyId);
|
||||
*GHIDRA_CAST<uint *>((in_ECX + 4)) = *GHIDRA_CAST<uint *>((in_ECX + 4)) | 1;
|
||||
*GHIDRA_CAST<undefined8 *>((in_ECX + 0x48)) = notifyId;
|
||||
}
|
||||
return CONCAT31((int3)(local_c >> 8),1);
|
||||
}
|
||||
Reference in new issue
Block a user