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,58 @@
|
||||
#include "classes.h"
|
||||
|
||||
// 00724bd0
|
||||
std_string * ItemConfig_Card::get_display_desc(std_string *outDescription, int unused)
|
||||
{
|
||||
int language;
|
||||
std_string *text;
|
||||
std_string *lengthCursor;
|
||||
byte local_5;
|
||||
char *lengthChar;
|
||||
Manager *manager;
|
||||
|
||||
manager = g_manager;
|
||||
if ((this->desc)._size == 0) {
|
||||
outDescription->_buf[0] = '\0';
|
||||
outDescription->_buf[1] = '\0';
|
||||
outDescription->_buf[2] = '\0';
|
||||
outDescription->_buf[3] = '\0';
|
||||
outDescription->_size = 0;
|
||||
outDescription->_capacity = 0xf;
|
||||
outDescription->_buf[0] = '\0';
|
||||
outDescription->_size = 0;
|
||||
outDescription->_buf[0] = '\0';
|
||||
return outDescription;
|
||||
}
|
||||
text = &this->desc;
|
||||
if (0xf < (this->desc)._capacity) {
|
||||
text = *GHIDRA_CAST<std_string **>(text->_buf);
|
||||
}
|
||||
language = *GHIDRA_CAST<int *>(&g_manager->_stringTable);
|
||||
if (text->_buf[0] == '#') {
|
||||
local_5 = 0;
|
||||
StringTable::get_string
|
||||
(&g_manager->_stringTable,GHIDRA_CAST<byte *>("PocketItems"),language,GHIDRA_CAST<byte *>((text->_buf + 1)),
|
||||
&local_5);
|
||||
if (local_5 == 0) {
|
||||
local_5 = 0;
|
||||
text = (std_string *)
|
||||
StringTable::get_string
|
||||
(&manager->_stringTable,GHIDRA_CAST<byte *>("PocketItems"),language,
|
||||
GHIDRA_CAST<byte *>((text->_buf + 1)),&local_5);
|
||||
}
|
||||
}
|
||||
outDescription->_buf[0] = '\0';
|
||||
outDescription->_buf[1] = '\0';
|
||||
outDescription->_buf[2] = '\0';
|
||||
outDescription->_buf[3] = '\0';
|
||||
outDescription->_size = 0;
|
||||
outDescription->_capacity = 0xf;
|
||||
outDescription->_buf[0] = '\0';
|
||||
lengthCursor = text;
|
||||
do {
|
||||
lengthChar = lengthCursor->_buf;
|
||||
lengthCursor = GHIDRA_CAST<std_string *>((lengthCursor->_buf + 1));
|
||||
} while (*lengthChar != '\0');
|
||||
(GHIDRA_CAST<std::string *>((outDescription->_buf)))->std::string::assign(GHIDRA_CAST<byte *>(text),GHIDRA_INT(lengthCursor) - GHIDRA_INT((text->_buf + 1)));
|
||||
return outDescription;
|
||||
}
|
||||
Reference in new issue
Block a user