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,65 @@
|
||||
#include "classes.h"
|
||||
|
||||
// 00a12430
|
||||
void KAGE::Graphics::ImageBase::set_palette(undefined4 param_1, uint param_2)
|
||||
{
|
||||
char cVar1;
|
||||
void *pvVar2;
|
||||
int *in_ECX;
|
||||
int *extraout_ECX;
|
||||
int *piVar3;
|
||||
undefined **stream;
|
||||
void *local_10;
|
||||
undefined1 *puStack_c;
|
||||
undefined4 local_8;
|
||||
|
||||
local_8 = 0xffffffff;
|
||||
puStack_c = &LAB_00b10b9d;
|
||||
local_10 = ExceptionList;
|
||||
ExceptionList = &local_10;
|
||||
cVar1 = (**(code **)(*in_ECX + 8))(__security_cookie ^ GHIDRA_INT(register0x00000010) - 4U);
|
||||
if (cVar1 == '\0') {
|
||||
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("Attempting to set palette on an image that isn\'t indexed\n"));
|
||||
}
|
||||
if (0x100 < param_2) {
|
||||
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("Specified palette is larger than 256 texels in size\n"));
|
||||
}
|
||||
sprintf(&DAT_00c943d8,GHIDRA_CAST<byte *>("%s - Palette"));
|
||||
if (GHIDRA_CAST<int *>(in_ECX[0xb]) != GHIDRA_CAST<int *>(0x0)) {
|
||||
(**(code **)(*GHIDRA_CAST<int *>(in_ECX[0xb]) + 0x34))(1);
|
||||
in_ECX[0xb] = 0;
|
||||
}
|
||||
pvVar2 = operator_new(0x60);
|
||||
if (pvVar2 == (void *)0x0) {
|
||||
piVar3 = GHIDRA_CAST<int *>(0x0);
|
||||
}
|
||||
else {
|
||||
FUN_00a69950();
|
||||
*extraout_ECX = GHIDRA_INT(ImagePalette)::vftable;
|
||||
extraout_ECX[2] = extraout_ECX[2] | 4;
|
||||
extraout_ECX[3] = extraout_ECX[3];
|
||||
piVar3 = extraout_ECX;
|
||||
}
|
||||
in_ECX[0xb] = GHIDRA_INT(piVar3);
|
||||
stream = Filesys::BufferedStream::vftable;
|
||||
local_8 = 0;
|
||||
cVar1 = (**(code **)(*piVar3 + 0x38))(&stream,&DAT_00c943d8);
|
||||
if ((cVar1 == '\0') && (GHIDRA_CAST<int *>(in_ECX[0xb]) != GHIDRA_CAST<int *>(0x0))) {
|
||||
(**(code **)(*GHIDRA_CAST<int *>(in_ECX[0xb]) + 0x34))(1);
|
||||
in_ECX[0xb] = 0;
|
||||
}
|
||||
piVar3 = GHIDRA_CAST<int *>(in_ECX[0xb]);
|
||||
if ((piVar3[0xc] != 0) || (piVar3[0xd] != 0)) {
|
||||
(**(code **)(*piVar3 + 0x44))(0,0);
|
||||
piVar3[0xc] = 0;
|
||||
piVar3[0xd] = 0;
|
||||
piVar3 = GHIDRA_CAST<int *>(in_ECX[0xb]);
|
||||
}
|
||||
if ((piVar3[0xe] != 1) || (piVar3[0xf] != 1)) {
|
||||
(**(code **)(*piVar3 + 0x48))(1,1);
|
||||
piVar3[0xe] = 1;
|
||||
piVar3[0xf] = 1;
|
||||
}
|
||||
ExceptionList = local_10;
|
||||
return;
|
||||
}
|
||||
Reference in new issue
Block a user