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>
72 lines
3.6 KiB
C++
72 lines
3.6 KiB
C++
#include "classes.h"
|
|
|
|
// 009ef9a0
|
|
byte RichTextSpan::try_merge(void *other)
|
|
{
|
|
int *ownStyle;
|
|
int *otherStyle;
|
|
uint bytesLeft;
|
|
bool isMore;
|
|
uint *otherLength;
|
|
|
|
if (*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x34)) == *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(other) + 0x34))) {
|
|
otherStyle = GHIDRA_CAST<int *>((GHIDRA_INT(other) + 0x20));
|
|
bytesLeft = 0xc;
|
|
ownStyle = GHIDRA_CAST<int *>((GHIDRA_INT(this) + 0x20));
|
|
do {
|
|
if (*ownStyle != *otherStyle) {
|
|
return 0;
|
|
}
|
|
ownStyle = ownStyle + 1;
|
|
otherStyle = otherStyle + 1;
|
|
isMore = 3 < bytesLeft;
|
|
bytesLeft = bytesLeft - 4;
|
|
} while (isMore);
|
|
if ((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x38)) == *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(other) + 0x38))) &&
|
|
(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x3c)) == *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(other) + 0x3c)))) {
|
|
otherLength = GHIDRA_CAST<uint *>((GHIDRA_INT(other) + 0x10));
|
|
if (0xf < *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(other) + 0x14))) {
|
|
other = *(void **)other;
|
|
}
|
|
this->std::string::append(other,*otherLength);
|
|
return 1;
|
|
}
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
// 009f1ef0
|
|
void RichTextSpan::move_construct(void *dest, void *source)
|
|
{
|
|
undefined4 uVar1;
|
|
undefined4 uVar2;
|
|
undefined4 uVar3;
|
|
|
|
*GHIDRA_CAST<undefined4 *>(dest) = 0;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(dest) + 0x10)) = 0;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(dest) + 0x14)) = 0;
|
|
uVar1 = *GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(source) + 4));
|
|
uVar2 = *GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(source) + 8));
|
|
uVar3 = *GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(source) + 0xc));
|
|
*GHIDRA_CAST<undefined4 *>(dest) = *GHIDRA_CAST<undefined4 *>(source);
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(dest) + 4)) = uVar1;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(dest) + 8)) = uVar2;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(dest) + 0xc)) = uVar3;
|
|
*GHIDRA_CAST<undefined8 *>((GHIDRA_CAST<char *>(dest) + 0x10)) = *GHIDRA_CAST<undefined8 *>((GHIDRA_CAST<char *>(source) + 0x10));
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(source) + 0x10)) = 0;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(source) + 0x14)) = 0xf;
|
|
*GHIDRA_CAST<undefined1 *>(source) = 0;
|
|
uVar1 = *GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(source) + 0x1c));
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(dest) + 0x18)) = *GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(source) + 0x18));
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(dest) + 0x1c)) = uVar1;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(dest) + 0x20)) = *GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(source) + 0x20));
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(dest) + 0x24)) = *GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(source) + 0x24));
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(dest) + 0x28)) = *GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(source) + 0x28));
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(dest) + 0x2c)) = *GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(source) + 0x2c));
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(dest) + 0x30)) = *GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(source) + 0x30));
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(dest) + 0x34)) = *GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(source) + 0x34));
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(dest) + 0x38)) = *GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(source) + 0x38));
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(dest) + 0x3c)) = *GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(source) + 0x3c));
|
|
return;
|
|
}
|