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>
119 lines
4.2 KiB
C++
119 lines
4.2 KiB
C++
#include "classes.h"
|
|
|
|
// 0095fd70
|
|
void Cutscene::TemporaryPart::vfunc_1()
|
|
{
|
|
byte *extraout_EAX;
|
|
byte *extraout_EAX_00;
|
|
byte *fontPath;
|
|
void *ptr;
|
|
char *pcVar1;
|
|
uint uVar2;
|
|
char *terminusPath [4];
|
|
uint terminusPathSize;
|
|
uint terminusPathCapacity;
|
|
void *redirectedPath [4];
|
|
uint redirectedPathSize;
|
|
uint redirectedPathCapacity;
|
|
char *pathText [4];
|
|
uint pathTextSize;
|
|
uint pathTextCapacity;
|
|
uint local_14;
|
|
void *local_10;
|
|
undefined1 *puStack_c;
|
|
char *local_8;
|
|
Manager *manager;
|
|
|
|
manager = g_manager;
|
|
local_8 = GHIDRA_CAST<char *>(0xffffffff);
|
|
puStack_c = &LAB_00b0c7f5;
|
|
local_10 = ExceptionList;
|
|
local_14 = __security_cookie ^ GHIDRA_UINT((pathText + 10));
|
|
ExceptionList = &local_10;
|
|
pathText[0] = std::_Allocate(0x20);
|
|
pathTextSize = 0x1b;
|
|
pathTextCapacity = 0x1f;
|
|
builtin_strncpy(pathText[0],"font/TeamMeatFont20Bold.fnt",0x1c);
|
|
local_8 = GHIDRA_CAST<char *>(0x0);
|
|
ModManager::TryRedirectPath
|
|
(&manager->_modManager,GHIDRA_CAST<std_string *>(redirectedPath),GHIDRA_CAST<std_string *>(pathText));
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 1;
|
|
fontPath = extraout_EAX;
|
|
if (0xf < *GHIDRA_CAST<uint *>((extraout_EAX + 0x14))) {
|
|
fontPath = *GHIDRA_CAST<byte **>(extraout_EAX);
|
|
}
|
|
(GHIDRA_CAST<Font *>((GHIDRA_CAST<Font *>((GHIDRA_INT(this) + 0x40)))))->Font::Load(fontPath,0);
|
|
local_8 = GHIDRA_CAST<char *>(((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(local_8))) + 0x1))) << 8));
|
|
if (0xf < redirectedPathCapacity) {
|
|
uVar2 = redirectedPathCapacity + 1;
|
|
ptr = redirectedPath[0];
|
|
if (0xfff < uVar2) {
|
|
ptr = *(void **)(GHIDRA_INT(redirectedPath[0]) + -4);
|
|
uVar2 = redirectedPathCapacity + 0x24;
|
|
if (0x1f < GHIDRA_UINT((GHIDRA_INT(redirectedPath[0]) + (-4 - GHIDRA_INT(ptr))))) goto LAB_0095fe96;
|
|
}
|
|
operator_delete(ptr,uVar2);
|
|
}
|
|
local_8 = GHIDRA_CAST<char *>(0xffffffff);
|
|
redirectedPathSize = 0;
|
|
redirectedPathCapacity = 0xf;
|
|
redirectedPath[0] = (void *)(GHIDRA_UINT(redirectedPath[0]) & 0xffffff00);
|
|
if (0xf < pathTextCapacity) {
|
|
uVar2 = pathTextCapacity + 1;
|
|
pcVar1 = pathText[0];
|
|
if (0xfff < uVar2) {
|
|
pcVar1 = *GHIDRA_CAST<char **>((pathText[0] + -4));
|
|
uVar2 = pathTextCapacity + 0x24;
|
|
if (GHIDRA_CAST<char *>(0x1f) < pathText[0] + (-4 - GHIDRA_INT(pcVar1))) {
|
|
LAB_0095fe96:
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(pcVar1,uVar2);
|
|
}
|
|
manager = g_manager;
|
|
terminusPath[0] = std::_Allocate(0x20);
|
|
terminusPathSize = 0x11;
|
|
terminusPathCapacity = 0x1f;
|
|
builtin_strncpy(terminusPath[0],"font/terminus.fnt",0x12);
|
|
local_8 = GHIDRA_CAST<char *>(0x2);
|
|
ModManager::TryRedirectPath
|
|
(&manager->_modManager,GHIDRA_CAST<std_string *>(pathText),GHIDRA_CAST<std_string *>(terminusPath));
|
|
local_8 = GHIDRA_CAST<char *>(CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x1))),3));
|
|
fontPath = extraout_EAX_00;
|
|
if (0xf < *GHIDRA_CAST<uint *>((extraout_EAX_00 + 0x14))) {
|
|
fontPath = *GHIDRA_CAST<byte **>(extraout_EAX_00);
|
|
}
|
|
(GHIDRA_CAST<Font *>((GHIDRA_CAST<Font *>((GHIDRA_INT(this) + 0x8c)))))->Font::Load(fontPath,0);
|
|
if (0xf < pathTextCapacity) {
|
|
uVar2 = pathTextCapacity + 1;
|
|
pcVar1 = pathText[0];
|
|
if (0xfff < uVar2) {
|
|
pcVar1 = *GHIDRA_CAST<char **>((pathText[0] + -4));
|
|
uVar2 = pathTextCapacity + 0x24;
|
|
if (GHIDRA_CAST<char *>(0x1f) < pathText[0] + (-4 - GHIDRA_INT(pcVar1))) goto LAB_0095ff7d;
|
|
}
|
|
operator_delete(pcVar1,uVar2);
|
|
}
|
|
pathTextSize = 0;
|
|
pathTextCapacity = 0xf;
|
|
pathText[0] = GHIDRA_CAST<char *>((GHIDRA_UINT(pathText[0]) & 0xffffff00));
|
|
if (0xf < terminusPathCapacity) {
|
|
uVar2 = terminusPathCapacity + 1;
|
|
pcVar1 = terminusPath[0];
|
|
if (0xfff < uVar2) {
|
|
pcVar1 = *GHIDRA_CAST<char **>((terminusPath[0] + -4));
|
|
uVar2 = terminusPathCapacity + 0x24;
|
|
if (GHIDRA_CAST<char *>(0x1f) < terminusPath[0] + (-4 - GHIDRA_INT(pcVar1))) {
|
|
LAB_0095ff7d:
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(pcVar1,uVar2);
|
|
}
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|