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,122 @@
|
||||
#include "classes.h"
|
||||
|
||||
// 004d3080
|
||||
void EntitySaveState::constructor()
|
||||
{
|
||||
*this = (EntitySaveState)0x0;
|
||||
this[8] = (EntitySaveState)0x0;
|
||||
this[9] = (EntitySaveState)0x0;
|
||||
this[1] = (EntitySaveState)0x0;
|
||||
this[2] = (EntitySaveState)0x0;
|
||||
this[3] = (EntitySaveState)0x0;
|
||||
this[4] = (EntitySaveState)0x0;
|
||||
this[5] = (EntitySaveState)0x0;
|
||||
this[6] = (EntitySaveState)0xffffffff;
|
||||
this[7] = (EntitySaveState)0xffffffff;
|
||||
this[10] = (EntitySaveState)g_vectorZero.x;
|
||||
this[0xb] = (EntitySaveState)g_vectorZero.y;
|
||||
this[0xc] = (EntitySaveState)0x0;
|
||||
this[0xd] = (EntitySaveState)0x0;
|
||||
this[0xe] = (EntitySaveState)0x0;
|
||||
this[0xf] = (EntitySaveState)0x0;
|
||||
this[0x10] = (EntitySaveState)0x0;
|
||||
this[0x17] = (EntitySaveState)0x0;
|
||||
this[0x19] = (EntitySaveState)0x0;
|
||||
this[0x1a] = (EntitySaveState)0x0;
|
||||
this[0x1b] = (EntitySaveState)0x0;
|
||||
this[0x1c] = (EntitySaveState)0x0;
|
||||
this[0x12] = (EntitySaveState)0xffffffff;
|
||||
this[0x13] = (EntitySaveState)0xffffffff;
|
||||
this[0x14] = (EntitySaveState)0x42700000;
|
||||
this[0x15] = (EntitySaveState)0x3f800000;
|
||||
this[0x16] = (EntitySaveState)0x3f800000;
|
||||
*GHIDRA_CAST<undefined1 *>((this + 0x18)) = 1;
|
||||
return;
|
||||
}
|
||||
|
||||
// 004d3130
|
||||
void EntitySaveState::copy(void *other)
|
||||
{
|
||||
EntitySaveState EVar1;
|
||||
void *local_10;
|
||||
undefined1 *puStack_c;
|
||||
undefined4 local_8;
|
||||
|
||||
local_8 = 0xffffffff;
|
||||
puStack_c = &LAB_00af3840;
|
||||
local_10 = ExceptionList;
|
||||
ExceptionList = &local_10;
|
||||
*this = *GHIDRA_CAST<EntitySaveState *>(other);
|
||||
this[1] = *GHIDRA_CAST<EntitySaveState *>((GHIDRA_CAST<char *>(other) + 4));
|
||||
this[2] = *GHIDRA_CAST<EntitySaveState *>((GHIDRA_CAST<char *>(other) + 8));
|
||||
this[3] = *GHIDRA_CAST<EntitySaveState *>((GHIDRA_CAST<char *>(other) + 0xc));
|
||||
this[4] = *GHIDRA_CAST<EntitySaveState *>((GHIDRA_CAST<char *>(other) + 0x10));
|
||||
this[5] = *GHIDRA_CAST<EntitySaveState *>((GHIDRA_CAST<char *>(other) + 0x14));
|
||||
this[6] = *GHIDRA_CAST<EntitySaveState *>((GHIDRA_CAST<char *>(other) + 0x18));
|
||||
this[7] = *GHIDRA_CAST<EntitySaveState *>((GHIDRA_CAST<char *>(other) + 0x1c));
|
||||
*GHIDRA_CAST<undefined2 *>((this + 8)) = *GHIDRA_CAST<undefined2 *>((GHIDRA_CAST<char *>(other) + 0x20));
|
||||
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[8])) + 0x2))) = *GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(other) + 0x22));
|
||||
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[8])) + 0x3))) = *GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(other) + 0x23));
|
||||
this[9] = *GHIDRA_CAST<EntitySaveState *>((GHIDRA_CAST<char *>(other) + 0x24));
|
||||
EVar1 = *GHIDRA_CAST<EntitySaveState *>((GHIDRA_CAST<char *>(other) + 0x2c));
|
||||
this[10] = *GHIDRA_CAST<EntitySaveState *>((GHIDRA_CAST<char *>(other) + 0x28));
|
||||
this[0xb] = EVar1;
|
||||
this[0xc] = *GHIDRA_CAST<EntitySaveState *>((GHIDRA_CAST<char *>(other) + 0x30));
|
||||
this[0xd] = *GHIDRA_CAST<EntitySaveState *>((GHIDRA_CAST<char *>(other) + 0x34));
|
||||
this[0xe] = *GHIDRA_CAST<EntitySaveState *>((GHIDRA_CAST<char *>(other) + 0x38));
|
||||
this[0xf] = *GHIDRA_CAST<EntitySaveState *>((GHIDRA_CAST<char *>(other) + 0x3c));
|
||||
this[0x10] = *GHIDRA_CAST<EntitySaveState *>((GHIDRA_CAST<char *>(other) + 0x40));
|
||||
EVar1 = *GHIDRA_CAST<EntitySaveState *>((GHIDRA_CAST<char *>(other) + 0x4c));
|
||||
this[0x12] = *GHIDRA_CAST<EntitySaveState *>((GHIDRA_CAST<char *>(other) + 0x48));
|
||||
this[0x13] = EVar1;
|
||||
this[0x14] = *GHIDRA_CAST<EntitySaveState *>((GHIDRA_CAST<char *>(other) + 0x50));
|
||||
this[0x15] = *GHIDRA_CAST<EntitySaveState *>((GHIDRA_CAST<char *>(other) + 0x54));
|
||||
this[0x16] = *GHIDRA_CAST<EntitySaveState *>((GHIDRA_CAST<char *>(other) + 0x58));
|
||||
this[0x17] = *GHIDRA_CAST<EntitySaveState *>((GHIDRA_CAST<char *>(other) + 0x5c));
|
||||
*GHIDRA_CAST<undefined1 *>((this + 0x18)) = *GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(other) + 0x60));
|
||||
FUN_004d7250(GHIDRA_INT(other) + 100);
|
||||
local_8 = 0;
|
||||
FUN_004d7190(GHIDRA_INT(other) + 0x6c);
|
||||
ExceptionList = local_10;
|
||||
return;
|
||||
}
|
||||
|
||||
// 00827f70
|
||||
void EntitySaveState::set_extra_data(undefined4 param_1)
|
||||
{
|
||||
char isLastReference;
|
||||
uint uVar1;
|
||||
ReferenceCountBase *extraDataRef;
|
||||
undefined4 *in_ECX;
|
||||
void *local_10;
|
||||
undefined1 *puStack_c;
|
||||
undefined4 local_8;
|
||||
|
||||
local_8 = 0xffffffff;
|
||||
puStack_c = &LAB_00af0d44;
|
||||
local_10 = ExceptionList;
|
||||
uVar1 = __security_cookie ^ GHIDRA_INT(register0x00000010) - 4U;
|
||||
ExceptionList = &local_10;
|
||||
extraDataRef = operator_new(0x18);
|
||||
local_8 = 0;
|
||||
if (extraDataRef == GHIDRA_CAST<ReferenceCountBase *>(0x0)) {
|
||||
extraDataRef = GHIDRA_CAST<ReferenceCountBase *>(0x0);
|
||||
}
|
||||
else {
|
||||
(GHIDRA_CAST<ReferenceCountBase *>((extraDataRef)))->ReferenceCountBase::ReferenceCountBase();
|
||||
*GHIDRA_CAST<undefined ***>(extraDataRef) =
|
||||
ReferenceCount<IsaacRepentancePlus::EntitySaveState::ExtraData>::vftable;
|
||||
*GHIDRA_CAST<undefined4 *>((extraDataRef + 0x14)) = param_1;
|
||||
}
|
||||
local_8 = 0xffffffff;
|
||||
if (GHIDRA_CAST<int *>(in_ECX[1]) != GHIDRA_CAST<int *>(0x0)) {
|
||||
isLastReference = (**(code **)(*GHIDRA_CAST<int *>(in_ECX[1]) + 0xc))(uVar1);
|
||||
if ((isLastReference != '\0') && (g_entitySaveStateExtraDataReleaseFn != (void *)0x0)) {
|
||||
(*g_entitySaveStateExtraDataReleaseFn)();
|
||||
}
|
||||
}
|
||||
in_ECX[1] = extraDataRef;
|
||||
*in_ECX = param_1;
|
||||
ExceptionList = local_10;
|
||||
return;
|
||||
}
|
||||
Reference in new issue
Block a user