Files
isaac-port/generated-src/loot_list.cpp
T
shweetandClaude Opus 5.5 3ce74c6e2d 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>
2026-11-19 21:10:23 -05:00

73 lines
2.7 KiB
C++

#include "classes.h"
// 006c20e0
LootList::LootList(void *other)
{
undefined4 uVar1;
undefined4 uVar2;
undefined4 uVar3;
undefined4 *puVar4;
int iVar5;
void *newBlock;
uint endOffset;
int map;
uint offset;
void *local_1c;
undefined1 *puStack_18;
undefined4 local_14;
undefined4 *dstEntry;
uint mapSize;
local_14 = 0xffffffff;
puStack_18 = &LAB_00afa935;
local_1c = ExceptionList;
ExceptionList = &local_1c;
*GHIDRA_CAST<undefined4 *>(this) = 0;
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(this) + 4)) = 0;
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(this) + 8)) = 0;
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(this) + 0xc)) = 0;
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(this) + 0x10)) = 0;
puVar4 = operator_new(8);
*puVar4 = this;
puVar4[1] = 0;
*GHIDRA_CAST<undefined4 **>(this) = puVar4;
offset = *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(other) + 0xc));
endOffset = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(other) + 0x10)) + offset;
local_14 = 1;
if (offset != endOffset) {
iVar5 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x10));
do {
puVar4 = *(undefined4 **)
(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(other) + 4)) + (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(other) + 8)) - 1U & offset) * 4);
mapSize = *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(this) + 8));
if (mapSize <= iVar5 + 1U) {
std::deque<LootEntry>::_Growmap(mapSize);
iVar5 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x10));
mapSize = *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(this) + 8));
}
*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(this) + 0xc)) = *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(this) + 0xc)) & mapSize - 1;
map = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 4));
iVar5 = (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0xc)) + iVar5 & mapSize - 1) * 4;
if (*GHIDRA_CAST<int *>((iVar5 + map)) == 0) {
newBlock = operator_new(0x14);
*(void **)(iVar5 + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 4))) = newBlock;
map = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 4));
}
dstEntry = *GHIDRA_CAST<undefined4 **>((iVar5 + map));
offset = offset + 1;
uVar1 = puVar4[1];
uVar2 = puVar4[2];
uVar3 = puVar4[3];
*dstEntry = *puVar4;
dstEntry[1] = uVar1;
dstEntry[2] = uVar2;
dstEntry[3] = uVar3;
dstEntry[4] = puVar4[4];
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x10)) = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x10)) + 1;
iVar5 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x10));
} while (offset != endOffset);
}
ExceptionList = local_1c;
return;
}