Files
isaac-port/generated-src/mod_manager.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

4993 lines
246 KiB
C++

#include "classes.h"
// 008f2ff0
ModManager::~ModManager()
{
void *local_10;
undefined1 *puStack_c;
undefined4 local_8;
puStack_c = &LAB_00af0b40;
local_10 = ExceptionList;
ExceptionList = &local_10;
local_8 = 0;
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((this + 0x8052)))))->ANM2::Reset();
(GHIDRA_CAST<AnimationState *>((GHIDRA_CAST<AnimationState *>((this + 0x8066)))))->AnimationState::~AnimationState();
(GHIDRA_CAST<AnimationState *>((GHIDRA_CAST<AnimationState *>((this + 0x805e)))))->AnimationState::~AnimationState();
(GHIDRA_CAST<std::string *>((GHIDRA_CAST<char *>((this + 0x8058)))))->std::string::_Tidy_deallocate();
(GHIDRA_CAST<std::string *>((GHIDRA_CAST<char *>((this + 0x8052)))))->std::string::_Tidy_deallocate();
local_8 = 1;
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((this + 0x800d)))))->ANM2::Reset();
(GHIDRA_CAST<AnimationState *>((GHIDRA_CAST<AnimationState *>((this + 0x8021)))))->AnimationState::~AnimationState();
(GHIDRA_CAST<AnimationState *>((GHIDRA_CAST<AnimationState *>((this + 0x8019)))))->AnimationState::~AnimationState();
(GHIDRA_CAST<std::string *>((GHIDRA_CAST<char *>((this + 0x8013)))))->std::string::_Tidy_deallocate();
(GHIDRA_CAST<std::string *>((GHIDRA_CAST<char *>((this + 0x800d)))))->std::string::_Tidy_deallocate();
(GHIDRA_CAST<std::string *>((GHIDRA_CAST<char *>((this + 0x8007)))))->std::string::_Tidy_deallocate();
(GHIDRA_CAST<KAGE::Thread *>((this + 0x8003)))->KAGE::Thread::~Thread();
FUN_008fc570();
FID_conflict__Tidy(this);
ExceptionList = local_10;
return;
}
// 008f30d0
void ModManager::LoadModContent()
{
qword qVar1;
undefined4 uVar2;
undefined4 uVar3;
byte *pbVar4;
byte isFileFound;
uint uVar5;
byte *pbVar6;
std_string *psVar7;
char *pcVar8;
void *pvVar9;
std_string *psVar10;
byte *pbVar11;
uint uVar12;
qword *allocatedBytes;
ModManager modSlot;
std_string local_84;
std_string pathTmp;
std_string local_54;
std_string contentPath;
uint local_24;
char *pcStack_20;
void *local_1c;
undefined1 *puStack_18;
undefined4 local_14;
uint *dirNameSize;
pcStack_20 = GHIDRA_CAST<char *>((GHIDRA_INT(register0x00000010) + 0xfffffffc));
local_14 = 0xffffffff;
puStack_18 = &LAB_00b0773d;
local_1c = ExceptionList;
uVar5 = __security_cookie ^ GHIDRA_UINT((GHIDRA_INT(register0x00000010) + 0xfffffff0U));
ExceptionList = &local_1c;
modSlot = *this;
local_24 = uVar5;
pcVar8 = GHIDRA_CAST<char *>((GHIDRA_INT(register0x00000010) + 0xfffffffc));
if (modSlot != this[1]) {
do {
if (*GHIDRA_CAST<char *>((*GHIDRA_CAST<int *>(modSlot) + 0xfd)) != '\0') {
Mod::load_menu_sprites(uVar5);
builtin_strncpy(local_54._buf,"entities2.xml",0xe);
local_54._capacity = 0xf;
local_54._size = 0xd;
local_14 = 0;
(GHIDRA_CAST<Mod *>((*(void **)modSlot)))->Mod::GetContentPath(&contentPath,&local_54);
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 2;
if (0xf < local_54._capacity) {
uVar12 = local_54._capacity + 1;
pvVar9 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)local_54._buf)) + 0x0)));
if (0xfff < uVar12) {
pvVar9 = *(void **)((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_54._buf)) + 0x0))) + -4);
uVar12 = local_54._capacity + 0x24;
if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_54._buf)) + 0x0))) + (-4 - GHIDRA_INT(pvVar9))))) goto LAB_008f46dd;
}
operator_delete(pvVar9,uVar12);
}
psVar7 = &contentPath;
if (0xf < contentPath._capacity) {
psVar7 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<std_string *>(contentPath._buf))) + 0x0)));
}
pbVar6 = FileSystem::ResolvePath(GHIDRA_CAST<byte *>(psVar7));
if (pbVar6 != GHIDRA_CAST<byte *>(0x0)) {
if (g_mainHeap == (void *)0x0) {
allocatedBytes = &g_allocatedBytesNoHeap;
}
else {
allocatedBytes = GHIDRA_CAST<qword *>((GHIDRA_INT(g_mainHeap) + 0x30));
}
uVar12 = *GHIDRA_CAST<uint *>((pbVar6 + -4));
qVar1 = *allocatedBytes;
*GHIDRA_CAST<uint *>(allocatedBytes) = GHIDRA_UINT(*allocatedBytes) - uVar12;
*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(allocatedBytes) + 4)) =
*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(allocatedBytes) + 4)) - GHIDRA_UINT((GHIDRA_UINT(qVar1) < uVar12));
free(pbVar6 + -4);
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 2;
}
if (pbVar6 != GHIDRA_CAST<byte *>(0x0)) {
psVar7 = &contentPath;
if (0xf < contentPath._capacity) {
psVar7 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<std_string *>(contentPath._buf))) + 0x0)));
}
(GHIDRA_CAST<EntityConfig *>((&g_manager->_entityConfig)))->EntityConfig::LoadEntities(GHIDRA_CAST<byte *>(psVar7),*(void **)modSlot);
}
local_54._capacity = 0xf;
local_54._size = 9;
builtin_strncpy(local_54._buf,"items.xm",8);
local_54._buf[8] = 'l';
local_54._buf[9] = '\0';
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 4;
psVar7 = (GHIDRA_CAST<Mod *>((*(void **)modSlot)))->Mod::GetContentPath(&pathTmp,&local_54);
if (&contentPath != psVar7) {
(GHIDRA_CAST<std::string *>((contentPath._buf)))->std::string::_Tidy_deallocate();
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(contentPath._buf)) + 0x0))) = *GHIDRA_CAST<undefined4 *>(psVar7->_buf);
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(contentPath._buf)) + 0x4))) = *GHIDRA_CAST<undefined4 *>((psVar7->_buf + 4));
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(contentPath._buf)) + 0x8))) = *GHIDRA_CAST<undefined4 *>((psVar7->_buf + 8));
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(contentPath._buf)) + 0xc))) = *GHIDRA_CAST<undefined4 *>((psVar7->_buf + 0xc));
contentPath._size = psVar7->_size;
contentPath._capacity = psVar7->_capacity;
psVar7->_size = 0;
psVar7->_capacity = 0xf;
psVar7->_buf[0] = '\0';
}
if (0xf < pathTmp._capacity) {
uVar12 = pathTmp._capacity + 1;
psVar7 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<std_string *>(pathTmp._buf))) + 0x0)));
if (0xfff < uVar12) {
psVar7 = GHIDRA_CAST<std_string *>((GHIDRA_CAST<std_string *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(pathTmp._buf)) + 0x0))) + -0x18)))->_capacity);
uVar12 = pathTmp._capacity + 0x24;
if (GHIDRA_CAST<byte *>(0x1f) < GHIDRA_CAST<byte *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(pathTmp._buf)) + 0x0))) + (-4 - GHIDRA_INT(psVar7))))) goto LAB_008f46dd;
}
operator_delete(psVar7,uVar12);
}
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 2;
pathTmp._size = 0;
pathTmp._capacity = 0xf;
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(pathTmp._buf)) + 0x0))) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(pathTmp._buf)) + 0x0))) & 0xffffff00;
if (0xf < local_54._capacity) {
uVar12 = local_54._capacity + 1;
pvVar9 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)local_54._buf)) + 0x0)));
if (0xfff < uVar12) {
pvVar9 = *(void **)((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_54._buf)) + 0x0))) + -4);
uVar12 = local_54._capacity + 0x24;
if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_54._buf)) + 0x0))) + (-4 - GHIDRA_INT(pvVar9))))) goto LAB_008f46dd;
}
operator_delete(pvVar9,uVar12);
}
psVar7 = &contentPath;
if (0xf < contentPath._capacity) {
psVar7 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<std_string *>(contentPath._buf))) + 0x0)));
}
pbVar6 = FileSystem::ResolvePath(GHIDRA_CAST<byte *>(psVar7));
if (pbVar6 != GHIDRA_CAST<byte *>(0x0)) {
if (g_mainHeap == (void *)0x0) {
allocatedBytes = &g_allocatedBytesNoHeap;
}
else {
allocatedBytes = GHIDRA_CAST<qword *>((GHIDRA_INT(g_mainHeap) + 0x30));
}
uVar12 = *GHIDRA_CAST<uint *>((pbVar6 + -4));
qVar1 = *allocatedBytes;
*GHIDRA_CAST<uint *>(allocatedBytes) = GHIDRA_UINT(*allocatedBytes) - uVar12;
*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(allocatedBytes) + 4)) =
*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(allocatedBytes) + 4)) - GHIDRA_UINT((GHIDRA_UINT(qVar1) < uVar12));
free(pbVar6 + -4);
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 2;
}
if (pbVar6 != GHIDRA_CAST<byte *>(0x0)) {
psVar7 = &contentPath;
if (0xf < contentPath._capacity) {
psVar7 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<std_string *>(contentPath._buf))) + 0x0)));
}
(GHIDRA_CAST<ItemConfig *>((&g_manager->_itemConfig)))->ItemConfig::Load(GHIDRA_CAST<byte *>(psVar7),*(void **)modSlot);
}
pvVar9 = *(void **)modSlot;
pcVar8 = std::_Allocate(0x20);
local_54._size = 0x10;
local_54._capacity = 0x1f;
builtin_strncpy(pcVar8,"info_display.xml",0x11);
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_54._buf)) + 0x0))) = pcVar8;
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 6;
psVar7 = (GHIDRA_CAST<Mod *>((pvVar9)))->Mod::GetContentPath(&pathTmp,&local_54);
if (&contentPath != psVar7) {
if (0xf < contentPath._capacity) {
uVar12 = contentPath._capacity + 1;
psVar10 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<std_string *>(contentPath._buf))) + 0x0)));
if (0xfff < uVar12) {
psVar10 = GHIDRA_CAST<std_string *>((GHIDRA_CAST<std_string *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(contentPath._buf)) + 0x0))) + -0x18)))->_capacity);
uVar12 = contentPath._capacity + 0x24;
if (GHIDRA_CAST<byte *>(0x1f) < GHIDRA_CAST<byte *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(contentPath._buf)) + 0x0))) + (-4 - GHIDRA_INT(psVar10)))))
goto LAB_008f46dd;
}
operator_delete(psVar10,uVar12);
}
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(contentPath._buf)) + 0x0))) = *GHIDRA_CAST<undefined4 *>(psVar7->_buf);
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(contentPath._buf)) + 0x4))) = *GHIDRA_CAST<undefined4 *>((psVar7->_buf + 4));
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(contentPath._buf)) + 0x8))) = *GHIDRA_CAST<undefined4 *>((psVar7->_buf + 8));
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(contentPath._buf)) + 0xc))) = *GHIDRA_CAST<undefined4 *>((psVar7->_buf + 0xc));
contentPath._size = psVar7->_size;
contentPath._capacity = psVar7->_capacity;
psVar7->_size = 0;
psVar7->_capacity = 0xf;
psVar7->_buf[0] = '\0';
}
if (0xf < pathTmp._capacity) {
uVar12 = pathTmp._capacity + 1;
psVar7 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<std_string *>(pathTmp._buf))) + 0x0)));
if (0xfff < uVar12) {
psVar7 = GHIDRA_CAST<std_string *>((GHIDRA_CAST<std_string *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(pathTmp._buf)) + 0x0))) + -0x18)))->_capacity);
uVar12 = pathTmp._capacity + 0x24;
if (GHIDRA_CAST<byte *>(0x1f) < GHIDRA_CAST<byte *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(pathTmp._buf)) + 0x0))) + (-4 - GHIDRA_INT(psVar7))))) goto LAB_008f46dd;
}
operator_delete(psVar7,uVar12);
}
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 2;
pathTmp._size = 0;
pathTmp._capacity = 0xf;
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(pathTmp._buf)) + 0x0))) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(pathTmp._buf)) + 0x0))) & 0xffffff00;
if (0xf < local_54._capacity) {
uVar12 = local_54._capacity + 1;
pvVar9 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)local_54._buf)) + 0x0)));
if (0xfff < uVar12) {
pvVar9 = *(void **)((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_54._buf)) + 0x0))) + -4);
uVar12 = local_54._capacity + 0x24;
if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_54._buf)) + 0x0))) + (-4 - GHIDRA_INT(pvVar9))))) goto LAB_008f46dd;
}
operator_delete(pvVar9,uVar12);
}
psVar7 = &contentPath;
if (0xf < contentPath._capacity) {
psVar7 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<std_string *>(contentPath._buf))) + 0x0)));
}
pbVar6 = FileSystem::ResolvePath(GHIDRA_CAST<byte *>(psVar7));
if (pbVar6 != GHIDRA_CAST<byte *>(0x0)) {
if (g_mainHeap == (void *)0x0) {
allocatedBytes = &g_allocatedBytesNoHeap;
}
else {
allocatedBytes = GHIDRA_CAST<qword *>((GHIDRA_INT(g_mainHeap) + 0x30));
}
uVar12 = *GHIDRA_CAST<uint *>((pbVar6 + -4));
qVar1 = *allocatedBytes;
*GHIDRA_CAST<uint *>(allocatedBytes) = GHIDRA_UINT(*allocatedBytes) - uVar12;
*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(allocatedBytes) + 4)) =
*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(allocatedBytes) + 4)) - GHIDRA_UINT((GHIDRA_UINT(qVar1) < uVar12));
free(pbVar6 + -4);
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 2;
}
if (pbVar6 != GHIDRA_CAST<byte *>(0x0)) {
psVar7 = &contentPath;
if (0xf < contentPath._capacity) {
psVar7 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<std_string *>(contentPath._buf))) + 0x0)));
}
(GHIDRA_CAST<InfoDisplay *>((&g_manager->_infoDisplay)))->InfoDisplay::load_xml(GHIDRA_CAST<byte *>(psVar7),*(void **)modSlot);
}
builtin_strncpy(local_54._buf,"pocketitems.xml",0x10);
local_54._capacity = 0xf;
local_54._size = 0xf;
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 8;
psVar7 = (GHIDRA_CAST<Mod *>((*(void **)modSlot)))->Mod::GetContentPath(&pathTmp,&local_54);
if (&contentPath != psVar7) {
if (0xf < contentPath._capacity) {
uVar12 = contentPath._capacity + 1;
psVar10 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<std_string *>(contentPath._buf))) + 0x0)));
if (0xfff < uVar12) {
psVar10 = GHIDRA_CAST<std_string *>((GHIDRA_CAST<std_string *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(contentPath._buf)) + 0x0))) + -0x18)))->_capacity);
uVar12 = contentPath._capacity + 0x24;
if (GHIDRA_CAST<byte *>(0x1f) < GHIDRA_CAST<byte *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(contentPath._buf)) + 0x0))) + (-4 - GHIDRA_INT(psVar10)))))
goto LAB_008f46dd;
}
operator_delete(psVar10,uVar12);
}
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(contentPath._buf)) + 0x0))) = *GHIDRA_CAST<undefined4 *>(psVar7->_buf);
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(contentPath._buf)) + 0x4))) = *GHIDRA_CAST<undefined4 *>((psVar7->_buf + 4));
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(contentPath._buf)) + 0x8))) = *GHIDRA_CAST<undefined4 *>((psVar7->_buf + 8));
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(contentPath._buf)) + 0xc))) = *GHIDRA_CAST<undefined4 *>((psVar7->_buf + 0xc));
contentPath._size = psVar7->_size;
contentPath._capacity = psVar7->_capacity;
psVar7->_size = 0;
psVar7->_capacity = 0xf;
psVar7->_buf[0] = '\0';
}
if (0xf < pathTmp._capacity) {
uVar12 = pathTmp._capacity + 1;
psVar7 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<std_string *>(pathTmp._buf))) + 0x0)));
if (0xfff < uVar12) {
psVar7 = GHIDRA_CAST<std_string *>((GHIDRA_CAST<std_string *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(pathTmp._buf)) + 0x0))) + -0x18)))->_capacity);
uVar12 = pathTmp._capacity + 0x24;
if (GHIDRA_CAST<byte *>(0x1f) < GHIDRA_CAST<byte *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(pathTmp._buf)) + 0x0))) + (-4 - GHIDRA_INT(psVar7))))) goto LAB_008f46dd;
}
operator_delete(psVar7,uVar12);
}
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 2;
pathTmp._size = 0;
pathTmp._capacity = 0xf;
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(pathTmp._buf)) + 0x0))) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(pathTmp._buf)) + 0x0))) & 0xffffff00;
if (0xf < local_54._capacity) {
uVar12 = local_54._capacity + 1;
pvVar9 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)local_54._buf)) + 0x0)));
if (0xfff < uVar12) {
pvVar9 = *(void **)((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_54._buf)) + 0x0))) + -4);
uVar12 = local_54._capacity + 0x24;
if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_54._buf)) + 0x0))) + (-4 - GHIDRA_INT(pvVar9))))) goto LAB_008f46dd;
}
operator_delete(pvVar9,uVar12);
}
psVar7 = &contentPath;
if (0xf < contentPath._capacity) {
psVar7 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<std_string *>(contentPath._buf))) + 0x0)));
}
pbVar6 = FileSystem::ResolvePath(GHIDRA_CAST<byte *>(psVar7));
if (pbVar6 != GHIDRA_CAST<byte *>(0x0)) {
if (g_mainHeap == (void *)0x0) {
allocatedBytes = &g_allocatedBytesNoHeap;
}
else {
allocatedBytes = GHIDRA_CAST<qword *>((GHIDRA_INT(g_mainHeap) + 0x30));
}
uVar12 = *GHIDRA_CAST<uint *>((pbVar6 + -4));
qVar1 = *allocatedBytes;
*GHIDRA_CAST<uint *>(allocatedBytes) = GHIDRA_UINT(*allocatedBytes) - uVar12;
*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(allocatedBytes) + 4)) =
*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(allocatedBytes) + 4)) - GHIDRA_UINT((GHIDRA_UINT(qVar1) < uVar12));
free(pbVar6 + -4);
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 2;
}
if (pbVar6 != GHIDRA_CAST<byte *>(0x0)) {
psVar7 = &contentPath;
if (0xf < contentPath._capacity) {
psVar7 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<std_string *>(contentPath._buf))) + 0x0)));
}
(GHIDRA_CAST<ItemConfig *>((&g_manager->_itemConfig)))->ItemConfig::load_pocketitems_xml(GHIDRA_CAST<byte *>(psVar7),*(void **)modSlot)
;
}
builtin_strncpy(local_54._buf,"costumes2.xml",0xe);
local_54._capacity = 0xf;
local_54._size = 0xd;
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 10;
psVar7 = (GHIDRA_CAST<Mod *>((*(void **)modSlot)))->Mod::GetContentPath(&pathTmp,&local_54);
if (&contentPath != psVar7) {
if (0xf < contentPath._capacity) {
uVar12 = contentPath._capacity + 1;
psVar10 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<std_string *>(contentPath._buf))) + 0x0)));
if (0xfff < uVar12) {
psVar10 = GHIDRA_CAST<std_string *>((GHIDRA_CAST<std_string *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(contentPath._buf)) + 0x0))) + -0x18)))->_capacity);
uVar12 = contentPath._capacity + 0x24;
if (GHIDRA_CAST<byte *>(0x1f) < GHIDRA_CAST<byte *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(contentPath._buf)) + 0x0))) + (-4 - GHIDRA_INT(psVar10)))))
goto LAB_008f46dd;
}
operator_delete(psVar10,uVar12);
}
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(contentPath._buf)) + 0x0))) = *GHIDRA_CAST<undefined4 *>(psVar7->_buf);
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(contentPath._buf)) + 0x4))) = *GHIDRA_CAST<undefined4 *>((psVar7->_buf + 4));
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(contentPath._buf)) + 0x8))) = *GHIDRA_CAST<undefined4 *>((psVar7->_buf + 8));
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(contentPath._buf)) + 0xc))) = *GHIDRA_CAST<undefined4 *>((psVar7->_buf + 0xc));
contentPath._size = psVar7->_size;
contentPath._capacity = psVar7->_capacity;
psVar7->_size = 0;
psVar7->_capacity = 0xf;
psVar7->_buf[0] = '\0';
}
if (0xf < pathTmp._capacity) {
uVar12 = pathTmp._capacity + 1;
psVar7 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<std_string *>(pathTmp._buf))) + 0x0)));
if (0xfff < uVar12) {
psVar7 = GHIDRA_CAST<std_string *>((GHIDRA_CAST<std_string *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(pathTmp._buf)) + 0x0))) + -0x18)))->_capacity);
uVar12 = pathTmp._capacity + 0x24;
if (GHIDRA_CAST<byte *>(0x1f) < GHIDRA_CAST<byte *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(pathTmp._buf)) + 0x0))) + (-4 - GHIDRA_INT(psVar7))))) goto LAB_008f46dd;
}
operator_delete(psVar7,uVar12);
}
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 2;
pathTmp._size = 0;
pathTmp._capacity = 0xf;
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(pathTmp._buf)) + 0x0))) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(pathTmp._buf)) + 0x0))) & 0xffffff00;
if (0xf < local_54._capacity) {
uVar12 = local_54._capacity + 1;
pvVar9 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)local_54._buf)) + 0x0)));
if (0xfff < uVar12) {
pvVar9 = *(void **)((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_54._buf)) + 0x0))) + -4);
uVar12 = local_54._capacity + 0x24;
if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_54._buf)) + 0x0))) + (-4 - GHIDRA_INT(pvVar9))))) goto LAB_008f46dd;
}
operator_delete(pvVar9,uVar12);
}
psVar7 = &contentPath;
if (0xf < contentPath._capacity) {
psVar7 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<std_string *>(contentPath._buf))) + 0x0)));
}
pbVar6 = FileSystem::ResolvePath(GHIDRA_CAST<byte *>(psVar7));
if (pbVar6 != GHIDRA_CAST<byte *>(0x0)) {
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0xb;
tracked_alloc(1,pbVar6,0);
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 2;
psVar7 = &contentPath;
if (0xf < contentPath._capacity) {
psVar7 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<std_string *>(contentPath._buf))) + 0x0)));
}
(GHIDRA_CAST<ItemConfig *>((&g_manager->_itemConfig)))->ItemConfig::load_costumes_xml(GHIDRA_CAST<byte *>(psVar7),*(void **)modSlot);
}
pvVar9 = *(void **)modSlot;
local_54._size = 0;
local_54._capacity = 0xf;
(*GHIDRA_CAST<undefined8 *>((GHIDRA_CAST<char *>(&(local_54._buf)) + 0x0))) = (*GHIDRA_CAST<undefined8 *>((GHIDRA_CAST<char *>(&(local_54._buf)) + 0x0))) & 0xffffffff00000000;
(GHIDRA_CAST<std::string *>((local_54._buf)))->std::string::assign(GHIDRA_CAST<byte *>("items_metadata.xml"),0x12);
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0xc;
psVar7 = (GHIDRA_CAST<Mod *>((pvVar9)))->Mod::GetContentPath(&local_84,&local_54);
if (&contentPath != psVar7) {
if (0xf < contentPath._capacity) {
uVar12 = contentPath._capacity + 1;
psVar10 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<std_string *>(contentPath._buf))) + 0x0)));
if (0xfff < uVar12) {
psVar10 = GHIDRA_CAST<std_string *>((GHIDRA_CAST<std_string *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(contentPath._buf)) + 0x0))) + -0x18)))->_capacity);
uVar12 = contentPath._capacity + 0x24;
if (GHIDRA_CAST<byte *>(0x1f) < GHIDRA_CAST<byte *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(contentPath._buf)) + 0x0))) + (-4 - GHIDRA_INT(psVar10)))))
goto LAB_008f46dd;
}
operator_delete(psVar10,uVar12);
}
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(contentPath._buf)) + 0x0))) = *GHIDRA_CAST<undefined4 *>(psVar7->_buf);
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(contentPath._buf)) + 0x4))) = *GHIDRA_CAST<undefined4 *>((psVar7->_buf + 4));
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(contentPath._buf)) + 0x8))) = *GHIDRA_CAST<undefined4 *>((psVar7->_buf + 8));
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(contentPath._buf)) + 0xc))) = *GHIDRA_CAST<undefined4 *>((psVar7->_buf + 0xc));
contentPath._size = psVar7->_size;
contentPath._capacity = psVar7->_capacity;
psVar7->_size = 0;
psVar7->_capacity = 0xf;
psVar7->_buf[0] = '\0';
}
(GHIDRA_CAST<std::string *>((local_84._buf)))->std::string::_Tidy_deallocate();
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 2;
if (0xf < local_54._capacity) {
uVar12 = local_54._capacity + 1;
pvVar9 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)local_54._buf)) + 0x0)));
if (0xfff < uVar12) {
pvVar9 = *(void **)((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_54._buf)) + 0x0))) + -4);
uVar12 = local_54._capacity + 0x24;
if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_54._buf)) + 0x0))) + (-4 - GHIDRA_INT(pvVar9))))) goto LAB_008f46dd;
}
operator_delete(pvVar9,uVar12);
}
psVar7 = &contentPath;
if (0xf < contentPath._capacity) {
psVar7 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<std_string *>(contentPath._buf))) + 0x0)));
}
pbVar6 = FileSystem::ResolvePath(GHIDRA_CAST<byte *>(psVar7));
if (pbVar6 != GHIDRA_CAST<byte *>(0x0)) {
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0xd;
tracked_alloc(1,pbVar6,0);
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 2;
psVar7 = &contentPath;
if (0xf < contentPath._capacity) {
psVar7 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<std_string *>(contentPath._buf))) + 0x0)));
}
(GHIDRA_CAST<ItemConfig *>((&g_manager->_itemConfig)))->ItemConfig::load_metadata_xml(GHIDRA_CAST<byte *>(psVar7),*(void **)modSlot);
}
pvVar9 = *(void **)modSlot;
local_54._size = 0;
local_54._capacity = 0xf;
(*GHIDRA_CAST<undefined8 *>((GHIDRA_CAST<char *>(&(local_54._buf)) + 0x0))) = (*GHIDRA_CAST<undefined8 *>((GHIDRA_CAST<char *>(&(local_54._buf)) + 0x0))) & 0xffffffff00000000;
(GHIDRA_CAST<std::string *>((local_54._buf)))->std::string::assign(GHIDRA_CAST<byte *>("wisps.xml"),9);
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0xe;
psVar7 = (GHIDRA_CAST<Mod *>((pvVar9)))->Mod::GetContentPath(&local_84,&local_54);
if (&contentPath != psVar7) {
if (0xf < contentPath._capacity) {
uVar12 = contentPath._capacity + 1;
psVar10 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<std_string *>(contentPath._buf))) + 0x0)));
if (0xfff < uVar12) {
psVar10 = GHIDRA_CAST<std_string *>((GHIDRA_CAST<std_string *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(contentPath._buf)) + 0x0))) + -0x18)))->_capacity);
uVar12 = contentPath._capacity + 0x24;
if (GHIDRA_CAST<byte *>(0x1f) < GHIDRA_CAST<byte *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(contentPath._buf)) + 0x0))) + (-4 - GHIDRA_INT(psVar10)))))
goto LAB_008f46dd;
}
operator_delete(psVar10,uVar12);
}
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(contentPath._buf)) + 0x0))) = *GHIDRA_CAST<undefined4 *>(psVar7->_buf);
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(contentPath._buf)) + 0x4))) = *GHIDRA_CAST<undefined4 *>((psVar7->_buf + 4));
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(contentPath._buf)) + 0x8))) = *GHIDRA_CAST<undefined4 *>((psVar7->_buf + 8));
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(contentPath._buf)) + 0xc))) = *GHIDRA_CAST<undefined4 *>((psVar7->_buf + 0xc));
contentPath._size = psVar7->_size;
contentPath._capacity = psVar7->_capacity;
psVar7->_size = 0;
psVar7->_capacity = 0xf;
psVar7->_buf[0] = '\0';
}
(GHIDRA_CAST<std::string *>((local_84._buf)))->std::string::_Tidy_deallocate();
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 2;
if (0xf < local_54._capacity) {
uVar12 = local_54._capacity + 1;
pvVar9 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)local_54._buf)) + 0x0)));
if (0xfff < uVar12) {
pvVar9 = *(void **)((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_54._buf)) + 0x0))) + -4);
uVar12 = local_54._capacity + 0x24;
if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_54._buf)) + 0x0))) + (-4 - GHIDRA_INT(pvVar9))))) goto LAB_008f46dd;
}
operator_delete(pvVar9,uVar12);
}
psVar7 = &contentPath;
if (0xf < contentPath._capacity) {
psVar7 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<std_string *>(contentPath._buf))) + 0x0)));
}
pbVar6 = FileSystem::ResolvePath(GHIDRA_CAST<byte *>(psVar7));
if (pbVar6 != GHIDRA_CAST<byte *>(0x0)) {
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0xf;
tracked_alloc(1,pbVar6,0);
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 2;
psVar7 = &contentPath;
if (0xf < contentPath._capacity) {
psVar7 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<std_string *>(contentPath._buf))) + 0x0)));
}
(GHIDRA_CAST<ItemConfig *>((&g_manager->_itemConfig)))->ItemConfig::load_wisps_xml(GHIDRA_CAST<byte *>(psVar7),*(void **)modSlot);
}
pvVar9 = *(void **)modSlot;
local_54._size = 0;
local_54._capacity = 0xf;
(*GHIDRA_CAST<undefined8 *>((GHIDRA_CAST<char *>(&(local_54._buf)) + 0x0))) = (*GHIDRA_CAST<undefined8 *>((GHIDRA_CAST<char *>(&(local_54._buf)) + 0x0))) & 0xffffffff00000000;
(GHIDRA_CAST<std::string *>((local_54._buf)))->std::string::assign(GHIDRA_CAST<byte *>("locusts.xml"),0xb);
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0x10;
psVar7 = (GHIDRA_CAST<Mod *>((pvVar9)))->Mod::GetContentPath(&local_84,&local_54);
if (&contentPath != psVar7) {
if (0xf < contentPath._capacity) {
uVar12 = contentPath._capacity + 1;
psVar10 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<std_string *>(contentPath._buf))) + 0x0)));
if (0xfff < uVar12) {
psVar10 = GHIDRA_CAST<std_string *>((GHIDRA_CAST<std_string *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(contentPath._buf)) + 0x0))) + -0x18)))->_capacity);
uVar12 = contentPath._capacity + 0x24;
if (GHIDRA_CAST<byte *>(0x1f) < GHIDRA_CAST<byte *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(contentPath._buf)) + 0x0))) + (-4 - GHIDRA_INT(psVar10)))))
goto LAB_008f46dd;
}
operator_delete(psVar10,uVar12);
}
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(contentPath._buf)) + 0x0))) = *GHIDRA_CAST<undefined4 *>(psVar7->_buf);
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(contentPath._buf)) + 0x4))) = *GHIDRA_CAST<undefined4 *>((psVar7->_buf + 4));
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(contentPath._buf)) + 0x8))) = *GHIDRA_CAST<undefined4 *>((psVar7->_buf + 8));
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(contentPath._buf)) + 0xc))) = *GHIDRA_CAST<undefined4 *>((psVar7->_buf + 0xc));
contentPath._size = psVar7->_size;
contentPath._capacity = psVar7->_capacity;
psVar7->_size = 0;
psVar7->_capacity = 0xf;
psVar7->_buf[0] = '\0';
}
(GHIDRA_CAST<std::string *>((local_84._buf)))->std::string::_Tidy_deallocate();
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 2;
if (0xf < local_54._capacity) {
uVar12 = local_54._capacity + 1;
pvVar9 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)local_54._buf)) + 0x0)));
if (0xfff < uVar12) {
pvVar9 = *(void **)((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_54._buf)) + 0x0))) + -4);
uVar12 = local_54._capacity + 0x24;
if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_54._buf)) + 0x0))) + (-4 - GHIDRA_INT(pvVar9))))) goto LAB_008f46dd;
}
operator_delete(pvVar9,uVar12);
}
psVar7 = &contentPath;
if (0xf < contentPath._capacity) {
psVar7 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<std_string *>(contentPath._buf))) + 0x0)));
}
pbVar6 = FileSystem::ResolvePath(GHIDRA_CAST<byte *>(psVar7));
if (pbVar6 != GHIDRA_CAST<byte *>(0x0)) {
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0x11;
tracked_alloc(1,pbVar6,0);
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 2;
psVar7 = &contentPath;
if (0xf < contentPath._capacity) {
psVar7 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<std_string *>(contentPath._buf))) + 0x0)));
}
(GHIDRA_CAST<ItemConfig *>((&g_manager->_itemConfig)))->ItemConfig::LoadLocustConfig(GHIDRA_CAST<byte *>(psVar7),*GHIDRA_CAST<ModEntry **>(modSlot))
;
}
pvVar9 = *(void **)modSlot;
local_54._size = 0;
local_54._capacity = 0xf;
(*GHIDRA_CAST<undefined8 *>((GHIDRA_CAST<char *>(&(local_54._buf)) + 0x0))) = (*GHIDRA_CAST<undefined8 *>((GHIDRA_CAST<char *>(&(local_54._buf)) + 0x0))) & 0xffffffff00000000;
(GHIDRA_CAST<std::string *>((local_54._buf)))->std::string::assign(GHIDRA_CAST<byte *>("recipes.xml"),0xb);
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0x12;
psVar7 = (GHIDRA_CAST<Mod *>((pvVar9)))->Mod::GetContentPath(&local_84,&local_54);
if (&contentPath != psVar7) {
if (0xf < contentPath._capacity) {
uVar12 = contentPath._capacity + 1;
psVar10 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<std_string *>(contentPath._buf))) + 0x0)));
if (0xfff < uVar12) {
psVar10 = GHIDRA_CAST<std_string *>((GHIDRA_CAST<std_string *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(contentPath._buf)) + 0x0))) + -0x18)))->_capacity);
uVar12 = contentPath._capacity + 0x24;
if (GHIDRA_CAST<byte *>(0x1f) < GHIDRA_CAST<byte *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(contentPath._buf)) + 0x0))) + (-4 - GHIDRA_INT(psVar10)))))
goto LAB_008f46dd;
}
operator_delete(psVar10,uVar12);
}
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(contentPath._buf)) + 0x0))) = *GHIDRA_CAST<undefined4 *>(psVar7->_buf);
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(contentPath._buf)) + 0x4))) = *GHIDRA_CAST<undefined4 *>((psVar7->_buf + 4));
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(contentPath._buf)) + 0x8))) = *GHIDRA_CAST<undefined4 *>((psVar7->_buf + 8));
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(contentPath._buf)) + 0xc))) = *GHIDRA_CAST<undefined4 *>((psVar7->_buf + 0xc));
contentPath._size = psVar7->_size;
contentPath._capacity = psVar7->_capacity;
psVar7->_size = 0;
psVar7->_capacity = 0xf;
psVar7->_buf[0] = '\0';
}
(GHIDRA_CAST<std::string *>((local_84._buf)))->std::string::_Tidy_deallocate();
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 2;
if (0xf < local_54._capacity) {
uVar12 = local_54._capacity + 1;
pvVar9 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)local_54._buf)) + 0x0)));
if (0xfff < uVar12) {
pvVar9 = *(void **)((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_54._buf)) + 0x0))) + -4);
uVar12 = local_54._capacity + 0x24;
if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_54._buf)) + 0x0))) + (-4 - GHIDRA_INT(pvVar9))))) goto LAB_008f46dd;
}
operator_delete(pvVar9,uVar12);
}
psVar7 = &contentPath;
if (0xf < contentPath._capacity) {
psVar7 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<std_string *>(contentPath._buf))) + 0x0)));
}
pbVar6 = FileSystem::ResolvePath(GHIDRA_CAST<byte *>(psVar7));
if (pbVar6 != GHIDRA_CAST<byte *>(0x0)) {
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0x13;
tracked_alloc(1,pbVar6,0);
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 2;
psVar7 = &contentPath;
if (0xf < contentPath._capacity) {
psVar7 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<std_string *>(contentPath._buf))) + 0x0)));
}
(GHIDRA_CAST<ItemConfig *>((&g_manager->_itemConfig)))->ItemConfig::load_recipes_xml(GHIDRA_CAST<byte *>(psVar7),*(void **)modSlot);
}
pvVar9 = *(void **)modSlot;
local_54._size = 0;
local_54._capacity = 0xf;
(*GHIDRA_CAST<undefined8 *>((GHIDRA_CAST<char *>(&(local_54._buf)) + 0x0))) = (*GHIDRA_CAST<undefined8 *>((GHIDRA_CAST<char *>(&(local_54._buf)) + 0x0))) & 0xffffffff00000000;
(GHIDRA_CAST<std::string *>((local_54._buf)))->std::string::assign(GHIDRA_CAST<byte *>("bombcostumes.xml"),0x10);
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0x14;
psVar7 = (GHIDRA_CAST<Mod *>((pvVar9)))->Mod::GetContentPath(&local_84,&local_54);
if (&contentPath != psVar7) {
if (0xf < contentPath._capacity) {
uVar12 = contentPath._capacity + 1;
psVar10 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<std_string *>(contentPath._buf))) + 0x0)));
if (0xfff < uVar12) {
psVar10 = GHIDRA_CAST<std_string *>((GHIDRA_CAST<std_string *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(contentPath._buf)) + 0x0))) + -0x18)))->_capacity);
uVar12 = contentPath._capacity + 0x24;
if (GHIDRA_CAST<byte *>(0x1f) < GHIDRA_CAST<byte *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(contentPath._buf)) + 0x0))) + (-4 - GHIDRA_INT(psVar10)))))
goto LAB_008f46dd;
}
operator_delete(psVar10,uVar12);
}
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(contentPath._buf)) + 0x0))) = *GHIDRA_CAST<undefined4 *>(psVar7->_buf);
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(contentPath._buf)) + 0x4))) = *GHIDRA_CAST<undefined4 *>((psVar7->_buf + 4));
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(contentPath._buf)) + 0x8))) = *GHIDRA_CAST<undefined4 *>((psVar7->_buf + 8));
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(contentPath._buf)) + 0xc))) = *GHIDRA_CAST<undefined4 *>((psVar7->_buf + 0xc));
contentPath._size = psVar7->_size;
contentPath._capacity = psVar7->_capacity;
psVar7->_size = 0;
psVar7->_capacity = 0xf;
psVar7->_buf[0] = '\0';
}
(GHIDRA_CAST<std::string *>((local_84._buf)))->std::string::_Tidy_deallocate();
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 2;
if (0xf < local_54._capacity) {
uVar12 = local_54._capacity + 1;
pvVar9 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)local_54._buf)) + 0x0)));
if (0xfff < uVar12) {
pvVar9 = *(void **)((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_54._buf)) + 0x0))) + -4);
uVar12 = local_54._capacity + 0x24;
if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_54._buf)) + 0x0))) + (-4 - GHIDRA_INT(pvVar9))))) goto LAB_008f46dd;
}
operator_delete(pvVar9,uVar12);
}
psVar7 = &contentPath;
if (0xf < contentPath._capacity) {
psVar7 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<std_string *>(contentPath._buf))) + 0x0)));
}
pbVar6 = FileSystem::ResolvePath(GHIDRA_CAST<byte *>(psVar7));
if (pbVar6 != GHIDRA_CAST<byte *>(0x0)) {
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0x15;
tracked_alloc(1,pbVar6,0);
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 2;
psVar7 = &contentPath;
if (0xf < contentPath._capacity) {
psVar7 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<std_string *>(contentPath._buf))) + 0x0)));
}
(GHIDRA_CAST<ItemConfig *>((&g_manager->_itemConfig)))->ItemConfig::LoadBombCostumes(GHIDRA_CAST<byte *>(psVar7),1);
}
pvVar9 = *(void **)modSlot;
local_54._size = 0;
local_54._capacity = 0xf;
(*GHIDRA_CAST<undefined8 *>((GHIDRA_CAST<char *>(&(local_54._buf)) + 0x0))) = (*GHIDRA_CAST<undefined8 *>((GHIDRA_CAST<char *>(&(local_54._buf)) + 0x0))) & 0xffffffff00000000;
(GHIDRA_CAST<std::string *>((local_54._buf)))->std::string::assign(GHIDRA_CAST<byte *>("challenges.xml"),0xe);
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0x16;
psVar7 = (GHIDRA_CAST<Mod *>((pvVar9)))->Mod::GetContentPath(&local_84,&local_54);
if (&contentPath != psVar7) {
if (0xf < contentPath._capacity) {
uVar12 = contentPath._capacity + 1;
psVar10 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<std_string *>(contentPath._buf))) + 0x0)));
if (0xfff < uVar12) {
psVar10 = GHIDRA_CAST<std_string *>((GHIDRA_CAST<std_string *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(contentPath._buf)) + 0x0))) + -0x18)))->_capacity);
uVar12 = contentPath._capacity + 0x24;
if (GHIDRA_CAST<byte *>(0x1f) < GHIDRA_CAST<byte *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(contentPath._buf)) + 0x0))) + (-4 - GHIDRA_INT(psVar10)))))
goto LAB_008f46dd;
}
operator_delete(psVar10,uVar12);
}
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(contentPath._buf)) + 0x0))) = *GHIDRA_CAST<undefined4 *>(psVar7->_buf);
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(contentPath._buf)) + 0x4))) = *GHIDRA_CAST<undefined4 *>((psVar7->_buf + 4));
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(contentPath._buf)) + 0x8))) = *GHIDRA_CAST<undefined4 *>((psVar7->_buf + 8));
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(contentPath._buf)) + 0xc))) = *GHIDRA_CAST<undefined4 *>((psVar7->_buf + 0xc));
contentPath._size = psVar7->_size;
contentPath._capacity = psVar7->_capacity;
psVar7->_size = 0;
psVar7->_capacity = 0xf;
psVar7->_buf[0] = '\0';
}
(GHIDRA_CAST<std::string *>((local_84._buf)))->std::string::_Tidy_deallocate();
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 2;
if (0xf < local_54._capacity) {
uVar12 = local_54._capacity + 1;
pvVar9 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)local_54._buf)) + 0x0)));
if (0xfff < uVar12) {
pvVar9 = *(void **)((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_54._buf)) + 0x0))) + -4);
uVar12 = local_54._capacity + 0x24;
if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_54._buf)) + 0x0))) + (-4 - GHIDRA_INT(pvVar9))))) goto LAB_008f46dd;
}
operator_delete(pvVar9,uVar12);
}
psVar7 = &contentPath;
if (0xf < contentPath._capacity) {
psVar7 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<std_string *>(contentPath._buf))) + 0x0)));
}
pbVar6 = FileSystem::ResolvePath(GHIDRA_CAST<byte *>(psVar7));
if (pbVar6 != GHIDRA_CAST<byte *>(0x0)) {
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0x17;
tracked_alloc(1,pbVar6,0);
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 2;
psVar7 = &contentPath;
if (0xf < contentPath._capacity) {
psVar7 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<std_string *>(contentPath._buf))) + 0x0)));
}
challenges_xml_load(g_manager,GHIDRA_CAST<byte *>(psVar7),1);
}
pvVar9 = *(void **)modSlot;
local_54._size = 0;
local_54._capacity = 0xf;
(*GHIDRA_CAST<undefined8 *>((GHIDRA_CAST<char *>(&(local_54._buf)) + 0x0))) = (*GHIDRA_CAST<undefined8 *>((GHIDRA_CAST<char *>(&(local_54._buf)) + 0x0))) & 0xffffffff00000000;
(GHIDRA_CAST<std::string *>((local_54._buf)))->std::string::assign(GHIDRA_CAST<byte *>("players.xml"),0xb);
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0x18;
psVar7 = (GHIDRA_CAST<Mod *>((pvVar9)))->Mod::GetContentPath(&local_84,&local_54);
if (&contentPath != psVar7) {
if (0xf < contentPath._capacity) {
uVar12 = contentPath._capacity + 1;
psVar10 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<std_string *>(contentPath._buf))) + 0x0)));
if (0xfff < uVar12) {
psVar10 = GHIDRA_CAST<std_string *>((GHIDRA_CAST<std_string *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(contentPath._buf)) + 0x0))) + -0x18)))->_capacity);
uVar12 = contentPath._capacity + 0x24;
if (GHIDRA_CAST<byte *>(0x1f) < GHIDRA_CAST<byte *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(contentPath._buf)) + 0x0))) + (-4 - GHIDRA_INT(psVar10)))))
goto LAB_008f46dd;
}
operator_delete(psVar10,uVar12);
}
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(contentPath._buf)) + 0x0))) = *GHIDRA_CAST<undefined4 *>(psVar7->_buf);
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(contentPath._buf)) + 0x4))) = *GHIDRA_CAST<undefined4 *>((psVar7->_buf + 4));
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(contentPath._buf)) + 0x8))) = *GHIDRA_CAST<undefined4 *>((psVar7->_buf + 8));
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(contentPath._buf)) + 0xc))) = *GHIDRA_CAST<undefined4 *>((psVar7->_buf + 0xc));
contentPath._size = psVar7->_size;
contentPath._capacity = psVar7->_capacity;
psVar7->_size = 0;
psVar7->_capacity = 0xf;
psVar7->_buf[0] = '\0';
}
(GHIDRA_CAST<std::string *>((local_84._buf)))->std::string::_Tidy_deallocate();
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 2;
if (0xf < local_54._capacity) {
uVar12 = local_54._capacity + 1;
pvVar9 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)local_54._buf)) + 0x0)));
if (0xfff < uVar12) {
pvVar9 = *(void **)((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_54._buf)) + 0x0))) + -4);
uVar12 = local_54._capacity + 0x24;
if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_54._buf)) + 0x0))) + (-4 - GHIDRA_INT(pvVar9))))) goto LAB_008f46dd;
}
operator_delete(pvVar9,uVar12);
}
psVar7 = &contentPath;
if (0xf < contentPath._capacity) {
psVar7 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<std_string *>(contentPath._buf))) + 0x0)));
}
pbVar6 = FileSystem::ResolvePath(GHIDRA_CAST<byte *>(psVar7));
if (pbVar6 != GHIDRA_CAST<byte *>(0x0)) {
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0x19;
tracked_alloc(1,pbVar6,0);
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 2;
psVar7 = &contentPath;
if (0xf < contentPath._capacity) {
psVar7 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<std_string *>(contentPath._buf))) + 0x0)));
}
(GHIDRA_CAST<EntityConfig *>((&g_manager->_entityConfig)))->EntityConfig::load_players_xml(GHIDRA_CAST<byte *>(psVar7),*(void **)modSlot)
;
}
pvVar9 = *(void **)modSlot;
local_54._size = 0;
local_54._capacity = 0xf;
(*GHIDRA_CAST<undefined8 *>((GHIDRA_CAST<char *>(&(local_54._buf)) + 0x0))) = (*GHIDRA_CAST<undefined8 *>((GHIDRA_CAST<char *>(&(local_54._buf)) + 0x0))) & 0xffffffff00000000;
(GHIDRA_CAST<std::string *>((local_54._buf)))->std::string::assign(GHIDRA_CAST<byte *>("sounds.xml"),10);
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0x1a;
psVar7 = (GHIDRA_CAST<Mod *>((pvVar9)))->Mod::GetContentPath(&local_84,&local_54);
if (&contentPath != psVar7) {
if (0xf < contentPath._capacity) {
uVar12 = contentPath._capacity + 1;
psVar10 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<std_string *>(contentPath._buf))) + 0x0)));
if (0xfff < uVar12) {
psVar10 = GHIDRA_CAST<std_string *>((GHIDRA_CAST<std_string *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(contentPath._buf)) + 0x0))) + -0x18)))->_capacity);
uVar12 = contentPath._capacity + 0x24;
if (GHIDRA_CAST<byte *>(0x1f) < GHIDRA_CAST<byte *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(contentPath._buf)) + 0x0))) + (-4 - GHIDRA_INT(psVar10)))))
goto LAB_008f46dd;
}
operator_delete(psVar10,uVar12);
}
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(contentPath._buf)) + 0x0))) = *GHIDRA_CAST<undefined4 *>(psVar7->_buf);
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(contentPath._buf)) + 0x4))) = *GHIDRA_CAST<undefined4 *>((psVar7->_buf + 4));
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(contentPath._buf)) + 0x8))) = *GHIDRA_CAST<undefined4 *>((psVar7->_buf + 8));
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(contentPath._buf)) + 0xc))) = *GHIDRA_CAST<undefined4 *>((psVar7->_buf + 0xc));
contentPath._size = psVar7->_size;
contentPath._capacity = psVar7->_capacity;
psVar7->_size = 0;
psVar7->_capacity = 0xf;
psVar7->_buf[0] = '\0';
}
(GHIDRA_CAST<std::string *>((local_84._buf)))->std::string::_Tidy_deallocate();
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 2;
if (0xf < local_54._capacity) {
uVar12 = local_54._capacity + 1;
pvVar9 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)local_54._buf)) + 0x0)));
if (0xfff < uVar12) {
pvVar9 = *(void **)((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_54._buf)) + 0x0))) + -4);
uVar12 = local_54._capacity + 0x24;
if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_54._buf)) + 0x0))) + (-4 - GHIDRA_INT(pvVar9))))) goto LAB_008f46dd;
}
operator_delete(pvVar9,uVar12);
}
psVar7 = &contentPath;
if (0xf < contentPath._capacity) {
psVar7 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<std_string *>(contentPath._buf))) + 0x0)));
}
pbVar6 = FileSystem::ResolvePath(GHIDRA_CAST<byte *>(psVar7));
if (pbVar6 != GHIDRA_CAST<byte *>(0x0)) {
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0x1b;
tracked_alloc(1,pbVar6,0);
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 2;
psVar7 = &contentPath;
if (0xf < contentPath._capacity) {
psVar7 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<std_string *>(contentPath._buf))) + 0x0)));
}
(GHIDRA_CAST<SFXManager *>((&g_manager->_sfxManager)))->SFXManager::load_xml(GHIDRA_CAST<byte *>(psVar7),1);
}
pvVar9 = *(void **)modSlot;
local_54._size = 0;
local_54._capacity = 0xf;
(*GHIDRA_CAST<undefined8 *>((GHIDRA_CAST<char *>(&(local_54._buf)) + 0x0))) = (*GHIDRA_CAST<undefined8 *>((GHIDRA_CAST<char *>(&(local_54._buf)) + 0x0))) & 0xffffffff00000000;
(GHIDRA_CAST<std::string *>((local_54._buf)))->std::string::assign(GHIDRA_CAST<byte *>("music.xml"),9);
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0x1c;
psVar7 = (GHIDRA_CAST<Mod *>((pvVar9)))->Mod::GetContentPath(&local_84,&local_54);
if (&contentPath != psVar7) {
if (0xf < contentPath._capacity) {
uVar12 = contentPath._capacity + 1;
psVar10 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<std_string *>(contentPath._buf))) + 0x0)));
if (0xfff < uVar12) {
psVar10 = GHIDRA_CAST<std_string *>((GHIDRA_CAST<std_string *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(contentPath._buf)) + 0x0))) + -0x18)))->_capacity);
uVar12 = contentPath._capacity + 0x24;
if (GHIDRA_CAST<byte *>(0x1f) < GHIDRA_CAST<byte *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(contentPath._buf)) + 0x0))) + (-4 - GHIDRA_INT(psVar10)))))
goto LAB_008f46dd;
}
operator_delete(psVar10,uVar12);
}
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(contentPath._buf)) + 0x0))) = *GHIDRA_CAST<undefined4 *>(psVar7->_buf);
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(contentPath._buf)) + 0x4))) = *GHIDRA_CAST<undefined4 *>((psVar7->_buf + 4));
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(contentPath._buf)) + 0x8))) = *GHIDRA_CAST<undefined4 *>((psVar7->_buf + 8));
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(contentPath._buf)) + 0xc))) = *GHIDRA_CAST<undefined4 *>((psVar7->_buf + 0xc));
contentPath._size = psVar7->_size;
contentPath._capacity = psVar7->_capacity;
psVar7->_size = 0;
psVar7->_capacity = 0xf;
psVar7->_buf[0] = '\0';
}
(GHIDRA_CAST<std::string *>((local_84._buf)))->std::string::_Tidy_deallocate();
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 2;
if (0xf < local_54._capacity) {
uVar12 = local_54._capacity + 1;
pvVar9 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)local_54._buf)) + 0x0)));
if (0xfff < uVar12) {
pvVar9 = *(void **)((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_54._buf)) + 0x0))) + -4);
uVar12 = local_54._capacity + 0x24;
if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_54._buf)) + 0x0))) + (-4 - GHIDRA_INT(pvVar9))))) goto LAB_008f46dd;
}
operator_delete(pvVar9,uVar12);
}
psVar7 = &contentPath;
if (0xf < contentPath._capacity) {
psVar7 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<std_string *>(contentPath._buf))) + 0x0)));
}
isFileFound = file_exists(GHIDRA_CAST<byte *>(psVar7));
if (isFileFound != 0) {
psVar7 = &contentPath;
if (0xf < contentPath._capacity) {
psVar7 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<std_string *>(contentPath._buf))) + 0x0)));
}
(GHIDRA_CAST<Music *>((GHIDRA_CAST<Music *>(&g_manager->_musicManager))))->Music::LoadConfig(GHIDRA_CAST<byte *>(psVar7),1);
}
pvVar9 = *(void **)modSlot;
local_54._size = 0;
local_54._capacity = 0xf;
(*GHIDRA_CAST<undefined8 *>((GHIDRA_CAST<char *>(&(local_54._buf)) + 0x0))) = (*GHIDRA_CAST<undefined8 *>((GHIDRA_CAST<char *>(&(local_54._buf)) + 0x0))) & 0xffffffff00000000;
(GHIDRA_CAST<std::string *>((local_54._buf)))->std::string::assign(GHIDRA_CAST<byte *>("nightmares.xml"),0xe);
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0x1d;
psVar7 = (GHIDRA_CAST<Mod *>((pvVar9)))->Mod::GetContentPath(&local_84,&local_54);
if (&contentPath != psVar7) {
if (0xf < contentPath._capacity) {
uVar12 = contentPath._capacity + 1;
psVar10 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<std_string *>(contentPath._buf))) + 0x0)));
if (0xfff < uVar12) {
psVar10 = GHIDRA_CAST<std_string *>((GHIDRA_CAST<std_string *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(contentPath._buf)) + 0x0))) + -0x18)))->_capacity);
uVar12 = contentPath._capacity + 0x24;
if (GHIDRA_CAST<byte *>(0x1f) < GHIDRA_CAST<byte *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(contentPath._buf)) + 0x0))) + (-4 - GHIDRA_INT(psVar10)))))
goto LAB_008f46dd;
}
operator_delete(psVar10,uVar12);
}
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(contentPath._buf)) + 0x0))) = *GHIDRA_CAST<undefined4 *>(psVar7->_buf);
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(contentPath._buf)) + 0x4))) = *GHIDRA_CAST<undefined4 *>((psVar7->_buf + 4));
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(contentPath._buf)) + 0x8))) = *GHIDRA_CAST<undefined4 *>((psVar7->_buf + 8));
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(contentPath._buf)) + 0xc))) = *GHIDRA_CAST<undefined4 *>((psVar7->_buf + 0xc));
contentPath._size = psVar7->_size;
contentPath._capacity = psVar7->_capacity;
psVar7->_size = 0;
psVar7->_capacity = 0xf;
psVar7->_buf[0] = '\0';
}
(GHIDRA_CAST<std::string *>((local_84._buf)))->std::string::_Tidy_deallocate();
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 2;
if (0xf < local_54._capacity) {
uVar12 = local_54._capacity + 1;
pvVar9 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)local_54._buf)) + 0x0)));
if (0xfff < uVar12) {
pvVar9 = *(void **)((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_54._buf)) + 0x0))) + -4);
uVar12 = local_54._capacity + 0x24;
if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_54._buf)) + 0x0))) + (-4 - GHIDRA_INT(pvVar9))))) goto LAB_008f46dd;
}
operator_delete(pvVar9,uVar12);
}
psVar7 = &contentPath;
if (0xf < contentPath._capacity) {
psVar7 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<std_string *>(contentPath._buf))) + 0x0)));
}
isFileFound = file_exists(GHIDRA_CAST<byte *>(psVar7));
if (isFileFound != 0) {
psVar7 = &contentPath;
if (0xf < contentPath._capacity) {
psVar7 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<std_string *>(contentPath._buf))) + 0x0)));
}
(GHIDRA_CAST<NightmareScene *>((&g_manager->_nightmareScene)))->NightmareScene::load_nightmares_xml(GHIDRA_CAST<byte *>(psVar7));
}
pbVar6 = *GHIDRA_CAST<byte **>(modSlot);
local_54._size = 0;
local_54._capacity = 0xf;
(*GHIDRA_CAST<undefined8 *>((GHIDRA_CAST<char *>(&(local_54._buf)) + 0x0))) = (*GHIDRA_CAST<undefined8 *>((GHIDRA_CAST<char *>(&(local_54._buf)) + 0x0))) & 0xffffffff00000000;
pbVar4 = g_modsDirectory;
do {
pbVar11 = pbVar4;
pbVar4 = pbVar11 + 1;
} while (*pbVar11 != 0);
(GHIDRA_CAST<std::string *>((local_54._buf)))->std::string::assign(g_modsDirectory,GHIDRA_UINT((pbVar11 + -0xc72e28)));
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0x1e;
dirNameSize = GHIDRA_CAST<uint *>((pbVar6 + 0x10));
if (0xf < *GHIDRA_CAST<uint *>((pbVar6 + 0x14))) {
pbVar6 = *GHIDRA_CAST<byte **>(pbVar6);
}
pvVar9 = (GHIDRA_CAST<std::string *>((local_54._buf)))->std::string::append(pbVar6,*dirNameSize);
FUN_00417100(pvVar9);
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0x1f;
pvVar9 = (GHIDRA_CAST<std::string *>((local_84._buf)))->std::string::append(GHIDRA_CAST<byte *>("/main.lua"),9);
FUN_00417100(pvVar9);
if (0xf < contentPath._capacity) {
uVar12 = contentPath._capacity + 1;
psVar7 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<std_string *>(contentPath._buf))) + 0x0)));
if (0xfff < uVar12) {
psVar7 = GHIDRA_CAST<std_string *>((GHIDRA_CAST<std_string *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(contentPath._buf)) + 0x0))) + -0x18)))->_capacity);
uVar12 = contentPath._capacity + 0x24;
if (GHIDRA_CAST<byte *>(0x1f) < GHIDRA_CAST<byte *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(contentPath._buf)) + 0x0))) + (-4 - GHIDRA_INT(psVar7)))))
goto LAB_008f46dd;
}
operator_delete(psVar7,uVar12);
}
uVar2 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(pathTmp._buf)) + 0x0)));
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(pathTmp._buf)) + 0x0))) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(pathTmp._buf)) + 0x0))) & 0xffffff00;
uVar3 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(pathTmp._buf)) + 0x0)));
pathTmp._buf[0] = (char)uVar2;
pathTmp._buf[1] = SUB41(uVar2,1);
pathTmp._buf[2] = SUB41(uVar2,2);
pathTmp._buf[3] = SUB41(uVar2,3);
contentPath._buf[0] = pathTmp._buf[0];
contentPath._buf[1] = pathTmp._buf[1];
contentPath._buf[2] = pathTmp._buf[2];
contentPath._buf[3] = pathTmp._buf[3];
contentPath._buf[4] = pathTmp._buf[4];
contentPath._buf[5] = pathTmp._buf[5];
contentPath._buf[6] = pathTmp._buf[6];
contentPath._buf[7] = pathTmp._buf[7];
contentPath._buf[8] = pathTmp._buf[8];
contentPath._buf[9] = pathTmp._buf[9];
contentPath._buf[10] = pathTmp._buf[10];
contentPath._buf[0xb] = pathTmp._buf[0xb];
contentPath._buf[0xc] = pathTmp._buf[0xc];
contentPath._buf[0xd] = pathTmp._buf[0xd];
contentPath._buf[0xe] = pathTmp._buf[0xe];
contentPath._buf[0xf] = pathTmp._buf[0xf];
contentPath._capacity = pathTmp._capacity;
contentPath._size = pathTmp._size;
pathTmp._size = 0;
pathTmp._capacity = 0xf;
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(pathTmp._buf)) + 0x0))) = uVar3;
(GHIDRA_CAST<std::string *>((pathTmp._buf)))->std::string::_Tidy_deallocate();
(GHIDRA_CAST<std::string *>((local_84._buf)))->std::string::_Tidy_deallocate();
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 2;
if (0xf < local_54._capacity) {
uVar12 = local_54._capacity + 1;
pvVar9 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)local_54._buf)) + 0x0)));
if (0xfff < uVar12) {
pvVar9 = *(void **)((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_54._buf)) + 0x0))) + -4);
uVar12 = local_54._capacity + 0x24;
if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_54._buf)) + 0x0))) + (-4 - GHIDRA_INT(pvVar9))))) {
LAB_008f46dd:
/* WARNING: Subroutine does not return */
_invalid_parameter_noinfo_noreturn();
}
}
operator_delete(pvVar9,uVar12);
}
pbVar6 = (GHIDRA_CAST<std::string *>((contentPath._buf)))->std::string::c_str();
isFileFound = file_exists(pbVar6);
if (isFileFound != 0) {
DAT_00c71698 = *GHIDRA_CAST<int *>(modSlot);
pbVar6 = (GHIDRA_CAST<std::string *>((contentPath._buf)))->std::string::c_str();
FUN_0086e6c0(pbVar6);
DAT_00c71698 = 0;
}
local_14 = 0xffffffff;
(GHIDRA_CAST<std::string *>((contentPath._buf)))->std::string::_Tidy_deallocate();
}
modSlot = (ModManager)(GHIDRA_INT(modSlot) + 4);
pcVar8 = pcStack_20;
} while (modSlot != this[1]);
}
pcStack_20 = pcVar8;
(GHIDRA_CAST<Menu_Mods *>((GHIDRA_CAST<Menu_Mods *>(&g_manager->_entityConfig))))->Menu_Mods::Update();
(GHIDRA_CAST<std::string *>((local_84._buf)))->std::string::string_from_cstr(GHIDRA_CAST<byte *>("gfx/ui/mod_defaults.anm2"));
local_14 = 0x20;
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((this + 0x8052)))))->ANM2::Load(&local_84,1);
(GHIDRA_CAST<std::string *>((local_84._buf)))->std::string::_Tidy_deallocate();
ExceptionList = local_1c;
return;
}
// 008f46f0
void ModManager::LoadModItemPools()
{
byte *resolvedPath;
std_string *psVar1;
void *resolvedPath;
uint uVar2;
ModManager modSlot;
std_string *contentPath [5];
uint contentPathCapacity;
std_string fileName;
uint local_14;
void *local_10;
undefined1 *puStack_c;
uint local_8;
puStack_c = &LAB_00b07785;
local_10 = ExceptionList;
local_14 = __security_cookie ^ GHIDRA_UINT(&(&fileName)[1]._size);
ExceptionList = &local_10;
if ((g_game != GHIDRA_CAST<Game *>(0x0)) && (modSlot = *this, modSlot != this[1])) {
do {
if (*GHIDRA_CAST<char *>((GHIDRA_INT(*(void **))modSlot + 0xfd)) != '\0') {
builtin_strncpy(fileName._buf + 8,"s.xml",6);
fileName._capacity = 0xf;
fileName._size = 0xd;
builtin_strncpy(fileName._buf,"itempool",8);
local_8 = 0;
(GHIDRA_CAST<Mod *>((*(void **)modSlot)))->Mod::GetContentPath(GHIDRA_CAST<std_string *>(contentPath),&fileName);
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 2;
if (0xf < fileName._capacity) {
uVar2 = fileName._capacity + 1;
resolvedPath = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)fileName._buf)) + 0x0)));
if (0xfff < uVar2) {
resolvedPath = *(void **)((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(fileName._buf)) + 0x0))) + -4);
uVar2 = fileName._capacity + 0x24;
if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(fileName._buf)) + 0x0))) + (-4 - GHIDRA_INT(resolvedPath))))) goto LAB_008f4883;
}
operator_delete(resolvedPath,uVar2);
}
psVar1 = GHIDRA_CAST<std_string *>(contentPath);
if (0xf < contentPathCapacity) {
psVar1 = contentPath[0];
}
resolvedPath = FileSystem::ResolvePath(GHIDRA_CAST<byte *>(psVar1));
if (resolvedPath != GHIDRA_CAST<byte *>(0x0)) {
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 3;
tracked_alloc(1,resolvedPath,0);
local_8 = CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x1))),2);
psVar1 = GHIDRA_CAST<std_string *>(contentPath);
if (0xf < contentPathCapacity) {
psVar1 = contentPath[0];
}
(GHIDRA_CAST<ItemPool *>((&g_game->_itemPool)))->ItemPool::load_pools(GHIDRA_CAST<byte *>(psVar1),1);
}
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 0xff;
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x1))) = 0xffffff;
if (0xf < contentPathCapacity) {
uVar2 = contentPathCapacity + 1;
psVar1 = contentPath[0];
if (0xfff < uVar2) {
psVar1 = GHIDRA_CAST<std_string *>(contentPath[0][-1]._capacity);
uVar2 = contentPathCapacity + 0x24;
if (GHIDRA_CAST<byte *>(0x1f) < GHIDRA_CAST<byte *>((GHIDRA_INT(contentPath[0]) + (-4 - GHIDRA_INT(psVar1))))) {
LAB_008f4883:
/* WARNING: Subroutine does not return */
_invalid_parameter_noinfo_noreturn();
}
}
operator_delete(psVar1,uVar2);
}
}
modSlot = (ModManager)(GHIDRA_INT(modSlot) + 4);
} while (modSlot != this[1]);
}
ExceptionList = local_10;
return;
}
// 008f4890
void ModManager::LoadModBossPools()
{
byte *resolvedPath;
std_string *psVar1;
int *in_ECX;
void *allocBase;
uint allocSize;
undefined4 *modSlot;
std_string *contentPath [5];
uint contentPathCapacity;
std_string fileName;
uint local_14;
void *local_10;
undefined1 *puStack_c;
uint local_8;
puStack_c = &LAB_00b07785;
local_10 = ExceptionList;
local_14 = __security_cookie ^ GHIDRA_UINT(&(&fileName)[1]._size);
ExceptionList = &local_10;
if ((g_game != GHIDRA_CAST<Game *>(0x0)) &&
(modSlot = GHIDRA_CAST<undefined4 *>(*in_ECX), modSlot != GHIDRA_CAST<undefined4 *>(in_ECX[1]))) {
do {
if (*GHIDRA_CAST<char *>((GHIDRA_INT(*modSlot) + 0xfd)) != '\0') {
builtin_strncpy(fileName._buf + 8,"s.xml",6);
fileName._capacity = 0xf;
fileName._size = 0xd;
builtin_strncpy(fileName._buf,"bosspool",8);
local_8 = 0;
(GHIDRA_CAST<Mod *>(((void *)*modSlot)))->Mod::GetContentPath(GHIDRA_CAST<std_string *>(contentPath),&fileName);
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 2;
if (0xf < fileName._capacity) {
allocSize = fileName._capacity + 1;
allocBase = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)fileName._buf)) + 0x0)));
if (0xfff < allocSize) {
allocBase = *(void **)((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(fileName._buf)) + 0x0))) + -4);
allocSize = fileName._capacity + 0x24;
if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(fileName._buf)) + 0x0))) + (-4 - GHIDRA_INT(allocBase))))) goto LAB_008f4a23;
}
operator_delete(allocBase,allocSize);
}
psVar1 = GHIDRA_CAST<std_string *>(contentPath);
if (0xf < contentPathCapacity) {
psVar1 = contentPath[0];
}
resolvedPath = FileSystem::ResolvePath(GHIDRA_CAST<byte *>(psVar1));
if (resolvedPath != GHIDRA_CAST<byte *>(0x0)) {
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 3;
tracked_alloc(1,resolvedPath,0);
local_8 = CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x1))),2);
psVar1 = GHIDRA_CAST<std_string *>(contentPath);
if (0xf < contentPathCapacity) {
psVar1 = contentPath[0];
}
BossPool::load_xml(psVar1,*modSlot);
}
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 0xff;
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x1))) = 0xffffff;
if (0xf < contentPathCapacity) {
allocSize = contentPathCapacity + 1;
psVar1 = contentPath[0];
if (0xfff < allocSize) {
psVar1 = GHIDRA_CAST<std_string *>(contentPath[0][-1]._capacity);
allocSize = contentPathCapacity + 0x24;
if (GHIDRA_CAST<byte *>(0x1f) < GHIDRA_CAST<byte *>((GHIDRA_INT(contentPath[0]) + (-4 - GHIDRA_INT(psVar1))))) {
LAB_008f4a23:
/* WARNING: Subroutine does not return */
_invalid_parameter_noinfo_noreturn();
}
}
operator_delete(psVar1,allocSize);
}
}
modSlot = modSlot + 1;
} while (modSlot != GHIDRA_CAST<undefined4 *>(in_ECX[1]));
}
ExceptionList = local_10;
return;
}
// 008f4a30
void ModManager::LoadShaders()
{
char cVar1;
int iVar2;
int iVar3;
ulonglong uVar4;
uint uVar5;
byte *pbVar6;
std_string *pathCStr;
int iVar7;
void *pvVar8;
int *piVar9;
undefined4 *puVar10;
int *piVar11;
int *piVar12;
uint uVar13;
qword *allocCounter;
byte *childNode;
byte *pbVar14;
char *pcVar15;
ModManager curModIt;
bool isLess;
char *pcVar16;
byte bVar17;
std_string *vertexSource;
undefined4 uStack_10124;
std_string *fragmentSource;
undefined4 uStack_1011c;
ModManager modIt;
byte *fileBuffer;
uint cleanupFlags;
std_string *psStack_1010c;
undefined8 uStack_10108;
int *piStack_100fc;
byte *shaderEntry;
byte *pbStack_100f4;
byte *pbStack_100f0;
byte bStack_100e9;
undefined1 xmlDoc [48];
undefined1 auStack_100b8 [65560];
uint local_a0;
char acStack_9c [4];
char acStack_98 [4];
char acStack_94 [4];
uint uStack_90;
uint uStack_8c;
std_string configPath;
std_string vertexText;
std_string fragmentText;
std_string tmpString;
uint stackCookie;
std_string **ppsStack_20;
void *local_1c;
undefined1 *puStack_18;
undefined4 local_14;
qword allocatedBytes;
longlong attribArrayBytes;
ppsStack_20 = GHIDRA_CAST<std_string **>((GHIDRA_INT(&configPath) + 0x80));
puStack_18 = &LAB_00b0783f;
local_1c = ExceptionList;
stackCookie = __security_cookie ^ GHIDRA_INT(&configPath) + 0x74U;
ExceptionList = &local_1c;
modIt = *this;
cleanupFlags = 0;
if (modIt != this[1]) {
do {
curModIt = modIt;
if (*GHIDRA_CAST<char *>((GHIDRA_INT(*(void **))modIt + 0xfd)) != '\0') {
builtin_strncpy(tmpString._buf + 8,"xml",4);
tmpString._capacity = 0xf;
tmpString._size = 0xb;
builtin_strncpy(tmpString._buf,"shaders.",8);
local_14 = 0;
(GHIDRA_CAST<Mod *>((*(void **)modIt)))->Mod::GetContentPath(&configPath,&tmpString);
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 2;
if (0xf < tmpString._capacity) {
uVar13 = tmpString._capacity + 1;
pvVar8 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)tmpString._buf)) + 0x0)));
if (0xfff < uVar13) {
pvVar8 = *(void **)((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpString._buf)) + 0x0))) + -4);
uVar13 = tmpString._capacity + 0x24;
if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpString._buf)) + 0x0))) + (-4 - GHIDRA_INT(pvVar8))))) {
LAB_008f5943:
/* WARNING: Subroutine does not return */
_invalid_parameter_noinfo_noreturn();
}
}
operator_delete(pvVar8,uVar13);
}
pathCStr = &configPath;
if (0xf < configPath._capacity) {
pathCStr = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<std_string *>(configPath._buf))) + 0x0)));
}
pbVar6 = FileSystem::ResolvePath(GHIDRA_CAST<byte *>(pathCStr));
bStack_100e9 = pbVar6 != GHIDRA_CAST<byte *>(0x0);
if (pbVar6 != GHIDRA_CAST<byte *>(0x0)) {
if (g_mainHeap == (void *)0x0) {
allocCounter = &g_allocatedBytesNoHeap;
}
else {
allocCounter = GHIDRA_CAST<qword *>((GHIDRA_INT(g_mainHeap) + 0x30));
}
uVar13 = *GHIDRA_CAST<uint *>((pbVar6 + -4));
allocatedBytes = *allocCounter;
*GHIDRA_CAST<uint *>(allocCounter) = GHIDRA_UINT(*allocCounter) - uVar13;
*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(allocCounter) + 4)) =
*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(allocCounter) + 4)) - GHIDRA_UINT((GHIDRA_UINT(allocatedBytes) < uVar13));
free(pbVar6 + -4);
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 2;
}
if (bStack_100e9 != 0) {
pathCStr = &configPath;
if (0xf < configPath._capacity) {
pathCStr = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<std_string *>(configPath._buf))) + 0x0)));
}
piStack_100fc = (GHIDRA_CAST<FileSystem *>((&PTR_vftable_00c37a10)))->FileSystem::Open(GHIDRA_CAST<byte *>(pathCStr),GHIDRA_CAST<int *>(0x0));
if (piStack_100fc == GHIDRA_CAST<int *>(0x0)) {
KAGE_LogMessage(1,GHIDRA_CAST<byte *>("[warn] Failed to open shader config file %s\n"));
}
else {
iVar7 = (**(code **)(*piStack_100fc + 4))();
fileBuffer = operator_new_tracked(iVar7 + 1);
(**(code **)(*piStack_100fc + 0x14))(fileBuffer,1,iVar7);
fileBuffer[iVar7] = 0;
(**(code **)*piStack_100fc)(1);
FUN_00413b90();
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 4;
pcVar16 = GHIDRA_CAST<char *>(0x8f4c1d);
pbVar6 = fileBuffer;
(GHIDRA_CAST<rapidxml::xml_document *>((xmlDoc)))->rapidxml::xml_document::parse(fileBuffer);
bVar17 = (byte)pbVar6;
pvVar8 = (GHIDRA_CAST<xml_node *>((xmlDoc)))->xml_node::first_node(GHIDRA_CAST<byte *>("shaders"),GHIDRA_INT(pcVar16),bVar17);
if (pvVar8 == (void *)0x0) {
piVar9 = *GHIDRA_CAST<int **>(curModIt);
if (0xf < GHIDRA_UINT(piVar9[5])) {
piVar9 = GHIDRA_CAST<int *>(*piVar9);
}
bVar17 = (byte)piVar9;
pcVar16 = "Could not find root node \'shaders\' in mod %s\n";
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("Could not find root node \'shaders\' in mod %s\n"));
}
for (piStack_100fc = (GHIDRA_CAST<xml_node *>((pvVar8)))->xml_node::first_node(GHIDRA_CAST<byte *>("shader"),GHIDRA_INT(pcVar16),bVar17);
piStack_100fc != GHIDRA_CAST<int *>(0x0); piStack_100fc = GHIDRA_CAST<int *>(piStack_100fc[0xb])) {
pbVar6 = operator_new(0x80);
if (pbVar6 == GHIDRA_CAST<byte *>(0x0)) {
shaderEntry = GHIDRA_CAST<byte *>(0x0);
}
else {
shaderEntry = pbVar6;
memset(pbVar6,0,0x80);
pbVar6[0] = 0;
pbVar6[1] = 0;
pbVar6[2] = 0;
pbVar6[3] = 0;
pbVar6[0x10] = 0;
pbVar6[0x11] = 0;
pbVar6[0x12] = 0;
pbVar6[0x13] = 0;
pbVar6[0x14] = 0xf;
pbVar6[0x15] = 0;
pbVar6[0x16] = 0;
pbVar6[0x17] = 0;
*pbVar6 = 0;
FUN_00a245b0();
pbVar6[0x68] = 0;
pbVar6[0x69] = 0;
pbVar6[0x6a] = 0;
pbVar6[0x6b] = 0;
pbVar6[0x6c] = 0;
pbVar6[0x6d] = 0;
pbVar6[0x6e] = 0;
pbVar6[0x6f] = 0;
pbVar14 = pbVar6 + 0x70;
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 8;
uStack_10108 = CONCAT44(pbVar14,(undefined4)uStack_10108);
pbVar14[0] = 0;
pbVar14[1] = 0;
pbVar14[2] = 0;
pbVar14[3] = 0;
pbVar6[0x74] = 0;
pbVar6[0x75] = 0;
pbVar6[0x76] = 0;
pbVar6[0x77] = 0;
pvVar8 = operator_new(0x2c);
*(void **)pvVar8 = pvVar8;
*(void **)(GHIDRA_CAST<char *>(pvVar8) + 4) = pvVar8;
*(void **)(GHIDRA_CAST<char *>(pvVar8) + 8) = pvVar8;
*GHIDRA_CAST<undefined2 *>((GHIDRA_CAST<char *>(pvVar8) + 0xc)) = 0x101;
*(void **)pbVar14 = pvVar8;
}
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 4;
pbVar6 = s_name;
do {
pbStack_100f4 = pbVar6;
pbVar6 = pbStack_100f4 + 1;
} while (*pbVar6 != 0);
pbStack_100f4 = pbStack_100f4 + -0xb1c13b;
for (pbStack_100f0 = GHIDRA_CAST<byte *>(piStack_100fc[8]); pbStack_100f0 != GHIDRA_CAST<byte *>(0x0);
pbStack_100f0 = *GHIDRA_CAST<byte **>((GHIDRA_CAST<char *>(pbStack_100f0) + 0x18))) {
pbVar6 = *GHIDRA_CAST<byte **>(pbStack_100f0);
if (pbVar6 == GHIDRA_CAST<byte *>(0x0)) {
pbVar14 = GHIDRA_CAST<byte *>(0x0);
pbVar6 = &g_xmlNullStr;
}
else {
pbVar14 = *GHIDRA_CAST<byte **>((GHIDRA_CAST<char *>(pbStack_100f0) + 8));
}
if (pbVar14 == pbStack_100f4) {
pbVar14 = pbVar14 + GHIDRA_INT(pbVar6);
puVar10 = GHIDRA_CAST<undefined4 *>(pbStack_100f0);
if (pbVar14 <= pbVar6) goto LAB_008f4d93;
iVar7 = GHIDRA_INT(s_name) - GHIDRA_INT(pbVar6);
while (*pbVar6 == pbVar6[iVar7]) {
pbVar6 = pbVar6 + 1;
if (pbVar14 <= pbVar6) goto LAB_008f4d93;
}
}
}
puVar10 = GHIDRA_CAST<undefined4 *>(0x0);
LAB_008f4d93:
pbVar6 = &g_xmlNullStr;
if (GHIDRA_CAST<byte *>(puVar10[1]) != GHIDRA_CAST<byte *>(0x0)) {
pbVar6 = GHIDRA_CAST<byte *>(puVar10[1]);
}
pbVar14 = pbVar6;
do {
bVar17 = *pbVar14;
pbVar14 = pbVar14 + 1;
} while (bVar17 != 0);
(GHIDRA_CAST<std::string *>((GHIDRA_CAST<char *>(shaderEntry))))->std::string::assign(pbVar6,GHIDRA_INT(pbVar14) - GHIDRA_INT((pbVar6 + 1)));
pcVar16 = "parameters";
do {
pcVar15 = pcVar16;
pcVar16 = pcVar15 + 1;
} while (*pcVar16 != '\0');
pbStack_100f0 = GHIDRA_CAST<byte *>(piStack_100fc[6]);
if (pbStack_100f0 != GHIDRA_CAST<byte *>(0x0)) {
LAB_008f4df0:
pbVar6 = *GHIDRA_CAST<byte **>(pbStack_100f0);
if (pbVar6 == GHIDRA_CAST<byte *>(0x0)) {
pcVar16 = GHIDRA_CAST<char *>(0x0);
pbVar6 = &g_xmlNullStr;
}
else {
pcVar16 = *GHIDRA_CAST<char **>((GHIDRA_CAST<char *>(pbStack_100f0) + 8));
}
if (pcVar16 != pcVar15 + -0xb76d4b) goto LAB_008f4e81;
pbVar14 = GHIDRA_CAST<byte *>((pcVar16 + GHIDRA_INT(pbVar6)));
if (pbVar6 < pbVar14) {
iVar7 = GHIDRA_INT("parameters") - GHIDRA_INT(pbVar6);
while (*pbVar6 == pbVar6[iVar7]) {
pbVar6 = pbVar6 + 1;
if (pbVar14 <= pbVar6) goto LAB_008f4e26;
}
goto LAB_008f4e81;
}
LAB_008f4e26:
shaderEntry[0x78] = 0;
shaderEntry[0x79] = 0;
shaderEntry[0x7a] = 0;
shaderEntry[0x7b] = 0;
if (pbStack_100f0 != GHIDRA_CAST<byte *>(0x0)) {
pcVar16 = "param";
do {
pcVar15 = pcVar16;
pcVar16 = pcVar15 + 1;
} while (*pcVar16 != '\0');
for (pbStack_100f4 = *GHIDRA_CAST<byte **>((GHIDRA_CAST<char *>(pbStack_100f0) + 0x18));
pbStack_100f4 != GHIDRA_CAST<byte *>(0x0); pbStack_100f4 = *GHIDRA_CAST<byte **>((pbStack_100f4 + 0x2c))
) {
pbVar6 = *GHIDRA_CAST<byte **>(pbStack_100f4);
if (pbVar6 == GHIDRA_CAST<byte *>(0x0)) {
pcVar16 = GHIDRA_CAST<char *>(0x0);
pbVar6 = &g_xmlNullStr;
}
else {
pcVar16 = *GHIDRA_CAST<char **>((pbStack_100f4 + 8));
}
if (pcVar16 == pcVar15 + -0xb76d43) {
pbVar14 = GHIDRA_CAST<byte *>((pcVar16 + GHIDRA_INT(pbVar6)));
if (pbVar14 <= pbVar6) goto joined_r0x008f4f6b;
iVar7 = GHIDRA_INT("param") - GHIDRA_INT(pbVar6);
while (*pbVar6 == pbVar6[iVar7]) {
pbVar6 = pbVar6 + 1;
if (pbVar14 <= pbVar6) goto joined_r0x008f4f6b;
}
}
}
pbStack_100f4 = GHIDRA_CAST<byte *>(0x0);
joined_r0x008f4f6b:
do {
if (pbStack_100f4 == GHIDRA_CAST<byte *>(0x0)) break;
pbVar6 = s_name;
do {
pbVar14 = pbVar6;
pbVar6 = pbVar14 + 1;
} while (*pbVar6 != 0);
psStack_1010c = GHIDRA_CAST<std_string *>((pbVar14 + -0xb1c13b));
for (pbStack_100f0 = *GHIDRA_CAST<byte **>((pbStack_100f4 + 0x20));
pbStack_100f0 != GHIDRA_CAST<byte *>(0x0);
pbStack_100f0 = *GHIDRA_CAST<byte **>((GHIDRA_CAST<char *>(pbStack_100f0) + 0x18))) {
pbVar6 = *GHIDRA_CAST<byte **>(pbStack_100f0);
if (pbVar6 == GHIDRA_CAST<byte *>(0x0)) {
pbVar14 = GHIDRA_CAST<byte *>(0x0);
pbVar6 = &g_xmlNullStr;
}
else {
pbVar14 = *GHIDRA_CAST<byte **>((GHIDRA_CAST<char *>(pbStack_100f0) + 8));
}
if (GHIDRA_CAST<std_string *>(pbVar14) == psStack_1010c) {
pbVar14 = pbVar14 + GHIDRA_INT(pbVar6);
puVar10 = GHIDRA_CAST<undefined4 *>(pbStack_100f0);
if (pbVar14 <= pbVar6) goto LAB_008f4fef;
iVar7 = GHIDRA_INT(s_name) - GHIDRA_INT(pbVar6);
while (*pbVar6 == pbVar6[iVar7]) {
pbVar6 = pbVar6 + 1;
if (pbVar14 <= pbVar6) goto LAB_008f4fef;
}
}
}
puVar10 = GHIDRA_CAST<undefined4 *>(0x0);
LAB_008f4fef:
tmpString._size = 0;
pbVar6 = &g_xmlNullStr;
if (GHIDRA_CAST<byte *>(puVar10[1]) != GHIDRA_CAST<byte *>(0x0)) {
pbVar6 = GHIDRA_CAST<byte *>(puVar10[1]);
}
tmpString._capacity = 0xf;
(*GHIDRA_CAST<undefined8 *>((GHIDRA_CAST<char *>(&(tmpString._buf)) + 0x0))) = (*GHIDRA_CAST<undefined8 *>((GHIDRA_CAST<char *>(&(tmpString._buf)) + 0x0))) & 0xffffffff00000000;
pbVar14 = pbVar6;
do {
bVar17 = *pbVar14;
pbVar14 = pbVar14 + 1;
} while (bVar17 != 0);
(GHIDRA_CAST<std::string *>((tmpString._buf)))->std::string::assign(pbVar6,GHIDRA_INT(pbVar14) - GHIDRA_INT((pbVar6 + 1)));
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 9;
uStack_10108 = uStack_10108 & 0xffffffff;
uVar4 = uStack_10108;
pcVar16 = "type";
do {
pcVar15 = pcVar16;
pcVar16 = pcVar15 + 1;
} while (*pcVar16 != '\0');
psStack_1010c = GHIDRA_CAST<std_string *>((pcVar15 + -0xb69a0b));
for (puVar10 = *GHIDRA_CAST<undefined4 **>((pbStack_100f4 + 0x20));
puVar10 != GHIDRA_CAST<undefined4 *>(0x0); puVar10 = GHIDRA_CAST<undefined4 *>(puVar10[6])) {
pbVar6 = GHIDRA_CAST<byte *>(*puVar10);
if (pbVar6 == GHIDRA_CAST<byte *>(0x0)) {
pathCStr = GHIDRA_CAST<std_string *>(0x0);
pbVar6 = &g_xmlNullStr;
}
else {
pathCStr = GHIDRA_CAST<std_string *>(puVar10[2]);
}
if (pathCStr == psStack_1010c) {
pbVar14 = pbVar6 + GHIDRA_INT(pathCStr);
if (pbVar14 <= pbVar6) goto LAB_008f50c3;
iVar7 = GHIDRA_INT(&DAT_00b69a0c) - GHIDRA_INT(pbVar6);
while (*pbVar6 == pbVar6[iVar7]) {
pbVar6 = pbVar6 + 1;
if (pbVar14 <= pbVar6) goto LAB_008f50c3;
}
}
}
puVar10 = GHIDRA_CAST<undefined4 *>(0x0);
LAB_008f50c3:
pcVar16 = "float";
pbStack_100f0 = &g_xmlNullStr;
if (GHIDRA_CAST<byte *>(puVar10[1]) != GHIDRA_CAST<byte *>(0x0)) {
pbStack_100f0 = GHIDRA_CAST<byte *>(puVar10[1]);
}
pbVar6 = pbStack_100f0;
do {
bStack_100e9 = *pbVar6;
isLess = bStack_100e9 < (byte)*pcVar16;
if (bStack_100e9 != *pcVar16) {
LAB_008f5122:
uVar13 = -GHIDRA_UINT(isLess) | 1;
goto LAB_008f5127;
}
if (bStack_100e9 == 0) break;
bStack_100e9 = pbVar6[1];
isLess = bStack_100e9 < (byte)pcVar16[1];
if (bStack_100e9 != pcVar16[1]) goto LAB_008f5122;
pbVar6 = pbVar6 + 2;
pcVar16 = pcVar16 + 2;
} while (bStack_100e9 != 0);
uVar13 = 0;
LAB_008f5127:
if (uVar13 == 0) {
iVar7 = 1;
}
else {
pbVar14 = &DAT_00b76d3c;
pbVar6 = pbStack_100f0;
do {
bStack_100e9 = *pbVar6;
isLess = bStack_100e9 < *pbVar14;
if (bStack_100e9 != *pbVar14) {
LAB_008f5182:
uVar13 = -GHIDRA_UINT(isLess) | 1;
goto LAB_008f5187;
}
if (bStack_100e9 == 0) break;
bStack_100e9 = pbVar6[1];
isLess = bStack_100e9 < pbVar14[1];
if (bStack_100e9 != pbVar14[1]) goto LAB_008f5182;
pbVar6 = pbVar6 + 2;
pbVar14 = pbVar14 + 2;
} while (bStack_100e9 != 0);
uVar13 = 0;
LAB_008f5187:
if (uVar13 == 0) {
iVar7 = 2;
}
else {
pbVar14 = &DAT_00b76d34;
pbVar6 = pbStack_100f0;
do {
bStack_100e9 = *pbVar6;
isLess = bStack_100e9 < *pbVar14;
if (bStack_100e9 != *pbVar14) {
LAB_008f51e2:
uVar13 = -GHIDRA_UINT(isLess) | 1;
goto LAB_008f51e7;
}
if (bStack_100e9 == 0) break;
bStack_100e9 = pbVar6[1];
isLess = bStack_100e9 < pbVar14[1];
if (bStack_100e9 != pbVar14[1]) goto LAB_008f51e2;
pbVar6 = pbVar6 + 2;
pbVar14 = pbVar14 + 2;
} while (bStack_100e9 != 0);
uVar13 = 0;
LAB_008f51e7:
if (uVar13 == 0) {
iVar7 = 3;
}
else {
pbVar14 = &DAT_00b76e54;
pbVar6 = pbStack_100f0;
do {
bVar17 = *pbVar6;
isLess = bVar17 < *pbVar14;
if (bVar17 != *pbVar14) {
LAB_008f5215:
uVar13 = -GHIDRA_UINT(isLess) | 1;
goto LAB_008f521a;
}
if (bVar17 == 0) break;
bVar17 = pbVar6[1];
isLess = bVar17 < pbVar14[1];
if (bVar17 != pbVar14[1]) goto LAB_008f5215;
pbVar6 = pbVar6 + 2;
pbVar14 = pbVar14 + 2;
} while (bVar17 != 0);
uVar13 = 0;
LAB_008f521a:
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(uStack_10108)) + 0x4))) = 0;
iVar7 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(uStack_10108)) + 0x4)));
if (uVar13 == 0) {
iVar7 = 4;
}
}
}
}
uStack_10108 = uVar4;
piVar9 = GHIDRA_CAST<int *>(FUN_008fc6e0(&tmpString));
*piVar9 = iVar7;
*GHIDRA_CAST<int *>((shaderEntry + 0x78)) = *GHIDRA_CAST<int *>((shaderEntry + 0x78)) + iVar7;
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 4;
if (0xf < tmpString._capacity) {
uVar13 = tmpString._capacity + 1;
pvVar8 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)tmpString._buf)) + 0x0)));
if (0xfff < uVar13) {
pvVar8 = *(void **)((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpString._buf)) + 0x0))) + -4);
uVar13 = tmpString._capacity + 0x24;
if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpString._buf)) + 0x0))) + (-4 - GHIDRA_INT(pvVar8)))))
goto LAB_008f5943;
}
operator_delete(pvVar8,uVar13);
}
pbStack_100f4 = *GHIDRA_CAST<byte **>((pbStack_100f4 + 0x2c));
} while( true );
}
goto LAB_008f4e9f;
}
LAB_008f4e92:
shaderEntry[0x78] = 0;
shaderEntry[0x79] = 0;
shaderEntry[0x7a] = 0;
shaderEntry[0x7b] = 0;
LAB_008f4e9f:
uStack_10124 = 0;
uStack_1011c = 0;
pcVar16 = "vertex";
do {
pcVar15 = pcVar16;
pcVar16 = pcVar15 + 1;
} while (*pcVar16 != '\0');
pbStack_100f0 = GHIDRA_CAST<byte *>(piStack_100fc[6]);
for (pbStack_100f4 = pbStack_100f0; pbStack_100f4 != GHIDRA_CAST<byte *>(0x0);
pbStack_100f4 = *GHIDRA_CAST<byte **>((pbStack_100f4 + 0x2c))) {
pbVar6 = *GHIDRA_CAST<byte **>(pbStack_100f4);
if (pbVar6 == GHIDRA_CAST<byte *>(0x0)) {
pcVar16 = GHIDRA_CAST<char *>(0x0);
pbVar6 = &g_xmlNullStr;
}
else {
pcVar16 = *GHIDRA_CAST<char **>((pbStack_100f4 + 8));
}
if (pcVar16 == pcVar15 + -0xb76e4b) {
pbVar14 = GHIDRA_CAST<byte *>((pcVar16 + GHIDRA_INT(pbVar6)));
childNode = pbStack_100f4;
if (pbVar14 <= pbVar6) goto LAB_008f52e7;
iVar7 = GHIDRA_INT("vertex") - GHIDRA_INT(pbVar6);
while (*pbVar6 == pbVar6[iVar7]) {
pbVar6 = pbVar6 + 1;
if (pbVar14 <= pbVar6) goto LAB_008f52e7;
}
}
}
childNode = GHIDRA_CAST<byte *>(0x0);
LAB_008f52e7:
pcVar16 = "fragment";
vertexSource = GHIDRA_CAST<std_string *>(&g_xmlNullStr);
if (*GHIDRA_CAST<std_string **>((*GHIDRA_CAST<int *>((childNode + 0x18)) + 4)) != GHIDRA_CAST<std_string *>(0x0)) {
vertexSource = *GHIDRA_CAST<std_string **>((*GHIDRA_CAST<int *>((childNode + 0x18)) + 4));
}
do {
pcVar15 = pcVar16;
pcVar16 = pcVar15 + 1;
} while (*pcVar16 != '\0');
pcVar15 = pcVar15 + -0xb76e3f;
uStack_10108 = CONCAT44(pcVar15,(undefined4)uStack_10108);
for (; pbStack_100f0 != GHIDRA_CAST<byte *>(0x0); pbStack_100f0 = *GHIDRA_CAST<byte **>((pbStack_100f0 + 0x2c)))
{
pbVar6 = *GHIDRA_CAST<byte **>(pbStack_100f0);
if (pbVar6 == GHIDRA_CAST<byte *>(0x0)) {
pcVar16 = GHIDRA_CAST<char *>(0x0);
pbVar6 = &g_xmlNullStr;
}
else {
pcVar16 = *GHIDRA_CAST<char **>((pbStack_100f0 + 8));
}
if (pcVar16 == pcVar15) {
pbVar14 = GHIDRA_CAST<byte *>((pcVar16 + GHIDRA_INT(pbVar6)));
childNode = pbStack_100f0;
if (pbVar14 <= pbVar6) goto LAB_008f5377;
iVar7 = GHIDRA_INT("fragment") - GHIDRA_INT(pbVar6);
while (*pbVar6 == pbVar6[iVar7]) {
pbVar6 = pbVar6 + 1;
if (pbVar14 <= pbVar6) goto LAB_008f5377;
}
}
}
childNode = GHIDRA_CAST<byte *>(0x0);
LAB_008f5377:
fragmentSource = GHIDRA_CAST<std_string *>(&g_xmlNullStr);
if (*GHIDRA_CAST<std_string **>((*GHIDRA_CAST<int *>((childNode + 0x18)) + 4)) != GHIDRA_CAST<std_string *>(0x0)) {
fragmentSource = *GHIDRA_CAST<std_string **>((*GHIDRA_CAST<int *>((childNode + 0x18)) + 4));
}
vertexText._size = 0;
vertexText._capacity = 0xf;
vertexText._buf[0] = '\0';
vertexText._buf[1] = '\0';
vertexText._buf[2] = '\0';
vertexText._buf[3] = '\0';
fragmentText._size = 0;
fragmentText._capacity = 0xf;
fragmentText._buf[0] = '\0';
fragmentText._buf[1] = '\0';
fragmentText._buf[2] = '\0';
fragmentText._buf[3] = '\0';
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0xb;
psStack_1010c = vertexSource;
if (vertexSource->_buf[0] != 0x23) {
tmpString._size = 0;
tmpString._capacity = 0xf;
(*GHIDRA_CAST<undefined8 *>((GHIDRA_CAST<char *>(&(tmpString._buf)) + 0x0))) = (*GHIDRA_CAST<undefined8 *>((GHIDRA_CAST<char *>(&(tmpString._buf)) + 0x0))) & 0xffffffff00000000;
pcVar16 = std::_Allocate(0x40);
tmpString._size = 0x3c;
tmpString._capacity = 0x3f;
builtin_strncpy(pcVar16,
"#ifndef GL_ES\n#define lowp \n#define mediump \n#endif\n#line 1\n",
0x3d);
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpString._buf)) + 0x0))) = pcVar16;
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0xc;
pathCStr = vertexSource;
do {
pcVar16 = pathCStr->_buf;
pathCStr = GHIDRA_CAST<std_string *>((pathCStr->_buf + 1));
} while (*pcVar16 != '\0');
pcVar16 = (GHIDRA_CAST<std::string *>((tmpString._buf)))->std::string::append(GHIDRA_CAST<byte *>(vertexSource),
GHIDRA_INT(pathCStr) - GHIDRA_INT((vertexSource->_buf + 1)));
cleanupFlags = cleanupFlags | 1;
acStack_98 = *(char (*) [4])pcVar16;
acStack_94 = *(char (*) [4])(pcVar16 + 4);
uStack_90 = *GHIDRA_CAST<uint *>((pcVar16 + 8));
uStack_8c = *GHIDRA_CAST<uint *>((pcVar16 + 0xc));
uStack_10108 = *GHIDRA_CAST<ulonglong *>((pcVar16 + 0x10));
pcVar16[0x10] = '\0';
pcVar16[0x11] = '\0';
pcVar16[0x12] = '\0';
pcVar16[0x13] = '\0';
pcVar16[0x14] = '\x0f';
pcVar16[0x15] = '\0';
pcVar16[0x16] = '\0';
pcVar16[0x17] = '\0';
*pcVar16 = '\0';
if (0xf < vertexText._capacity) {
uVar13 = vertexText._capacity + 1;
pvVar8 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)vertexText._buf)) + 0x0)));
if (0xfff < uVar13) {
pvVar8 = *(void **)((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(vertexText._buf)) + 0x0))) + -4);
uVar13 = vertexText._capacity + 0x24;
if (0x1f < ((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(vertexText._buf)) + 0x0))) - GHIDRA_INT(pvVar8)) - 4U) goto LAB_008f5943;
}
operator_delete(pvVar8,uVar13);
}
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0xb;
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(vertexText._buf)) + 0x0))) = acStack_98;
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(vertexText._buf)) + 0x4))) = acStack_94;
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(vertexText._buf)) + 0x8))) = uStack_90;
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(vertexText._buf)) + 0xc))) = uStack_8c;
(*GHIDRA_CAST<undefined8 *>((GHIDRA_CAST<char *>(&(vertexText)) + 0x10))) = uStack_10108;
if (0xf < tmpString._capacity) {
uVar13 = tmpString._capacity + 1;
pvVar8 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)tmpString._buf)) + 0x0)));
if (0xfff < uVar13) {
pvVar8 = *(void **)((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpString._buf)) + 0x0))) + -4);
uVar13 = tmpString._capacity + 0x24;
if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpString._buf)) + 0x0))) + (-4 - GHIDRA_INT(pvVar8))))) goto LAB_008f5943;
}
operator_delete(pvVar8,uVar13);
}
vertexSource = &vertexText;
if (0xf < vertexText._capacity) {
vertexSource = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<std_string *>(vertexText._buf))) + 0x0)));
}
}
if (fragmentSource->_buf[0] != 0x23) {
tmpString._size = 0;
tmpString._capacity = 0xf;
(*GHIDRA_CAST<undefined8 *>((GHIDRA_CAST<char *>(&(tmpString._buf)) + 0x0))) = (*GHIDRA_CAST<undefined8 *>((GHIDRA_CAST<char *>(&(tmpString._buf)) + 0x0))) & 0xffffffff00000000;
(GHIDRA_CAST<std::string *>((tmpString._buf)))->std::string::assign((byte *)
"#ifndef GL_ES\n#define lowp \n#define mediump \n#endif\n#line 1\n"
,0x3c);
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0xd;
pathCStr = fragmentSource;
do {
pcVar16 = pathCStr->_buf;
pathCStr = GHIDRA_CAST<std_string *>((pathCStr->_buf + 1));
} while (*pcVar16 != '\0');
pvVar8 = (GHIDRA_CAST<std::string *>((tmpString._buf)))->std::string::append(GHIDRA_CAST<byte *>(fragmentSource),
GHIDRA_INT(pathCStr) - GHIDRA_INT((fragmentSource->_buf + 1)));
FUN_00417100(pvVar8);
cleanupFlags = cleanupFlags | 2;
if (0xf < fragmentText._capacity) {
uVar13 = fragmentText._capacity + 1;
pvVar8 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)fragmentText._buf)) + 0x0)));
if (0xfff < uVar13) {
pvVar8 = *(void **)((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(fragmentText._buf)) + 0x0))) + -4);
uVar13 = fragmentText._capacity + 0x24;
if (0x1f < ((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(fragmentText._buf)) + 0x0))) - GHIDRA_INT(pvVar8)) - 4U) goto LAB_008f5943;
}
operator_delete(pvVar8,uVar13);
}
uVar13 = local_a0;
local_a0 = local_a0 & 0xffffff00;
uVar5 = local_a0;
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_a0)) + 0x0))) = (undefined1)uVar13;
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_a0)) + 0x1))) = SUB41(uVar13,1);
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_a0)) + 0x2))) = SUB41(uVar13,2);
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_a0)) + 0x3))) = SUB41(uVar13,3);
fragmentText._buf[0] = (undefined1)local_a0;
fragmentText._buf[1] = (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_a0)) + 0x1)));
fragmentText._buf[2] = (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_a0)) + 0x2)));
fragmentText._buf[3] = (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_a0)) + 0x3)));
fragmentText._buf[4] = acStack_9c[0];
fragmentText._buf[5] = acStack_9c[1];
fragmentText._buf[6] = acStack_9c[2];
fragmentText._buf[7] = acStack_9c[3];
fragmentText._buf[8] = acStack_98[0];
fragmentText._buf[9] = acStack_98[1];
fragmentText._buf[10] = acStack_98[2];
fragmentText._buf[0xb] = acStack_98[3];
fragmentText._buf[0xc] = acStack_94[0];
fragmentText._buf[0xd] = acStack_94[1];
fragmentText._buf[0xe] = acStack_94[2];
fragmentText._buf[0xf] = acStack_94[3];
fragmentText._size = uStack_90;
fragmentText._capacity = uStack_8c;
uStack_90 = 0;
uStack_8c = 0xf;
local_a0 = uVar5;
(GHIDRA_CAST<std::string *>((GHIDRA_CAST<char *>(&local_a0))))->std::string::_Tidy_deallocate();
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0xb;
if (0xf < tmpString._capacity) {
uVar13 = tmpString._capacity + 1;
pvVar8 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)tmpString._buf)) + 0x0)));
if (0xfff < uVar13) {
pvVar8 = *(void **)((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpString._buf)) + 0x0))) + -4);
uVar13 = tmpString._capacity + 0x24;
if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpString._buf)) + 0x0))) + (-4 - GHIDRA_INT(pvVar8))))) goto LAB_008f5943;
}
operator_delete(pvVar8,uVar13);
}
fragmentSource = &fragmentText;
if (0xf < fragmentText._capacity) {
fragmentSource = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<std_string *>(fragmentText._buf))) + 0x0)));
}
}
attribArrayBytes = (ulonglong)(*GHIDRA_CAST<int *>((shaderEntry + 0x74)) + 6) * 8;
puVar10 = operator_new_tracked
(-GHIDRA_UINT((GHIDRA_INT(((ulonglong)attribArrayBytes >> 0x20)) != 0)) |
GHIDRA_UINT(attribArrayBytes));
*GHIDRA_CAST<undefined4 **>((shaderEntry + 0x7c)) = puVar10;
*puVar10 = "Position";
puVar10[1] = 5;
iVar7 = *GHIDRA_CAST<int *>((shaderEntry + 0x7c));
*GHIDRA_CAST<char **>((iVar7 + 8)) = "Color";
*GHIDRA_CAST<undefined4 *>((iVar7 + 0xc)) = 6;
iVar7 = *GHIDRA_CAST<int *>((shaderEntry + 0x7c));
*GHIDRA_CAST<char **>((iVar7 + 0x10)) = "TexCoord";
*GHIDRA_CAST<undefined4 *>((iVar7 + 0x14)) = 7;
iVar7 = *GHIDRA_CAST<int *>((shaderEntry + 0x7c));
*GHIDRA_CAST<char **>((iVar7 + 0x18)) = "RenderData";
*GHIDRA_CAST<undefined4 *>((iVar7 + 0x1c)) = 4;
iVar7 = *GHIDRA_CAST<int *>((shaderEntry + 0x7c));
*GHIDRA_CAST<char **>((iVar7 + 0x20)) = "Scale";
*GHIDRA_CAST<undefined4 *>((iVar7 + 0x24)) = 1;
iVar7 = *GHIDRA_CAST<int *>((shaderEntry + 0x74));
iVar2 = *GHIDRA_CAST<int *>((shaderEntry + 0x7c));
*GHIDRA_CAST<byte **>((iVar2 + 0x28 + iVar7 * 8)) = &s_empty;
*GHIDRA_CAST<undefined4 *>((iVar2 + 0x2c + iVar7 * 8)) = 0;
piVar9 = GHIDRA_CAST<int *>(**GHIDRA_CAST<int **>((shaderEntry + 0x70)));
if (piVar9 != *GHIDRA_CAST<int **>((shaderEntry + 0x70))) {
iVar7 = 0x28;
do {
pvVar8 = operator_new_tracked(piVar9[8] + 1);
piVar11 = piVar9 + 4;
uStack_10108 = CONCAT44(pvVar8,(undefined4)uStack_10108);
if (0xf < GHIDRA_UINT(piVar9[9])) {
piVar11 = GHIDRA_CAST<int *>(*piVar11);
}
piVar12 = piVar11;
do {
iVar2 = *piVar12;
piVar12 = GHIDRA_CAST<int *>((GHIDRA_INT(piVar12) + 1));
*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(pvVar8) + (-1 - GHIDRA_INT(piVar11)) + GHIDRA_INT(piVar12))) = (char)iVar2;
} while ((char)iVar2 != '\0');
iVar2 = piVar9[10];
iVar3 = *GHIDRA_CAST<int *>((shaderEntry + 0x7c));
*(void **)(iVar7 + iVar3) = pvVar8;
*GHIDRA_CAST<int *>((iVar7 + 4 + iVar3)) = iVar2;
iVar7 = iVar7 + 8;
piVar11 = GHIDRA_CAST<int *>(piVar9[2]);
if (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(piVar11) + 0xd)) == '\0') {
cVar1 = *GHIDRA_CAST<char *>((*piVar11 + 0xd));
piVar9 = piVar11;
piVar11 = GHIDRA_CAST<int *>(*piVar11);
while (cVar1 == '\0') {
cVar1 = *GHIDRA_CAST<char *>((*piVar11 + 0xd));
piVar9 = piVar11;
piVar11 = GHIDRA_CAST<int *>(*piVar11);
}
}
else {
cVar1 = *GHIDRA_CAST<char *>((piVar9[1] + 0xd));
piVar12 = GHIDRA_CAST<int *>(piVar9[1]);
piVar11 = piVar9;
while ((piVar9 = piVar12, cVar1 == '\0' && (piVar11 == GHIDRA_CAST<int *>(piVar9[2])))) {
cVar1 = *GHIDRA_CAST<char *>((piVar9[1] + 0xd));
piVar12 = GHIDRA_CAST<int *>(piVar9[1]);
piVar11 = piVar9;
}
}
} while (piVar9 != *GHIDRA_CAST<int **>((shaderEntry + 0x70)));
curModIt = modIt;
}
pbVar6 = shaderEntry;
if (0xf < *GHIDRA_CAST<uint *>((shaderEntry + 0x14))) {
pbVar6 = *GHIDRA_CAST<byte **>(shaderEntry);
}
(GHIDRA_CAST<Shader *>((shaderEntry + 0x18)))->Shader::load(pbVar6,*(void **)(shaderEntry + 0x7c),&vertexSource);
KAGE::SmartPointer<RenderTargetBase>::reset(shaderEntry + 0x68);
iVar7 = *GHIDRA_CAST<int *>(curModIt);
uStack_10108 = CONCAT44(*GHIDRA_CAST<undefined4 *>((iVar7 + 0xe4)),(undefined4)uStack_10108);
if (*GHIDRA_CAST<int *>((iVar7 + 0xe8)) == 0x15555555) {
/* WARNING: Subroutine does not return */
std::_Xlength_error("list too long");
}
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0xe;
piVar9 = operator_new(0xc);
piVar9[2] = GHIDRA_INT(shaderEntry);
*GHIDRA_CAST<int *>((iVar7 + 0xe8)) = *GHIDRA_CAST<int *>((iVar7 + 0xe8)) + 1;
puVar10 = *GHIDRA_CAST<undefined4 **>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(uStack_10108)) + 0x4))) + 4));
*piVar9 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(uStack_10108)) + 0x4)));
piVar9[1] = GHIDRA_INT(puVar10);
*GHIDRA_CAST<int **>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(uStack_10108)) + 0x4))) + 4)) = piVar9;
*puVar10 = piVar9;
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 10;
if (0xf < fragmentText._capacity) {
uVar13 = fragmentText._capacity + 1;
pvVar8 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)fragmentText._buf)) + 0x0)));
if (0xfff < uVar13) {
pvVar8 = *(void **)((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(fragmentText._buf)) + 0x0))) + -4);
uVar13 = fragmentText._capacity + 0x24;
if (0x1f < ((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(fragmentText._buf)) + 0x0))) - GHIDRA_INT(pvVar8)) - 4U) goto LAB_008f5943;
}
operator_delete(pvVar8,uVar13);
}
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 4;
fragmentText._size = 0;
fragmentText._capacity = 0xf;
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(fragmentText._buf)) + 0x0))) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(fragmentText._buf)) + 0x0))) & 0xffffff00;
if (0xf < vertexText._capacity) {
uVar13 = vertexText._capacity + 1;
pvVar8 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)vertexText._buf)) + 0x0)));
if (0xfff < uVar13) {
pvVar8 = *(void **)((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(vertexText._buf)) + 0x0))) + -4);
uVar13 = vertexText._capacity + 0x24;
if (0x1f < ((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(vertexText._buf)) + 0x0))) - GHIDRA_INT(pvVar8)) - 4U) goto LAB_008f5943;
}
operator_delete(pvVar8,uVar13);
}
}
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0xf;
tracked_alloc(1,fileBuffer,0);
local_14 = CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))),0x10);
(GHIDRA_CAST<xml_memory_pool *>((auStack_100b8)))->xml_memory_pool::clear();
}
}
local_14 = 0xffffffff;
(GHIDRA_CAST<std::string *>((configPath._buf)))->std::string::_Tidy_deallocate();
}
modIt = (ModManager)(GHIDRA_INT(curModIt) + 4);
} while (modIt != this[1]);
}
ExceptionList = local_1c;
return;
LAB_008f4e81:
pbStack_100f0 = *GHIDRA_CAST<byte **>((GHIDRA_CAST<char *>(pbStack_100f0) + 0x2c));
if (pbStack_100f0 == GHIDRA_CAST<byte *>(0x0)) goto LAB_008f4e92;
goto LAB_008f4df0;
}
// 008f5ad0
void ModManager::TryRedirectPath(std_string *result, std_string *filePath)
{
uint uVar1;
uint uVar2;
uint uVar3;
ModManager cacheEntry;
undefined4 *appended;
byte *resolvedPath;
byte ****ppppbVar4;
uint ****ppppuVar5;
int iVar6;
undefined4 extraout_ECX;
void *pvVar7;
std_string *filePathStr;
uint slot;
ModManager modIt;
undefined4 *modDirStr;
uint ****fallbackPath;
undefined4 uStack_98;
undefined4 uStack_94;
undefined4 uStack_90;
undefined4 local_8c;
uint uStack_88;
void *modDirCopy [4];
undefined4 modDirCopySize;
uint modDirCopyCapacity;
void *dlcDir;
undefined4 uStack_68;
undefined4 uStack_64;
undefined4 uStack_60;
undefined8 local_5c;
byte ****modDir;
undefined4 uStack_50;
undefined4 uStack_4c;
undefined4 uStack_48;
uint modDirSize;
uint modDirCapacity;
uint ****candidatePath;
undefined4 uStack_38;
undefined4 uStack_34;
undefined4 uStack_30;
undefined8 local_2c;
uint local_24;
undefined1 *puStack_20;
void *local_1c;
undefined1 *puStack_18;
void *local_14;
puStack_20 = GHIDRA_CAST<undefined1 *>((modDirCopy + 0x20));
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0xff;
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))) = 0xffffff;
puStack_18 = &LAB_00b07895;
local_1c = ExceptionList;
uVar1 = __security_cookie ^ GHIDRA_UINT((modDirCopy + 0x1d));
ExceptionList = &local_1c;
filePathStr = filePath;
if (0xf < filePath->_capacity) {
filePathStr = *GHIDRA_CAST<std_string **>(filePath->_buf);
}
local_24 = uVar1;
uVar2 = KAGE_Filesys_FileManager::GetPrimaryFilePathHash(GHIDRA_CAST<byte *>(filePathStr));
uVar1 = FUN_00a15ab0(extraout_ECX,uVar1);
slot = uVar2 & 0x7fff;
uVar3 = 0;
cacheEntry = this[slot + 3];
if (cacheEntry != (ModManager)0x0) {
do {
if (((*GHIDRA_CAST<uint *>(cacheEntry) == uVar2) && (*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(cacheEntry) + 4)) == uVar1)) ||
(0x7fff < uVar3)) break;
slot = slot + 1 & 0x7fff;
uVar3 = uVar3 + 1;
cacheEntry = this[slot + 3];
} while (cacheEntry != (ModManager)0x0);
if (uVar3 == 0x8000) {
if (cacheEntry != (ModManager)0x0) {
(GHIDRA_CAST<std::string *>((GHIDRA_CAST<char *>((GHIDRA_INT(cacheEntry) + 0xc)))))->std::string::_Tidy_deallocate();
operator_delete((void *)cacheEntry,0x24);
}
}
else if (cacheEntry != (ModManager)0x0) goto LAB_008f608f;
}
cacheEntry = (ModManager)operator_new(0x24);
if (cacheEntry == (ModManager)0x0) {
cacheEntry = (ModManager)0x0;
}
else {
*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(cacheEntry) + 0xc)) = 0;
*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(cacheEntry) + 0x1c)) = 0;
*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(cacheEntry) + 0x20)) = 0xf;
}
*GHIDRA_CAST<uint *>(cacheEntry) = uVar2;
*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(cacheEntry) + 4)) = uVar1;
*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(cacheEntry) + 8)) = 0;
this[slot + 3] = cacheEntry;
modIt = *this;
if (modIt != this[1]) {
do {
uVar1 = *GHIDRA_CAST<uint *>(modIt);
if (*GHIDRA_CAST<char *>((uVar1 + 0xfd)) != '\0') {
uVar2 = *GHIDRA_CAST<uint *>((uVar1 + 0x40));
modDirStr = GHIDRA_CAST<undefined4 *>((uVar1 + 0x30));
if (0xf < *GHIDRA_CAST<uint *>((uVar1 + 0x44))) {
modDirStr = GHIDRA_CAST<undefined4 *>(*modDirStr);
}
if (uVar2 < 0x10) {
modDir = GHIDRA_CAST<byte ****>(*modDirStr);
uStack_50 = modDirStr[1];
uStack_4c = modDirStr[2];
uStack_48 = modDirStr[3];
uVar1 = 0xf;
}
else {
uVar1 = uVar2 | 0xf;
if (0x7fffffff < uVar1) {
uVar1 = 0x7fffffff;
}
modDir = std::_Allocate(uVar1 + 1);
memcpy(modDir,modDirStr,uVar2 + 1);
}
local_14 = (void *)0x0;
uVar3 = uVar2 - 1;
if (uVar2 < uVar2 - 1) {
uVar3 = uVar2;
}
ppppbVar4 = GHIDRA_CAST<byte ****>(&modDir);
if (0xf < uVar1) {
ppppbVar4 = modDir;
}
modDirCopySize = 0;
modDirCopyCapacity = 0xf;
modDirCopy[0] = (void *)0x0;
modDirSize = uVar2;
modDirCapacity = uVar1;
(GHIDRA_CAST<std::string *>((GHIDRA_CAST<char *>(modDirCopy))))->std::string::assign(GHIDRA_CAST<byte *>(ppppbVar4),uVar3);
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 1;
appended = (GHIDRA_CAST<std::string *>((GHIDRA_CAST<char *>(modDirCopy))))->std::string::append(GHIDRA_CAST<byte *>("-dlc3/"),6);
dlcDir = (void *)*appended;
uStack_68 = appended[1];
uStack_64 = appended[2];
uStack_60 = appended[3];
local_5c = *GHIDRA_CAST<undefined8 *>((appended + 4));
appended[4] = 0;
appended[5] = 0xf;
*GHIDRA_CAST<undefined1 *>(appended) = 0;
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 2;
filePathStr = filePath;
if (0xf < filePath->_capacity) {
filePathStr = *GHIDRA_CAST<std_string **>(filePath->_buf);
}
appended = (GHIDRA_CAST<std::string *>((GHIDRA_CAST<char *>(&dlcDir))))->std::string::append(GHIDRA_CAST<byte *>(filePathStr),filePath->_size);
candidatePath = GHIDRA_CAST<uint ****>(*appended);
uStack_38 = appended[1];
uStack_34 = appended[2];
uStack_30 = appended[3];
local_2c = *GHIDRA_CAST<undefined8 *>((appended + 4));
appended[4] = 0;
appended[5] = 0xf;
*GHIDRA_CAST<undefined1 *>(appended) = 0;
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 4;
if (0xf < (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_5c)) + 0x4)))) {
uVar1 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_5c)) + 0x4))) + 1;
pvVar7 = dlcDir;
if (0xfff < uVar1) {
pvVar7 = *(void **)(GHIDRA_CAST<char *>(dlcDir) + -4);
uVar1 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_5c)) + 0x4))) + 0x24;
if (0x1f < GHIDRA_UINT((GHIDRA_INT(dlcDir) + (-4 - GHIDRA_INT(pvVar7))))) goto LAB_008f6140;
}
operator_delete(pvVar7,uVar1);
}
local_5c = 0xf00000000;
dlcDir = (void *)(GHIDRA_UINT(dlcDir) & 0xffffff00);
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 5;
if (0xf < modDirCopyCapacity) {
uVar1 = modDirCopyCapacity + 1;
pvVar7 = modDirCopy[0];
if (0xfff < uVar1) {
pvVar7 = *(void **)(GHIDRA_INT(modDirCopy[0]) + -4);
uVar1 = modDirCopyCapacity + 0x24;
if (0x1f < GHIDRA_UINT((GHIDRA_INT(modDirCopy[0]) + (-4 - GHIDRA_INT(pvVar7))))) goto LAB_008f6140;
}
operator_delete(pvVar7,uVar1);
}
modDirCopySize = 0;
ppppuVar5 = GHIDRA_CAST<uint ****>(&candidatePath);
if (0xf < (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_2c)) + 0x4)))) {
ppppuVar5 = candidatePath;
}
modDirCopyCapacity = 0xf;
modDirCopy[0] = (void *)(GHIDRA_UINT(modDirCopy[0]) & 0xffffff00);
resolvedPath = FileSystem::ResolvePath(GHIDRA_CAST<byte *>(ppppuVar5));
if (resolvedPath == GHIDRA_CAST<byte *>(0x0)) {
if (0x7fffffff - modDirSize < filePath->_size) {
/* WARNING: Subroutine does not return */
std::string::_Xlen();
}
ppppbVar4 = GHIDRA_CAST<byte ****>(&modDir);
if (0xf < modDirCapacity) {
ppppbVar4 = modDir;
}
filePathStr = filePath;
if (0xf < filePath->_capacity) {
filePathStr = *GHIDRA_CAST<std_string **>(filePath->_buf);
}
(GHIDRA_CAST<std::string *>((GHIDRA_CAST<char *>(&fallbackPath))))->std::string::concat(GHIDRA_INT(result),filePathStr,GHIDRA_CAST<byte *>(ppppbVar4),
modDirSize,GHIDRA_CAST<byte *>(filePathStr),filePath->_size);
if (0xf < (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_2c)) + 0x4)))) {
uVar1 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_2c)) + 0x4))) + 1;
ppppuVar5 = candidatePath;
if (0xfff < uVar1) {
ppppuVar5 = GHIDRA_CAST<uint ****>(candidatePath[-1]);
uVar1 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_2c)) + 0x4))) + 0x24;
if (0x1f < GHIDRA_UINT((GHIDRA_INT(candidatePath) + (-4 - GHIDRA_INT(ppppuVar5))))) goto LAB_008f6140;
}
operator_delete(ppppuVar5,uVar1);
}
candidatePath = fallbackPath;
uStack_38 = uStack_98;
uStack_34 = uStack_94;
uStack_30 = uStack_90;
ppppuVar5 = GHIDRA_CAST<uint ****>(&candidatePath);
if (0xf < uStack_88) {
ppppuVar5 = fallbackPath;
}
local_2c = CONCAT44(uStack_88,local_8c);
resolvedPath = FileSystem::ResolvePath(GHIDRA_CAST<byte *>(ppppuVar5));
if (resolvedPath != GHIDRA_CAST<byte *>(0x0)) {
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 7;
tracked_alloc(1,resolvedPath,0);
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 5;
}
if (resolvedPath == GHIDRA_CAST<byte *>(0x0)) {
if (0xf < (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_2c)) + 0x4)))) {
uVar1 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_2c)) + 0x4))) + 1;
ppppuVar5 = candidatePath;
if (0xfff < uVar1) {
ppppuVar5 = GHIDRA_CAST<uint ****>(candidatePath[-1]);
uVar1 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_2c)) + 0x4))) + 0x24;
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0;
if (0x1f < GHIDRA_UINT((GHIDRA_INT(candidatePath) + (-4 - GHIDRA_INT(ppppuVar5))))) goto LAB_008f6140;
}
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = resolvedPath != GHIDRA_CAST<byte *>(0x0);
operator_delete(ppppuVar5,uVar1);
}
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0xff;
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))) = 0xffffff;
local_2c = 0xf00000000;
candidatePath = GHIDRA_CAST<uint ****>((GHIDRA_UINT(candidatePath) & 0xffffff00));
if (0xf < modDirCapacity) {
uVar1 = modDirCapacity + 1;
ppppbVar4 = modDir;
if (0xfff < uVar1) {
ppppbVar4 = GHIDRA_CAST<byte ****>(modDir[-1]);
uVar1 = modDirCapacity + 0x24;
if (GHIDRA_CAST<byte *>(0x1f) < GHIDRA_CAST<byte *>((GHIDRA_INT(modDir) + (-4 - GHIDRA_INT(ppppbVar4))))) goto LAB_008f6140;
}
operator_delete(ppppbVar4,uVar1);
}
goto LAB_008f5fd3;
}
*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(cacheEntry) + 8)) = *GHIDRA_CAST<uint *>(modIt);
if (GHIDRA_CAST<uint *****>((GHIDRA_INT(cacheEntry) + 0xc)) != &candidatePath) {
ppppuVar5 = GHIDRA_CAST<uint ****>(&candidatePath);
if (0xf < (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_2c)) + 0x4)))) {
ppppuVar5 = candidatePath;
}
(GHIDRA_CAST<std::string *>((GHIDRA_CAST<char *>((GHIDRA_INT(cacheEntry) + 0xc)))))->std::string::assign(GHIDRA_CAST<byte *>(ppppuVar5),GHIDRA_UINT(local_2c));
}
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0;
if (0xf < (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_2c)) + 0x4)))) {
uVar1 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_2c)) + 0x4))) + 1;
ppppuVar5 = candidatePath;
if (0xfff < uVar1) {
ppppuVar5 = GHIDRA_CAST<uint ****>(candidatePath[-1]);
uVar1 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_2c)) + 0x4))) + 0x24;
if (0x1f < GHIDRA_UINT((GHIDRA_INT(candidatePath) + (-4 - GHIDRA_INT(ppppuVar5))))) goto LAB_008f6140;
}
operator_delete(ppppuVar5,uVar1);
}
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0xff;
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))) = 0xffffff;
local_2c = 0xf00000000;
candidatePath = GHIDRA_CAST<uint ****>((GHIDRA_UINT(candidatePath) & 0xffffff00));
if (modDirCapacity < 0x10) break;
uVar1 = modDirCapacity + 1;
ppppbVar4 = modDir;
if (0xfff < uVar1) {
ppppbVar4 = GHIDRA_CAST<byte ****>(modDir[-1]);
iVar6 = GHIDRA_INT(modDir) - GHIDRA_INT(ppppbVar4);
goto joined_r0x008f613a;
}
}
else {
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 6;
tracked_alloc(1,resolvedPath,0);
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 5;
*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(cacheEntry) + 8)) = *GHIDRA_CAST<uint *>(modIt);
if (GHIDRA_CAST<uint *****>((GHIDRA_INT(cacheEntry) + 0xc)) != &candidatePath) {
ppppuVar5 = GHIDRA_CAST<uint ****>(&candidatePath);
if (0xf < (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_2c)) + 0x4)))) {
ppppuVar5 = candidatePath;
}
(GHIDRA_CAST<std::string *>((GHIDRA_CAST<char *>((GHIDRA_INT(cacheEntry) + 0xc)))))->std::string::assign(GHIDRA_CAST<byte *>(ppppuVar5),GHIDRA_UINT(local_2c));
}
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0;
if (0xf < (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_2c)) + 0x4)))) {
uVar1 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_2c)) + 0x4))) + 1;
ppppuVar5 = candidatePath;
if (0xfff < uVar1) {
ppppuVar5 = GHIDRA_CAST<uint ****>(candidatePath[-1]);
uVar1 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_2c)) + 0x4))) + 0x24;
if (0x1f < GHIDRA_UINT((GHIDRA_INT(candidatePath) + (-4 - GHIDRA_INT(ppppuVar5))))) goto LAB_008f6140;
}
operator_delete(ppppuVar5,uVar1);
}
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0xff;
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))) = 0xffffff;
local_2c = 0xf00000000;
candidatePath = GHIDRA_CAST<uint ****>((GHIDRA_UINT(candidatePath) & 0xffffff00));
if (modDirCapacity < 0x10) break;
uVar1 = modDirCapacity + 1;
ppppbVar4 = modDir;
if (0xfff < uVar1) {
ppppbVar4 = GHIDRA_CAST<byte ****>(modDir[-1]);
iVar6 = GHIDRA_INT(modDir) - GHIDRA_INT(ppppbVar4);
joined_r0x008f613a:
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))) = 0xffffff;
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0xff;
local_2c = 0xf00000000;
uVar1 = modDirCapacity + 0x24;
if (0x1f < iVar6 - 4U) {
LAB_008f6140:
/* WARNING: Subroutine does not return */
_invalid_parameter_noinfo_noreturn();
}
}
}
local_2c = 0xf00000000;
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))) = 0xffffff;
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0xff;
operator_delete(ppppbVar4,uVar1);
break;
}
LAB_008f5fd3:
modIt = (ModManager)(GHIDRA_INT(modIt) + 4);
} while (modIt != this[1]);
}
LAB_008f608f:
if (*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(cacheEntry) + 8)) != 0) {
filePath = GHIDRA_CAST<std_string *>((GHIDRA_INT(cacheEntry) + 0xc));
}
(GHIDRA_CAST<std::string *>((result->_buf)))->std::string::string(filePath);
ExceptionList = local_1c;
return;
}
// 008f61d0
void ModManager::ListMods()
{
uint *ptr;
ModManager MVar1;
undefined4 uVar2;
byte bVar3;
char cVar4;
uint uVar5;
byte *pbVar6;
int *piVar7;
ModEntry *pMVar8;
ModEntry *extraout_EAX;
ModEntry **fileSize;
undefined4 *node;
void *pvVar9;
ModEntry *pMVar10;
ModManager newModState;
byte *pbVar11;
std_string *psVar12;
undefined1 *puVar13;
undefined1 *puVar14;
char *pcVar15;
uint uVar16;
uint size;
qword *allocatedBytes;
int ptrDelta;
char *pcVar17;
ModEntry **ppMVar18;
int enabledModCount;
ModEntry *pMStack_100fc;
uint cleanupFlags;
code *tolowerFn;
uint dirIndex;
void *dirEntries;
int saveDirSize;
byte *pbStack_100e4;
ModEntry *pMStack_100e0;
ModEntry *modEntry;
ModEntry *pMStack_100d8;
char cStack_100d1;
undefined4 xmlDoc;
undefined4 uStack_100cc;
undefined4 uStack_100c0;
undefined4 uStack_100bc;
undefined4 *docFirstNode;
undefined4 *docLastNode;
undefined4 uStack_100b0;
undefined1 *xmlPool;
undefined1 *puStack_1009c;
undefined4 *puStack_10098;
undefined1 xmlPoolBuffer [65536];
undefined4 uStack_94;
undefined4 uStack_90;
void *modSaveDirTmp [5];
uint modSaveDirTmpCapacity;
void *pvStack_70;
int iStack_6c;
uint uStack_68;
uint uStack_64;
int saveDirTmpSize;
byte *saveDirTmpCapacity;
ModEntry *modPath [4];
std_string *modPathSize;
uint modPathCapacity;
undefined1 tmpString [12];
int iStack_34;
uint tmpStringSize;
uint tmpStringCapacity;
uint stackCookie;
undefined1 *puStack_20;
void *savedExceptionList;
undefined1 *puStack_18;
undefined4 ehState;
byte *cmpEnd;
ModEntry *dirEntryCount;
code *freeFn;
qword prevAllocated;
puStack_20 = tmpString + 0x3c;
ehState = 0xffffffff;
puStack_18 = &LAB_00b0790d;
savedExceptionList = ExceptionList;
uVar5 = __security_cookie ^ GHIDRA_UINT((tmpString + 0x30));
ExceptionList = &savedExceptionList;
cleanupFlags = 0;
pMStack_100e0 = GHIDRA_CAST<ModEntry *>(0x0);
stackCookie = uVar5;
dirEntries = filesys_list_directory(&s_empty,g_modsDirectory,GHIDRA_CAST<int *>(&pMStack_100e0));
KAGE_LogMessage(1,GHIDRA_CAST<byte *>("begin list mods\n"));
dirEntryCount = pMStack_100e0;
freeFn = free_exref;
enabledModCount = 0;
dirIndex = 0;
if (pMStack_100e0 != GHIDRA_CAST<ModEntry *>(0x0)) {
tolowerFn = tolower_exref;
pvVar9 = dirEntries;
do {
uVar16 = dirIndex;
if ((*GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(pvVar9) + dirIndex * 8)) & 2) != 0) {
modPathSize = GHIDRA_CAST<std_string *>(0x0);
modPathCapacity = 0xf;
modPath[0] = GHIDRA_CAST<ModEntry *>(0x0);
pbVar6 = g_modsDirectory;
do {
pbVar11 = pbVar6;
pbVar6 = pbVar11 + 1;
} while (*pbVar11 != 0);
(GHIDRA_CAST<std::string *>((GHIDRA_CAST<char *>(modPath))))->std::string::assign(g_modsDirectory,GHIDRA_UINT((pbVar11 + -0xc72e28)));
ehState = 0;
pbVar6 = *GHIDRA_CAST<byte **>((GHIDRA_CAST<char *>(pvVar9) + uVar16 * 8 + 4));
pbVar11 = pbVar6;
do {
bVar3 = *pbVar11;
pbVar11 = pbVar11 + 1;
} while (bVar3 != 0);
(GHIDRA_CAST<std::string *>((GHIDRA_CAST<char *>(modPath))))->std::string::append(pbVar6,GHIDRA_INT(pbVar11) - GHIDRA_INT((pbVar6 + 1)));
pMVar8 = GHIDRA_CAST<ModEntry *>(modPath);
if (0xf < modPathCapacity) {
pMVar8 = modPath[0];
}
pMStack_100fc = GHIDRA_CAST<ModEntry *>((modPathSize->_buf + GHIDRA_INT(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pMVar8)) + 0x0))))));
pMVar10 = GHIDRA_CAST<ModEntry *>(modPath);
if (0xf < modPathCapacity) {
pMVar10 = modPath[0];
}
if (pMVar10 != pMStack_100fc) {
ptrDelta = GHIDRA_INT(pMVar8) - GHIDRA_INT(pMVar10);
do {
bVar3 = (*tolowerFn)(GHIDRA_INT((char)*GHIDRA_CAST<byte *>(pMVar10)));
*GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(pMVar10) + ptrDelta)) = bVar3;
pMVar10 = GHIDRA_CAST<ModEntry *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pMVar10)) + 0x1))));
} while (pMVar10 != pMStack_100fc);
}
pMVar8 = GHIDRA_CAST<ModEntry *>(modPath);
if (0xf < modPathCapacity) {
pMVar8 = modPath[0];
}
pbVar6 = path_join(GHIDRA_CAST<byte *>("/metadata.xml"),GHIDRA_CAST<byte *>(pMVar8),0,0);
piVar7 = (GHIDRA_CAST<FileSystem *>((&PTR_vftable_00c37a10)))->FileSystem::Open(pbVar6,GHIDRA_CAST<int *>(0x0));
if (pbVar6 != GHIDRA_CAST<byte *>(0x0)) {
operator_delete(pbVar6,1);
}
pMVar8 = operator_new(0xf04);
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 1;
if (pMVar8 == GHIDRA_CAST<ModEntry *>(0x0)) {
modEntry = GHIDRA_CAST<ModEntry *>(0x0);
}
else {
(GHIDRA_CAST<ModEntry *>((pMVar8)))->ModEntry::ModEntry();
modEntry = extraout_EAX;
}
ehState = (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(ehState))) + 0x1))) << 8;
pMStack_100fc = modEntry;
if (piVar7 != GHIDRA_CAST<int *>(0x0)) {
fileSize = GHIDRA_CAST<ModEntry **>((**(code **)(*piVar7 + 4))());
pMStack_100e0 = operator_new_tracked(GHIDRA_INT(fileSize) + 1);
pbVar6 = GHIDRA_CAST<byte *>(0x1);
ppMVar18 = fileSize;
(**(code **)(*piVar7 + 0x14))(pMStack_100e0);
(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pMStack_100e0)) + 0x0))))[GHIDRA_INT(fileSize)] = 0;
(**(code **)*piVar7)(1);
xmlPool = xmlPoolBuffer;
xmlDoc = 0;
puStack_1009c = xmlPoolBuffer;
uStack_100cc = 0;
uStack_100c0 = 0;
uStack_100bc = 0;
puStack_10098 = &uStack_94;
uStack_94 = 0;
uStack_90 = 0;
ehState = CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(ehState)) + 0x1))),2);
docFirstNode = GHIDRA_CAST<undefined4 *>(0x0);
uStack_100b0 = 0;
pMStack_100d8 = pMStack_100e0;
if (((*GHIDRA_CAST<byte *>(pMStack_100e0) == 0xef) && ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pMStack_100e0)) + 0x1))) == -0x45)) &&
((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pMStack_100e0)) + 0x2))) == -0x41)) {
pMStack_100d8 = GHIDRA_CAST<ModEntry *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pMStack_100e0)) + 0x3))));
}
while( true ) {
bVar3 = (byte)ppMVar18;
cVar4 = (&DAT_00b1b060)[*GHIDRA_CAST<byte *>(pMStack_100d8)];
while (cVar4 != '\0') {
puVar14 = &(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pMStack_100d8)) + 0x1)));
pMStack_100d8 = GHIDRA_CAST<ModEntry *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pMStack_100d8)) + 0x1))));
cVar4 = (&DAT_00b1b060)[(byte)*puVar14];
}
if (*GHIDRA_CAST<byte *>(pMStack_100d8) == 0) goto LAB_008f6571;
if (*GHIDRA_CAST<byte *>(pMStack_100d8) != 0x3c) break;
pMStack_100d8 = GHIDRA_CAST<ModEntry *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pMStack_100d8)) + 0x1))));
ppMVar18 = &pMStack_100d8;
pbVar6 = GHIDRA_CAST<byte *>(0x8f650e);
node = GHIDRA_CAST<undefined4 *>(rapidxml)::xml_document::parse_node(ppMVar18);
if (node == GHIDRA_CAST<undefined4 *>(0x0)) {
}
else {
if (docFirstNode == GHIDRA_CAST<undefined4 *>(0x0)) {
node[10] = 0;
docFirstNode = node;
}
else {
node[10] = docLastNode;
docLastNode[0xb] = node;
}
node[4] = &xmlDoc;
node[0xb] = 0;
docLastNode = node;
}
}
g_xmlParseError = GHIDRA_CAST<byte *>(s_expected_)<_00b1b66c;
LAB_008f6571:
pcVar15 = "metadata";
do {
pcVar17 = pcVar15;
pcVar15 = pcVar17 + 1;
} while (*pcVar15 != '\0');
pMStack_100d8 = GHIDRA_CAST<ModEntry *>((pcVar17 + -0xb76e9f));
node = docFirstNode;
if (docFirstNode != GHIDRA_CAST<undefined4 *>(0x0)) {
LAB_008f6596:
pbVar11 = GHIDRA_CAST<byte *>(*node);
if (pbVar11 == GHIDRA_CAST<byte *>(0x0)) {
pMVar8 = GHIDRA_CAST<ModEntry *>(0x0);
pbVar11 = &g_xmlNullStr;
}
else {
pMVar8 = GHIDRA_CAST<ModEntry *>(node[2]);
}
if (pMVar8 != pMStack_100d8) goto LAB_008f67da;
cmpEnd = pbVar11 + GHIDRA_INT(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pMVar8)) + 0x0))));
if (pbVar11 < cmpEnd) {
ptrDelta = GHIDRA_INT("metadata") - GHIDRA_INT(pbVar11);
while (*pbVar11 == pbVar11[ptrDelta]) {
pbVar11 = pbVar11 + 1;
if (cmpEnd <= pbVar11) goto LAB_008f65d0;
}
goto LAB_008f67da;
}
LAB_008f65d0:
pvVar9 = (GHIDRA_CAST<xml_node *>((node)))->xml_node::first_node(s_name,GHIDRA_INT(pbVar6),bVar3);
if (pvVar9 != (void *)0x0) {
pbVar6 = &g_xmlNullStr;
if (*GHIDRA_CAST<byte **>((GHIDRA_CAST<char *>(pvVar9) + 4)) != GHIDRA_CAST<byte *>(0x0)) {
pbVar6 = *GHIDRA_CAST<byte **>((GHIDRA_CAST<char *>(pvVar9) + 4));
}
pMStack_100d8 = GHIDRA_CAST<ModEntry *>((pbVar6 + 1));
pbVar11 = pbVar6;
do {
bVar3 = *pbVar11;
pbVar11 = pbVar11 + 1;
} while (bVar3 != 0);
uVar16 = GHIDRA_INT(pbVar11) - GHIDRA_INT(pMStack_100d8);
(GHIDRA_CAST<std::string *>((&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((modEntry)) + 0x18))))))->std::string::assign(pbVar6,uVar16);
bVar3 = (byte)uVar16;
}
pvVar9 = (GHIDRA_CAST<xml_node *>((node)))->xml_node::first_node(GHIDRA_CAST<byte *>("directory"),GHIDRA_INT(pbVar6),bVar3);
if (pvVar9 != (void *)0x0) {
pbVar6 = &g_xmlNullStr;
if (*GHIDRA_CAST<byte **>((GHIDRA_CAST<char *>(pvVar9) + 4)) != GHIDRA_CAST<byte *>(0x0)) {
pbVar6 = *GHIDRA_CAST<byte **>((GHIDRA_CAST<char *>(pvVar9) + 4));
}
pbVar11 = pbVar6;
do {
bVar3 = *pbVar11;
pbVar11 = pbVar11 + 1;
} while (bVar3 != 0);
uVar16 = GHIDRA_INT(pbVar11) - GHIDRA_INT((pbVar6 + 1));
(GHIDRA_CAST<std::string *>((GHIDRA_CAST<char *>(modEntry))))->std::string::assign(pbVar6,uVar16);
bVar3 = (byte)uVar16;
}
pvVar9 = (GHIDRA_CAST<xml_node *>((node)))->xml_node::first_node(GHIDRA_CAST<byte *>("description"),GHIDRA_INT(pbVar6),bVar3);
if (pvVar9 != (void *)0x0) {
pbVar6 = &g_xmlNullStr;
if (*GHIDRA_CAST<byte **>((GHIDRA_CAST<char *>(pvVar9) + 4)) != GHIDRA_CAST<byte *>(0x0)) {
pbVar6 = *GHIDRA_CAST<byte **>((GHIDRA_CAST<char *>(pvVar9) + 4));
}
pMStack_100d8 = GHIDRA_CAST<ModEntry *>((pbVar6 + 1));
pbVar11 = pbVar6;
do {
bVar3 = *pbVar11;
pbVar11 = pbVar11 + 1;
} while (bVar3 != 0);
uVar16 = GHIDRA_INT(pbVar11) - GHIDRA_INT(pMStack_100d8);
(GHIDRA_CAST<std::string *>((&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((modEntry)) + 0xa8))))))->std::string::assign(pbVar6,uVar16);
bVar3 = (byte)uVar16;
}
pvVar9 = (GHIDRA_CAST<xml_node *>((node)))->xml_node::first_node(GHIDRA_CAST<byte *>("version"),GHIDRA_INT(pbVar6),bVar3);
if (pvVar9 != (void *)0x0) {
pbVar6 = &g_xmlNullStr;
if (*GHIDRA_CAST<byte **>((GHIDRA_CAST<char *>(pvVar9) + 4)) != GHIDRA_CAST<byte *>(0x0)) {
pbVar6 = *GHIDRA_CAST<byte **>((GHIDRA_CAST<char *>(pvVar9) + 4));
}
pMStack_100d8 = GHIDRA_CAST<ModEntry *>((pbVar6 + 1));
pbVar11 = pbVar6;
do {
bVar3 = *pbVar11;
pbVar11 = pbVar11 + 1;
} while (bVar3 != 0);
uVar16 = GHIDRA_INT(pbVar11) - GHIDRA_INT(pMStack_100d8);
(GHIDRA_CAST<std::string *>((&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((modEntry)) + 0x78))))))->std::string::assign(pbVar6,uVar16);
bVar3 = (byte)uVar16;
}
pvVar9 = (GHIDRA_CAST<xml_node *>((node)))->xml_node::first_node(s_id,GHIDRA_INT(pbVar6),bVar3);
if (pvVar9 != (void *)0x0) {
pbVar6 = &g_xmlNullStr;
if (*GHIDRA_CAST<byte **>((GHIDRA_CAST<char *>(pvVar9) + 4)) != GHIDRA_CAST<byte *>(0x0)) {
pbVar6 = *GHIDRA_CAST<byte **>((GHIDRA_CAST<char *>(pvVar9) + 4));
}
pMStack_100d8 = GHIDRA_CAST<ModEntry *>((pbVar6 + 1));
pbVar11 = pbVar6;
do {
bVar3 = *pbVar11;
pbVar11 = pbVar11 + 1;
} while (bVar3 != 0);
uVar16 = GHIDRA_INT(pbVar11) - GHIDRA_INT(pMStack_100d8);
(GHIDRA_CAST<std::string *>((&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((modEntry)) + 0x90))))))->std::string::assign(pbVar6,uVar16);
bVar3 = (byte)uVar16;
}
pvVar9 = (GHIDRA_CAST<xml_node *>((node)))->xml_node::first_node(GHIDRA_CAST<byte *>("visibility"),GHIDRA_INT(pbVar6),bVar3);
if (pvVar9 != (void *)0x0) {
pbVar6 = &g_xmlNullStr;
if (*GHIDRA_CAST<byte **>((GHIDRA_CAST<char *>(pvVar9) + 4)) != GHIDRA_CAST<byte *>(0x0)) {
pbVar6 = *GHIDRA_CAST<byte **>((GHIDRA_CAST<char *>(pvVar9) + 4));
}
pMStack_100d8 = GHIDRA_CAST<ModEntry *>((pbVar6 + 1));
pbVar11 = pbVar6;
do {
bVar3 = *pbVar11;
pbVar11 = pbVar11 + 1;
} while (bVar3 != 0);
uVar16 = GHIDRA_INT(pbVar11) - GHIDRA_INT(pMStack_100d8);
(GHIDRA_CAST<std::string *>((&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((modEntry)) + 0xc0))))))->std::string::assign(pbVar6,uVar16);
bVar3 = (byte)uVar16;
}
pMStack_100d8 = (GHIDRA_CAST<xml_node *>((node)))->xml_node::first_node(&DAT_00b6e3b4,GHIDRA_INT(pbVar6),bVar3);
if (pMStack_100d8 != GHIDRA_CAST<ModEntry *>(0x0)) {
LAB_008f67a0:
pMVar8 = modEntry;
pbVar6 = s_id;
do {
pbStack_100e4 = pbVar6;
pbVar6 = pbStack_100e4 + 1;
} while (*pbVar6 != 0);
pbStack_100e4 = pbStack_100e4 + -0xb1bfef;
for (node = *GHIDRA_CAST<undefined4 **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pMStack_100d8)) + 0x20)))); node != GHIDRA_CAST<undefined4 *>(0x0);
node = GHIDRA_CAST<undefined4 *>(node[6])) {
pbVar6 = GHIDRA_CAST<byte *>(*node);
if (pbVar6 == GHIDRA_CAST<byte *>(0x0)) {
pbVar11 = GHIDRA_CAST<byte *>(0x0);
pbVar6 = &g_xmlNullStr;
}
else {
pbVar11 = GHIDRA_CAST<byte *>(node[2]);
}
if (pbVar11 == pbStack_100e4) {
pbVar11 = pbVar11 + GHIDRA_INT(pbVar6);
if (pbVar11 <= pbVar6) goto LAB_008f6921;
ptrDelta = GHIDRA_INT(s_id) - GHIDRA_INT(pbVar6);
while (*pbVar6 == pbVar6[ptrDelta]) {
pbVar6 = pbVar6 + 1;
if (pbVar11 <= pbVar6) goto LAB_008f6921;
}
}
}
node = GHIDRA_CAST<undefined4 *>(0x0);
LAB_008f6921:
if (node != GHIDRA_CAST<undefined4 *>(0x0)) {
pbVar6 = &g_xmlNullStr;
if (GHIDRA_CAST<byte *>(node[1]) != GHIDRA_CAST<byte *>(0x0)) {
pbVar6 = GHIDRA_CAST<byte *>(node[1]);
}
tmpStringSize = 0;
tmpStringCapacity = 0xf;
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpString)) + 0x0))) = GHIDRA_CAST<byte *>(0x0);
pbVar11 = pbVar6;
do {
bVar3 = *pbVar11;
pbVar11 = pbVar11 + 1;
} while (bVar3 != 0);
(GHIDRA_CAST<std::string *>((tmpString)))->std::string::assign(pbVar6,GHIDRA_INT(pbVar11) - GHIDRA_INT((pbVar6 + 1)));
uVar2 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpString)) + 0x0)));
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 3;
psVar12 = *GHIDRA_CAST<std_string **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pMVar8)) + 0xdc))));
if (psVar12 == *GHIDRA_CAST<std_string **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pMVar8)) + 0xe0))))) {
vector_string_emplace_reallocate_move
(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pMVar8)) + 0xd8))),psVar12,GHIDRA_CAST<std_string *>(tmpString));
uVar16 = tmpStringCapacity;
}
else {
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpString)) + 0x0))) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpString)) + 0x0))) & 0xffffff00;
*GHIDRA_CAST<undefined4 *>(psVar12->_buf) = uVar2;
*GHIDRA_CAST<undefined4 *>((psVar12->_buf + 4)) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpString)) + 0x4)));
*GHIDRA_CAST<undefined4 *>((psVar12->_buf + 8)) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpString)) + 0x8)));
*GHIDRA_CAST<int *>((psVar12->_buf + 0xc)) = iStack_34;
psVar12->_size = tmpStringSize;
psVar12->_capacity = tmpStringCapacity;
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pMVar8)) + 0xdc)))) = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pMVar8)) + 0xdc)))) + 0x18;
uVar16 = 0xf;
}
ehState = CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(ehState)) + 0x1))),2);
if (0xf < uVar16) {
size = uVar16 + 1;
pbVar6 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<byte *>(tmpString))) + 0x0)));
if (0xfff < size) {
pbVar6 = *GHIDRA_CAST<byte **>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpString)) + 0x0))) + -4));
size = uVar16 + 0x24;
if (GHIDRA_CAST<byte *>(0x1f) < GHIDRA_CAST<byte *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpString)) + 0x0))) + (-4 - GHIDRA_INT(pbVar6)))))
goto LAB_008f70a8;
}
operator_delete(pbVar6,size);
}
}
pcVar15 = "freeFn";
do {
pcVar17 = pcVar15;
pcVar15 = pcVar17 + 1;
} while (*pcVar15 != '\0');
pMStack_100d8 = *GHIDRA_CAST<ModEntry **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pMStack_100d8)) + 0x2c))));
if (pMStack_100d8 != GHIDRA_CAST<ModEntry *>(0x0)) {
do {
pbVar6 = *GHIDRA_CAST<byte **>(pMStack_100d8);
if (pbVar6 == GHIDRA_CAST<byte *>(0x0)) {
pcVar15 = GHIDRA_CAST<char *>(0x0);
pbVar6 = &g_xmlNullStr;
}
else {
pcVar15 = *GHIDRA_CAST<char **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pMStack_100d8)) + 0x8))));
}
if (pcVar15 == pcVar17 + -0xb6e3b3) {
pbVar11 = pbVar6 + GHIDRA_INT(pcVar15);
if (pbVar11 <= pbVar6) goto LAB_008f67a0;
ptrDelta = GHIDRA_INT(&DAT_00b6e3b4) - GHIDRA_INT(pbVar6);
while (*pbVar6 == pbVar6[ptrDelta]) {
pbVar6 = pbVar6 + 1;
if (pbVar11 <= pbVar6) goto LAB_008f67a0;
}
}
pMStack_100d8 = *GHIDRA_CAST<ModEntry **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pMStack_100d8)) + 0x2c))));
if (pMStack_100d8 == GHIDRA_CAST<ModEntry *>(0x0)) break;
} while( true );
}
}
}
LAB_008f67e5:
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 4;
tracked_alloc(1,pMStack_100e0,0);
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 5;
(GHIDRA_CAST<xml_memory_pool *>((&xmlPool)))->xml_memory_pool::clear();
ehState = (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(ehState))) + 0x1))) << 8;
}
cStack_100d1 = '\0';
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((modEntry)) + 0x28)))) == 0) {
pbVar6 = *GHIDRA_CAST<byte **>((GHIDRA_CAST<char *>(dirEntries) + dirIndex * 8 + 4));
pbVar11 = pbVar6;
do {
bVar3 = *pbVar11;
pbVar11 = pbVar11 + 1;
} while (bVar3 != 0);
(GHIDRA_CAST<std::string *>((&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((modEntry)) + 0x18))))))->std::string::assign(pbVar6,GHIDRA_INT(pbVar11) - GHIDRA_INT((pbVar6 + 1)));
cStack_100d1 = '\x01';
}
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((modEntry)) + 0x10)))) == 0) {
pbVar6 = *GHIDRA_CAST<byte **>((GHIDRA_CAST<char *>(dirEntries) + dirIndex * 8 + 4));
pbVar11 = pbVar6;
do {
bVar3 = *pbVar11;
pbVar11 = pbVar11 + 1;
} while (bVar3 != 0);
(GHIDRA_CAST<std::string *>((GHIDRA_CAST<char *>(modEntry))))->std::string::assign(pbVar6,GHIDRA_INT(pbVar11) - GHIDRA_INT((pbVar6 + 1)));
cStack_100d1 = '\x01';
}
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((modEntry)) + 0x88)))) == 0) {
(GHIDRA_CAST<std::string *>((&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((modEntry)) + 0x78))))))->std::string::assign(&DAT_00b76e84,3);
cStack_100d1 = '\x01';
}
if (*GHIDRA_CAST<uint *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((modEntry)) + 0x14)))) < 0x10) {
pMStack_100e0 = GHIDRA_CAST<ModEntry *>((&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((modEntry)) + 0x0))) + *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((modEntry)) + 0x10))))));
pMVar8 = modEntry;
pMVar10 = modEntry;
if (0xf < *GHIDRA_CAST<uint *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((modEntry)) + 0x14))))) goto LAB_008f6a7e;
}
else {
pMStack_100e0 =
GHIDRA_CAST<ModEntry *>((&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(((*GHIDRA_CAST<ModEntry **>(modEntry)))) + 0x0))) + *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((modEntry)) + 0x10))))));
pMVar10 = *GHIDRA_CAST<ModEntry **>(modEntry);
LAB_008f6a7e:
pMVar8 = *GHIDRA_CAST<ModEntry **>(modEntry);
}
if (pMVar8 != pMStack_100e0) {
ptrDelta = GHIDRA_INT(pMVar10) - GHIDRA_INT(pMVar8);
do {
bVar3 = (*tolowerFn)(GHIDRA_INT((char)*GHIDRA_CAST<byte *>(pMVar8)));
*GHIDRA_CAST<byte *>((ptrDelta + GHIDRA_INT(pMVar8))) = bVar3;
pMVar8 = GHIDRA_CAST<ModEntry *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pMVar8)) + 0x1))));
} while (pMVar8 != pMStack_100e0);
}
if (cStack_100d1 != '\0') {
(GHIDRA_CAST<ModEntry *>((modEntry)))->ModEntry::parse_metadata_xml();
}
pMVar8 = modEntry;
pcVar15 = &DAT_00c73228;
do {
pcVar17 = pcVar15;
pcVar15 = pcVar17 + 1;
} while (*pcVar17 != '\0');
psVar12 = GHIDRA_CAST<std_string *>((pcVar17 + -0xc73228));
if (GHIDRA_CAST<std_string *>((0x7fffffff - *GHIDRA_CAST<uint *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((modEntry)) + 0x10)))))) < psVar12)
goto LAB_008f70e6;
pMVar10 = modEntry;
if (0xf < *GHIDRA_CAST<uint *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((modEntry)) + 0x14))))) {
pMVar10 = *GHIDRA_CAST<ModEntry **>(modEntry);
}
(GHIDRA_CAST<std::string *>((GHIDRA_CAST<char *>(modSaveDirTmp))))->std::string::concat(GHIDRA_INT(pbStack_100e4),psVar12,&DAT_00c73228,
GHIDRA_UINT(psVar12),GHIDRA_CAST<byte *>(pMVar10),*GHIDRA_CAST<uint *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((modEntry)) + 0x10)))));
cleanupFlags = cleanupFlags | 1;
ehState = CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(ehState)) + 0x1))),6);
piVar7 = (GHIDRA_CAST<std::string *>((GHIDRA_CAST<char *>(modSaveDirTmp))))->std::string::append(GHIDRA_CAST<byte *>(&DAT_00b6db28),1);
puVar14 = &(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pMVar8)) + 0x60)));
pvStack_70 = (void *)*piVar7;
iStack_6c = piVar7[1];
uStack_68 = piVar7[2];
uStack_64 = piVar7[3];
saveDirSize = piVar7[4];
pbStack_100e4 = GHIDRA_CAST<byte *>(piVar7[5]);
piVar7[4] = 0;
piVar7[5] = 0xf;
*GHIDRA_CAST<undefined1 *>(piVar7) = 0;
saveDirTmpSize = saveDirSize;
saveDirTmpCapacity = pbStack_100e4;
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpString)) + 0x8))) = pvStack_70;
iStack_34 = iStack_6c;
tmpStringSize = uStack_68;
tmpStringCapacity = uStack_64;
if ((void **)puVar14 == &pvStack_70) {
if (&DAT_0000000f < pbStack_100e4) {
pbVar6 = pbStack_100e4 + 1;
pvVar9 = pvStack_70;
if (GHIDRA_CAST<byte *>(0xfff) < pbVar6) {
pvVar9 = *(void **)(GHIDRA_CAST<char *>(pvStack_70) + -4);
pbVar6 = pbStack_100e4 + 0x24;
if (0x1f < GHIDRA_UINT((GHIDRA_INT(pvStack_70) + (-4 - GHIDRA_INT(pvVar9))))) goto LAB_008f70a8;
}
operator_delete(pvVar9,GHIDRA_UINT(pbVar6));
}
}
else {
(GHIDRA_CAST<std::string *>((puVar14)))->std::string::_Tidy_deallocate();
*GHIDRA_CAST<undefined4 *>(puVar14) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpString)) + 0x8)));
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pMVar8)) + 0x64)))) = iStack_34;
*GHIDRA_CAST<uint *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pMVar8)) + 0x68)))) = tmpStringSize;
*GHIDRA_CAST<uint *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pMVar8)) + 0x6c)))) = tmpStringCapacity;
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pMVar8)) + 0x70)))) = saveDirSize;
*GHIDRA_CAST<byte **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pMVar8)) + 0x74)))) = pbStack_100e4;
}
ehState = ehState & 0xffffff00;
if (0xf < modSaveDirTmpCapacity) {
uVar16 = modSaveDirTmpCapacity + 1;
pvVar9 = modSaveDirTmp[0];
if (0xfff < uVar16) {
pvVar9 = *(void **)(GHIDRA_INT(modSaveDirTmp[0]) + -4);
uVar16 = modSaveDirTmpCapacity + 0x24;
if (0x1f < GHIDRA_UINT((GHIDRA_INT(modSaveDirTmp[0]) + (-4 - GHIDRA_INT(pvVar9))))) goto LAB_008f70a8;
}
operator_delete(pvVar9,uVar16);
}
pbStack_100e4 = *GHIDRA_CAST<byte **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pMVar8)) + 0x74))));
if (pbStack_100e4 < GHIDRA_CAST<byte *>(0x10)) {
pcVar17 = puVar14 + *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pMVar8)) + 0x70))));
puVar13 = puVar14;
pcVar15 = puVar14;
if (&DAT_0000000f < pbStack_100e4) goto LAB_008f6c13;
}
else {
pcVar17 = GHIDRA_CAST<char *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pMVar8)) + 0x70)))) + *GHIDRA_CAST<int *>(puVar14)));
puVar13 = *GHIDRA_CAST<undefined1 **>(puVar14);
LAB_008f6c13:
pcVar15 = *GHIDRA_CAST<char **>(puVar14);
puVar14 = puVar13;
}
if (pcVar15 != pcVar17) {
pbStack_100e4 = puVar14 + -GHIDRA_INT(pcVar15);
do {
cVar4 = (*tolowerFn)(GHIDRA_INT(*pcVar15));
pcVar15[GHIDRA_INT(pbStack_100e4)] = cVar4;
pcVar15 = pcVar15 + 1;
} while (pcVar15 != pcVar17);
}
pbVar6 = *GHIDRA_CAST<byte **>((GHIDRA_CAST<char *>(dirEntries) + dirIndex * 8 + 4));
pbVar11 = pbVar6;
do {
bVar3 = *pbVar11;
pbVar11 = pbVar11 + 1;
} while (bVar3 != 0);
(GHIDRA_CAST<std::string *>((GHIDRA_CAST<char *>(modEntry))))->std::string::assign(pbVar6,GHIDRA_INT(pbVar11) - GHIDRA_INT((pbVar6 + 1)));
if (*GHIDRA_CAST<uint *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((modEntry)) + 0x14)))) < 0x10) {
pMStack_100e0 = GHIDRA_CAST<ModEntry *>((&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((modEntry)) + 0x0))) + *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((modEntry)) + 0x10))))));
pMVar8 = modEntry;
pMVar10 = modEntry;
if (0xf < *GHIDRA_CAST<uint *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((modEntry)) + 0x14))))) goto LAB_008f6c95;
}
else {
pMStack_100e0 =
GHIDRA_CAST<ModEntry *>((&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(((*GHIDRA_CAST<ModEntry **>(modEntry)))) + 0x0))) + *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((modEntry)) + 0x10))))));
pMVar10 = *GHIDRA_CAST<ModEntry **>(modEntry);
LAB_008f6c95:
pMVar8 = *GHIDRA_CAST<ModEntry **>(modEntry);
}
if (pMVar8 != pMStack_100e0) {
ptrDelta = GHIDRA_INT(pMVar10) - GHIDRA_INT(pMVar8);
do {
bVar3 = (*tolowerFn)(GHIDRA_INT((char)*GHIDRA_CAST<byte *>(pMVar8)));
*GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(pMVar8) + ptrDelta)) = bVar3;
pMVar8 = GHIDRA_CAST<ModEntry *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pMVar8)) + 0x1))));
} while (pMVar8 != pMStack_100e0);
}
if (0x7fffffffU - GHIDRA_INT(modPathSize) < 0xb) {
LAB_008f70e6:
/* WARNING: Subroutine does not return */
std::string::_Xlen();
}
pMVar8 = GHIDRA_CAST<ModEntry *>(modPath);
if (0xf < modPathCapacity) {
pMVar8 = modPath[0];
}
(GHIDRA_CAST<std::string *>((tmpString)))->std::string::concat(GHIDRA_INT(pbStack_100e4),modPathSize,GHIDRA_CAST<byte *>(pMVar8),
GHIDRA_UINT(modPathSize),GHIDRA_CAST<byte *>("/resources/"),0xb);
pMVar8 = modEntry;
puVar14 = &(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((modEntry)) + 0x30)));
if (puVar14 == tmpString) {
if (0xf < tmpStringCapacity) {
uVar16 = tmpStringCapacity + 1;
pbVar6 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<byte *>(tmpString))) + 0x0)));
if (0xfff < uVar16) {
pbVar6 = *GHIDRA_CAST<byte **>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpString)) + 0x0))) + -4));
uVar16 = tmpStringCapacity + 0x24;
if (GHIDRA_CAST<byte *>(0x1f) < GHIDRA_CAST<byte *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpString)) + 0x0))) + (-4 - GHIDRA_INT(pbVar6))))) goto LAB_008f70a8;
}
operator_delete(pbVar6,uVar16);
}
}
else {
(GHIDRA_CAST<std::string *>((puVar14)))->std::string::_Tidy_deallocate();
*GHIDRA_CAST<undefined4 *>(puVar14) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpString)) + 0x0)));
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pMVar8)) + 0x34)))) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpString)) + 0x4)));
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pMVar8)) + 0x38)))) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpString)) + 0x8)));
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pMVar8)) + 0x3c)))) = iStack_34;
*GHIDRA_CAST<uint *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pMVar8)) + 0x40)))) = tmpStringSize;
*GHIDRA_CAST<uint *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pMVar8)) + 0x44)))) = tmpStringCapacity;
}
if (0x7fffffffU - GHIDRA_INT(modPathSize) < 9) goto LAB_008f70e6;
pMVar10 = GHIDRA_CAST<ModEntry *>(modPath);
if (0xf < modPathCapacity) {
pMVar10 = modPath[0];
}
(GHIDRA_CAST<std::string *>((tmpString)))->std::string::concat(GHIDRA_INT(pbStack_100e4),modPathSize,GHIDRA_CAST<byte *>(pMVar10),
GHIDRA_UINT(modPathSize),GHIDRA_CAST<byte *>("/content/"),9);
puVar14 = &(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pMVar8)) + 0x48)));
if (puVar14 == tmpString) {
if (0xf < tmpStringCapacity) {
uVar16 = tmpStringCapacity + 1;
pbVar6 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<byte *>(tmpString))) + 0x0)));
if (0xfff < uVar16) {
pbVar6 = *GHIDRA_CAST<byte **>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpString)) + 0x0))) + -4));
uVar16 = tmpStringCapacity + 0x24;
if (GHIDRA_CAST<byte *>(0x1f) < GHIDRA_CAST<byte *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpString)) + 0x0))) + (-4 - GHIDRA_INT(pbVar6))))) goto LAB_008f70a8;
}
operator_delete(pbVar6,uVar16);
}
}
else {
(GHIDRA_CAST<std::string *>((puVar14)))->std::string::_Tidy_deallocate();
*GHIDRA_CAST<undefined4 *>(puVar14) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpString)) + 0x0)));
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pMVar8)) + 0x4c)))) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpString)) + 0x4)));
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pMVar8)) + 0x50)))) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpString)) + 0x8)));
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pMVar8)) + 0x54)))) = iStack_34;
*GHIDRA_CAST<uint *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pMVar8)) + 0x58)))) = tmpStringSize;
*GHIDRA_CAST<uint *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pMVar8)) + 0x5c)))) = tmpStringCapacity;
}
if (0x7fffffffU - GHIDRA_INT(modPathSize) < 0xb) goto LAB_008f70e6;
pMVar10 = GHIDRA_CAST<ModEntry *>(modPath);
if (0xf < modPathCapacity) {
pMVar10 = modPath[0];
}
(GHIDRA_CAST<std::string *>((tmpString)))->std::string::concat(GHIDRA_INT(pbStack_100e4),modPathSize,GHIDRA_CAST<byte *>(pMVar10),
GHIDRA_UINT(modPathSize),GHIDRA_CAST<byte *>("/disable.it"),0xb);
ehState = CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(ehState)) + 0x1))),7);
pbVar6 = tmpString;
if (0xf < tmpStringCapacity) {
pbVar6 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<byte *>(tmpString))) + 0x0)));
}
pbVar6 = FileSystem::ResolvePath(pbVar6);
cStack_100d1 = pbVar6 != GHIDRA_CAST<byte *>(0x0);
if (pbVar6 != GHIDRA_CAST<byte *>(0x0)) {
if (g_mainHeap == (void *)0x0) {
allocatedBytes = &g_allocatedBytesNoHeap;
}
else {
allocatedBytes = GHIDRA_CAST<qword *>((GHIDRA_INT(g_mainHeap) + 0x30));
}
uVar16 = *GHIDRA_CAST<uint *>((pbVar6 + -4));
prevAllocated = *allocatedBytes;
*GHIDRA_CAST<uint *>(allocatedBytes) = GHIDRA_UINT(*allocatedBytes) - uVar16;
*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(allocatedBytes) + 4)) =
*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(allocatedBytes) + 4)) - GHIDRA_UINT((GHIDRA_UINT(prevAllocated) < uVar16));
free(pbVar6 + -4);
}
ehState = ehState & 0xffffff00;
if (0xf < tmpStringCapacity) {
uVar16 = tmpStringCapacity + 1;
pbVar6 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<byte *>(tmpString))) + 0x0)));
if (0xfff < uVar16) {
pbVar6 = *GHIDRA_CAST<byte **>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpString)) + 0x0))) + -4));
uVar16 = tmpStringCapacity + 0x24;
if (GHIDRA_CAST<byte *>(0x1f) < GHIDRA_CAST<byte *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpString)) + 0x0))) + (-4 - GHIDRA_INT(pbVar6))))) goto LAB_008f70a8;
}
operator_delete(pbVar6,uVar16);
}
tmpStringSize = 0;
tmpStringCapacity = 0xf;
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpString)) + 0x0))) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpString)) + 0x0))) & 0xffffff00;
if (cStack_100d1 == '\0') {
bVar3 = (g_manager->_optionsConfig)._enableMods;
}
else {
bVar3 = 0;
}
pMVar8->_loaded = bVar3;
pMVar8->_enabled = cStack_100d1 == '\0';
if (0x7fffffffU - GHIDRA_INT(modPathSize) < 10) goto LAB_008f70e6;
pMVar10 = GHIDRA_CAST<ModEntry *>(modPath);
if (0xf < modPathCapacity) {
pMVar10 = modPath[0];
}
(GHIDRA_CAST<std::string *>((tmpString)))->std::string::concat(GHIDRA_INT(freeFn),modPathSize,GHIDRA_CAST<byte *>(pMVar10),GHIDRA_UINT(modPathSize),
GHIDRA_CAST<byte *>("/update.it"),10);
cleanupFlags = cleanupFlags | 0x3e;
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 9;
pbVar6 = tmpString;
if (0xf < tmpStringCapacity) {
pbVar6 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<byte *>(tmpString))) + 0x0)));
}
pbVar6 = FileSystem::ResolvePath(pbVar6);
cStack_100d1 = pbVar6 != GHIDRA_CAST<byte *>(0x0);
if (pbVar6 != GHIDRA_CAST<byte *>(0x0)) {
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 10;
tracked_alloc(1,pbVar6,0);
}
ehState = (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(ehState))) + 0x1))) << 8;
(GHIDRA_CAST<std::string *>((tmpString)))->std::string::_Tidy_deallocate();
if (cStack_100d1 != '\0') {
pMVar8->_enabled = 0;
pMVar8->_loaded = 0;
*GHIDRA_CAST<byte *>((pMVar8 + 1)) = 1;
}
ptrDelta = enabledModCount + 1;
if (pMVar8->_loaded == 0) {
ptrDelta = enabledModCount;
}
MVar1 = this[1];
if (MVar1 == this[2]) {
std::vector<4byte>::_Emplace_reallocate(MVar1,&pMStack_100fc);
}
else {
*GHIDRA_CAST<ModEntry **>(MVar1) = pMVar8;
this[1] = (ModManager)(GHIDRA_INT(this[1]) + 4);
}
KAGE_LogMessage(1,GHIDRA_CAST<byte *>("LOADED MOD %s\n"));
ehState = 0xffffffff;
if (0xf < modPathCapacity) {
uVar16 = modPathCapacity + 1;
pMVar8 = modPath[0];
if (0xfff < uVar16) {
pMVar8 = *GHIDRA_CAST<ModEntry **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(modPath[0][-1])) + 0xfa))));
uVar16 = modPathCapacity + 0x24;
if (GHIDRA_CAST<byte *>(0x1f) < GHIDRA_CAST<byte *>((GHIDRA_INT(modPath[0]) + (-4 - GHIDRA_INT(pMVar8))))) {
LAB_008f70a8:
/* WARNING: Subroutine does not return */
_invalid_parameter_noinfo_noreturn();
}
}
operator_delete(pMVar8,uVar16);
}
pvVar9 = dirEntries;
enabledModCount = ptrDelta;
}
dirIndex = dirIndex + 1;
} while (dirIndex < dirEntryCount);
}
if (dirEntries != (void *)0x0) {
ptr = GHIDRA_CAST<uint *>((GHIDRA_INT(dirEntries) + -4));
ehState = 0xb;
_eh_vector_destructor_iterator_(dirEntries,8,*ptr,FUN_00a5a420);
operator_delete(ptr,*ptr * 8 + 4);
ehState = 0xffffffff;
}
std::_Sort_unchecked(GHIDRA_INT(this[1]) - GHIDRA_INT(*this) >> 2,FUN_008f6190,uVar5);
MVar1 = this[0x8097];
if (MVar1 != (ModManager)0x3) {
if (enabledModCount == 0) {
if ((MVar1 == (ModManager)0x2) || (newModState = (ModManager)0x1, MVar1 == (ModManager)0x4)) {
newModState = (ModManager)0x4;
}
this[0x8097] = newModState;
}
else {
this[0x8097] = (ModManager)0x2;
}
}
ExceptionList = savedExceptionList;
return;
LAB_008f67da:
node = GHIDRA_CAST<undefined4 *>(node[0xb]);
if (node == GHIDRA_CAST<undefined4 *>(0x0)) goto LAB_008f67e5;
goto LAB_008f6596;
}
// 008f73f0
void ModManager::TriggerResize()
{
FUN_008f7dd0();
unload_shaders(this);
LoadShaders(this);
create_shader_render_targets(this);
return;
}
// 008f7c40
void ModManager::create_shader_render_targets()
{
int *piVar1;
undefined4 uVar2;
char cVar3;
uint uVar4;
byte *name;
void *newTarget;
undefined4 *extraout_EAX;
int *shaderNode;
ModManager modSlot;
KColor clearColor;
undefined1 createdTarget [4];
int *createdTargetRefCount;
undefined1 tmpTarget [4];
int *tmpTargetRefCount;
ModManager *modManager;
undefined4 *shaderTarget;
void *local_10;
undefined1 *puStack_c;
undefined4 local_8;
local_8 = 0xffffffff;
puStack_c = &LAB_00b079dd;
local_10 = ExceptionList;
uVar4 = __security_cookie ^ GHIDRA_UINT((tmpTarget + 0x1c));
ExceptionList = &local_10;
modSlot = *this;
modManager = this;
if (modSlot != this[1]) {
do {
if ((*GHIDRA_CAST<char *>((*GHIDRA_CAST<int *>(modSlot) + 0xfd)) != '\0') &&
(piVar1 = *GHIDRA_CAST<int **>((*GHIDRA_CAST<int *>(modSlot) + 0xe4)), shaderNode = GHIDRA_CAST<int *>(*piVar1),
shaderNode != piVar1)) {
do {
name = GHIDRA_CAST<byte *>(shaderNode[2]);
if (*GHIDRA_CAST<int *>((name + 0x68)) == 0) {
clearColor._unk = 0;
clearColor._red = 0.0;
clearColor._green = 0.0;
clearColor._blue = 0.0;
clearColor._alpha = 0.0;
if (0xf < *GHIDRA_CAST<uint *>((name + 0x14))) {
name = *GHIDRA_CAST<byte **>(name);
}
newTarget = KAGE_Graphics::create_render_target
(createdTarget,g_framebufferWidth,DAT_00c79114,name,&clearColor);
local_8 = 0;
shaderTarget = GHIDRA_CAST<undefined4 *>((shaderNode[2] + 0x68));
(GHIDRA_CAST<shared_ptr *>((tmpTarget)))->shared_ptr::assign(newTarget);
uVar2 = extraout_EAX[1];
extraout_EAX[1] = shaderTarget[1];
shaderTarget[1] = uVar2;
uVar2 = *extraout_EAX;
*extraout_EAX = *shaderTarget;
*shaderTarget = uVar2;
local_8 = CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x1))),1);
if (((tmpTargetRefCount != GHIDRA_CAST<int *>(0x0)) &&
(cVar3 = (**(code **)(*tmpTargetRefCount + 0xc))(uVar4), cVar3 != '\0')) &&
(g_renderTargetReleaseFn != (void *)0x0)) {
(*g_renderTargetReleaseFn)(tmpTarget);
}
local_8 = 2;
if (((createdTargetRefCount != GHIDRA_CAST<int *>(0x0)) &&
(cVar3 = (**(code **)(*createdTargetRefCount + 0xc))(), cVar3 != '\0')) &&
(g_renderTargetReleaseFn != (void *)0x0)) {
(*g_renderTargetReleaseFn)(createdTarget);
}
local_8 = 0xffffffff;
piVar1 = *GHIDRA_CAST<int **>((shaderNode[2] + 0x68));
if ((piVar1[0xe] != 1) || (piVar1[0xf] != 1)) {
(**(code **)(*piVar1 + 0x48))(1,1);
piVar1[0xe] = 1;
piVar1[0xf] = 1;
}
}
shaderNode = GHIDRA_CAST<int *>(*shaderNode);
} while (shaderNode != GHIDRA_CAST<int *>(*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(modSlot) + 0xe4))));
}
modSlot = (ModManager)(GHIDRA_INT(modSlot) + 4);
} while (modSlot != modManager[1]);
}
ExceptionList = local_10;
return;
}
// 008f7e20
void ModManager::unload_shaders()
{
char *this_00;
char isLastRef;
uint uVar1;
qword *allocCounter;
int iVar2;
void *mainHeap;
uint uVar3;
int *shaderNode;
ModManager modIter;
void *local_10;
undefined1 *puStack_c;
undefined4 local_8;
uint *allocHeader;
uint blockSize;
undefined4 *listNode;
undefined4 *nextNode;
qword oldBytes;
int *uniformMap;
local_8 = 0xffffffff;
puStack_c = &LAB_00b07a00;
local_10 = ExceptionList;
uVar1 = __security_cookie ^ GHIDRA_INT(register0x00000010) - 4U;
ExceptionList = &local_10;
modIter = *this;
if (modIter != this[1]) {
do {
iVar2 = *GHIDRA_CAST<int *>(modIter);
if (*GHIDRA_CAST<char *>((iVar2 + 0xfd)) != '\0') {
shaderNode = GHIDRA_CAST<int *>(**GHIDRA_CAST<int **>((iVar2 + 0xe4)));
if (shaderNode != *GHIDRA_CAST<int **>((iVar2 + 0xe4))) {
do {
KAGE::SmartPointer<RenderTargetBase>::reset(shaderNode[2] + 0x68);
(**(code **)(*GHIDRA_CAST<int *>((shaderNode[2] + 0x18)) + 4))(uVar1);
iVar2 = shaderNode[2];
uVar3 = 5;
mainHeap = g_mainHeap;
if (5 < *GHIDRA_CAST<int *>((iVar2 + 0x74)) + 5U) {
do {
iVar2 = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((iVar2 + 0x7c)) + uVar3 * 8));
allocCounter = GHIDRA_CAST<qword *>((GHIDRA_INT(mainHeap) + 0x30));
if (mainHeap == (void *)0x0) {
allocCounter = &g_allocatedBytesNoHeap;
}
if (iVar2 != 0) {
allocHeader = GHIDRA_CAST<uint *>((iVar2 + -4));
blockSize = *allocHeader;
oldBytes = *allocCounter;
*GHIDRA_CAST<uint *>(allocCounter) = GHIDRA_UINT(*allocCounter) - blockSize;
*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(allocCounter) + 4)) =
*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(allocCounter) + 4)) - GHIDRA_UINT((GHIDRA_UINT(oldBytes) < blockSize));
free(allocHeader);
mainHeap = g_mainHeap;
}
iVar2 = shaderNode[2];
uVar3 = uVar3 + 1;
} while (uVar3 < *GHIDRA_CAST<int *>((iVar2 + 0x74)) + 5U);
}
iVar2 = *GHIDRA_CAST<int *>((iVar2 + 0x7c));
if (mainHeap == (void *)0x0) {
allocCounter = &g_allocatedBytesNoHeap;
}
else {
allocCounter = GHIDRA_CAST<qword *>((GHIDRA_INT(mainHeap) + 0x30));
}
if (iVar2 != 0) {
uVar3 = *GHIDRA_CAST<uint *>((iVar2 + -4));
oldBytes = *allocCounter;
*GHIDRA_CAST<uint *>(allocCounter) = GHIDRA_UINT(*allocCounter) - uVar3;
*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(allocCounter) + 4)) =
*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(allocCounter) + 4)) - GHIDRA_UINT((GHIDRA_UINT(oldBytes) < uVar3));
free((void *)(iVar2 + -4));
}
local_8 = 0xffffffff;
this_00 = GHIDRA_CAST<char *>(shaderNode[2]);
if (this_00 != GHIDRA_CAST<char *>(0x0)) {
uniformMap = GHIDRA_CAST<int *>((this_00 + 0x70));
FUN_004235c0(uniformMap,*GHIDRA_CAST<undefined4 *>((*uniformMap + 4)));
operator_delete((void *)*uniformMap,0x2c);
local_8 = 2;
if (((*GHIDRA_CAST<int **>((this_00 + 0x6c)) != GHIDRA_CAST<int *>(0x0)) &&
(isLastRef = (**(code **)(**GHIDRA_CAST<int **>((this_00 + 0x6c)) + 0xc))(), isLastRef != '\0')
) && (g_renderTargetReleaseFn != (void *)0x0)) {
(*g_renderTargetReleaseFn)(this_00 + 0x68);
}
local_8 = 0xffffffff;
*GHIDRA_CAST<undefined ***>((this_00 + 0x18)) = KAGE::Graphics::ShaderBase::vftable;
(GHIDRA_CAST<KAGE::Graphics::ShaderBase *>((this_00 + 0x18)))->KAGE::Graphics::ShaderBase::free_uniforms();
FID_conflict__Tidy(this_00 + 0x58);
FUN_00a15310();
(GHIDRA_CAST<std::string *>((this_00)))->std::string::_Tidy_deallocate();
operator_delete(this_00,0x80);
}
iVar2 = *GHIDRA_CAST<int *>(modIter);
shaderNode = GHIDRA_CAST<int *>(*shaderNode);
} while (shaderNode != GHIDRA_CAST<int *>(*GHIDRA_CAST<int *>((iVar2 + 0xe4))));
}
listNode = *GHIDRA_CAST<undefined4 **>((iVar2 + 0xe4));
*GHIDRA_CAST<undefined4 *>(listNode[1]) = 0;
listNode = GHIDRA_CAST<undefined4 *>(*listNode);
while (listNode != GHIDRA_CAST<undefined4 *>(0x0)) {
nextNode = GHIDRA_CAST<undefined4 *>(*listNode);
operator_delete(listNode,0xc);
listNode = nextNode;
}
*GHIDRA_CAST<undefined4 *>(*GHIDRA_CAST<undefined4 *>((iVar2 + 0xe4))) = *GHIDRA_CAST<undefined4 *>((iVar2 + 0xe4));
*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((iVar2 + 0xe4)) + 4)) = *GHIDRA_CAST<int *>((iVar2 + 0xe4));
*GHIDRA_CAST<undefined4 *>((iVar2 + 0xe8)) = 0;
}
modIter = (ModManager)(GHIDRA_INT(modIter) + 4);
} while (modIter != this[1]);
}
ExceptionList = local_10;
return;
}
// 008f8040
void ModManager::LoadModRooms(int stageId, int mode)
{
RoomConfig_Stage *pRVar1;
int *ptr;
char isInserted;
RoomConfig_Stage RVar2;
undefined4 *appendedPath;
byte *ptr_00;
std_string *psVar3;
RoomConfig_Stage RVar4;
RoomConfig_Stage *oldRoom;
RoomConfig_Stage length;
void *pvVar5;
uint uVar6;
ModManager MVar7;
int roomOffset;
RoomConfig_Stage *pRVar8;
int magic;
RoomConfig_Stage *pRStack_b4;
RoomConfig_Stage roomSet;
int roomCount;
ModManager modIt;
int *file;
uint roomIndex;
uint *puStack_9c;
int savedStageId;
char isPathFound;
RoomConfig_Stage *local_90;
uint uStack_8c;
int savedMode;
void *displayName [5];
uint uStack_70;
void *fileName;
char acStack_68 [4];
char acStack_64 [4];
char acStack_60 [4];
uint uStack_5c;
uint uStack_58;
void *baseName [4];
undefined4 uStack_44;
uint uStack_40;
std_string *contentPath [5];
uint uStack_28;
uint local_24;
undefined1 *puStack_20;
void *local_1c;
undefined1 *puStack_18;
void *local_14;
puStack_20 = GHIDRA_CAST<undefined1 *>((baseName + 0x14));
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0xff;
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))) = 0xffffff;
puStack_18 = &LAB_00b07a78;
local_1c = ExceptionList;
local_24 = __security_cookie ^ GHIDRA_UINT((baseName + 0x11));
ExceptionList = &local_1c;
savedStageId = stageId;
savedMode = mode;
if ((g_game != GHIDRA_CAST<Game *>(0x0)) && (modIt = *this, modIt != this[1])) {
do {
MVar7 = modIt;
if (*GHIDRA_CAST<char *>((*GHIDRA_CAST<int *>(modIt) + 0xfd)) != '\0') {
local_90 = GHIDRA_CAST<RoomConfig_Stage *>((g_game->_ventricleRazorPortals + stageId * 0xc4 + 0x598));
RVar4 = (RoomConfig_Stage)(local_90 + mode * 0xb + 0x19);
roomSet = RVar4;
(GHIDRA_CAST<RoomConfigStage *>((local_90)))->RoomConfigStage::GetDisplayName(GHIDRA_CAST<std_string *>(displayName),0x14);
local_14 = (void *)0x0;
KAGE_LogMessage(1,GHIDRA_CAST<byte *>("[ModManager] load stage %d: %s (mode %d)\n"));
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0xff;
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))) = 0xffffff;
if (0xf < uStack_70) {
uVar6 = uStack_70 + 1;
pvVar5 = displayName[0];
if (0xfff < uVar6) {
pvVar5 = *(void **)(GHIDRA_INT(displayName[0]) + -4);
uVar6 = uStack_70 + 0x24;
if (0x1f < GHIDRA_UINT((GHIDRA_INT(displayName[0]) + (-4 - GHIDRA_INT(pvVar5))))) goto LAB_008f868f;
}
operator_delete(pvVar5,uVar6);
}
local_90 = *GHIDRA_CAST<RoomConfig_Stage **>(MVar7);
RVar2 = *GHIDRA_CAST<RoomConfig_Stage *>((GHIDRA_CAST<char *>(RVar4) + 0x10));
uStack_44 = 0;
uStack_40 = 0xf;
baseName[0] = (void *)0x0;
length = (RoomConfig_Stage)(GHIDRA_INT(RVar2) - 3U);
if (GHIDRA_UINT(RVar2) < GHIDRA_INT(RVar2) - 3U) {
length = RVar2;
}
RVar2 = RVar4;
if (0xf < GHIDRA_UINT(*GHIDRA_CAST<RoomConfig_Stage *>((GHIDRA_CAST<char *>(RVar4) + 0x14)))) {
RVar2 = *GHIDRA_CAST<RoomConfig_Stage *>(RVar4);
}
(GHIDRA_CAST<std::string *>((GHIDRA_CAST<char *>(baseName))))->std::string::assign(GHIDRA_CAST<byte *>(RVar2),GHIDRA_UINT(length));
local_14 = (void *)0x1;
appendedPath = (GHIDRA_CAST<std::string *>((GHIDRA_CAST<char *>(baseName))))->std::string::append(&UNK_00b6cb40,3);
fileName = (void *)*appendedPath;
acStack_68 = (char [4])appendedPath[1];
acStack_64 = (char [4])appendedPath[2];
acStack_60 = (char [4])appendedPath[3];
uStack_5c = appendedPath[4];
uStack_58 = appendedPath[5];
appendedPath[4] = 0;
appendedPath[5] = 0xf;
*GHIDRA_CAST<undefined1 *>(appendedPath) = 0;
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 2;
(GHIDRA_CAST<Mod *>((local_90)))->Mod::GetContentPath(GHIDRA_CAST<std_string *>(contentPath),GHIDRA_CAST<std_string *>(&fileName));
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 4;
if (0xf < uStack_58) {
uVar6 = uStack_58 + 1;
pvVar5 = fileName;
if (0xfff < uVar6) {
pvVar5 = *(void **)(GHIDRA_CAST<char *>(fileName) + -4);
uVar6 = uStack_58 + 0x24;
if (0x1f < GHIDRA_UINT((GHIDRA_INT(fileName) + (-4 - GHIDRA_INT(pvVar5))))) goto LAB_008f868f;
}
operator_delete(pvVar5,uVar6);
}
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 5;
if (0xf < uStack_40) {
uVar6 = uStack_40 + 1;
pvVar5 = baseName[0];
if (0xfff < uVar6) {
pvVar5 = *(void **)(GHIDRA_INT(baseName[0]) + -4);
uVar6 = uStack_40 + 0x24;
if (0x1f < GHIDRA_UINT((GHIDRA_INT(baseName[0]) + (-4 - GHIDRA_INT(pvVar5))))) goto LAB_008f868f;
}
operator_delete(pvVar5,uVar6);
}
uStack_44 = 0;
psVar3 = GHIDRA_CAST<std_string *>(contentPath);
if (0xf < uStack_28) {
psVar3 = contentPath[0];
}
uStack_40 = 0xf;
baseName[0] = (void *)(GHIDRA_UINT(baseName[0]) & 0xffffff00);
ptr_00 = FileSystem::ResolvePath(GHIDRA_CAST<byte *>(psVar3));
isPathFound = ptr_00 != GHIDRA_CAST<byte *>(0x0);
if (ptr_00 != GHIDRA_CAST<byte *>(0x0)) {
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 6;
tracked_alloc(1,ptr_00,0);
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 5;
}
if (isPathFound != '\0') {
psVar3 = GHIDRA_CAST<std_string *>(contentPath);
if (0xf < uStack_28) {
psVar3 = contentPath[0];
}
file = (GHIDRA_CAST<FileSystem *>((&PTR_vftable_00c37a10)))->FileSystem::Open(GHIDRA_CAST<byte *>(psVar3),GHIDRA_CAST<int *>(0x0));
if (file == GHIDRA_CAST<int *>(0x0)) {
KAGE_LogMessage(1,GHIDRA_CAST<byte *>("[ModManager] Failed to open room config files %s!\n"));
}
else {
(**(code **)(*file + 0x14))(&magic,1,4);
if (magic != 0x31425453) {
KAGE_LogMessage(1,GHIDRA_CAST<byte *>("[ModManager] bad room config header in %s!\n"));
if (uStack_28 < 0x10) {
ExceptionList = local_1c;
return;
}
uVar6 = uStack_28 + 1;
psVar3 = contentPath[0];
if (uVar6 < 0x1000) {
LAB_008f8695:
operator_delete(psVar3,uVar6);
ExceptionList = local_1c;
return;
}
psVar3 = GHIDRA_CAST<std_string *>(contentPath[0][-1]._capacity);
uVar6 = uStack_28 + 0x24;
if (GHIDRA_CAST<byte *>((GHIDRA_INT(contentPath[0]) + (-4 - GHIDRA_INT(psVar3)))) < GHIDRA_CAST<byte *>(0x20))
goto LAB_008f8695;
goto LAB_008f868f;
}
roomIndex = *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(RVar4) + 0x1c));
(**(code **)(*file + 0x14))(&roomCount,4,1);
if (roomCount == 0) {
uStack_8c = *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(RVar4) + 0x1c));
}
else {
KAGE_LogMessage(1,GHIDRA_CAST<byte *>("reallocate %d rooms.\n"));
pRStack_b4 = GHIDRA_CAST<RoomConfig_Stage *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(RVar4) + 0x1c)) + roomCount));
local_90 = GHIDRA_CAST<RoomConfig_Stage *>(0x0);
uVar6 = -GHIDRA_UINT((GHIDRA_INT((ZEXT48(pRStack_b4) * 0x5c >> 0x20)) != 0)) |
GHIDRA_UINT((ZEXT48(pRStack_b4) * 0x5c));
uStack_8c = GHIDRA_UINT(pRStack_b4);
puStack_9c = operator_new_tracked(-GHIDRA_UINT((0xfffffffb < uVar6)) | uVar6 + 4);
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 7;
if (puStack_9c == GHIDRA_CAST<uint *>(0x0)) {
puStack_9c = GHIDRA_CAST<uint *>(0x0);
}
else {
*puStack_9c = uStack_8c;
puStack_9c = puStack_9c + 1;
_eh_vector_constructor_iterator_
(puStack_9c,0x5c,uStack_8c,GHIDRA_CAST<_func_void_void_ptr *>(&UNK_00828b20),
RoomConfigRoom::dtor);
}
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 5;
oldRoom = *GHIDRA_CAST<RoomConfig_Stage **>((GHIDRA_CAST<char *>(RVar4) + 0x18));
pRStack_b4 = oldRoom + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(RVar4) + 0x1c)) * 0x17;
if (oldRoom != pRStack_b4) {
local_90 = GHIDRA_CAST<RoomConfig_Stage *>((puStack_9c + 2));
pRVar8 = oldRoom + 10;
do {
local_90[-2] = *oldRoom;
local_90[-1] = pRVar8[-9];
*local_90 = pRVar8[-8];
local_90[1] = pRVar8[-7];
local_90[2] = pRVar8[-6];
if (local_90 + 3 != pRVar8 + -5) {
RVar4 = (RoomConfig_Stage)(pRVar8 + -5);
if (0xf < GHIDRA_UINT(*pRVar8)) {
RVar4 = *GHIDRA_CAST<RoomConfig_Stage *>(RVar4);
}
(GHIDRA_CAST<std::string *>((GHIDRA_CAST<char *>((local_90 + 3)))))->std::string::assign(GHIDRA_CAST<byte *>(RVar4),GHIDRA_UINT(pRVar8[-1]));
}
oldRoom = oldRoom + 0x17;
local_90[9] = pRVar8[1];
local_90[10] = pRVar8[2];
local_90[0xb] = pRVar8[3];
local_90[0xc] = pRVar8[4];
local_90[0xd] = pRVar8[5];
local_90[0xe] = pRVar8[6];
*GHIDRA_CAST<undefined2 *>((local_90 + 0xf)) = *GHIDRA_CAST<undefined2 *>((pRVar8 + 7));
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_90[0xf])) + 0x2))) = (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(pRVar8[7])) + 0x2)));
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_90[0xf])) + 0x3))) = (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(pRVar8[7])) + 0x3)));
local_90[0x10] = pRVar8[8];
local_90[0x11] = pRVar8[9];
local_90[0x12] = pRVar8[10];
local_90[0x13] = pRVar8[0xb];
pRVar1 = pRVar8 + 0xc;
pRVar8 = pRVar8 + 0x17;
local_90[0x14] = *pRVar1;
local_90 = local_90 + 0x17;
} while (oldRoom != pRStack_b4);
oldRoom = *GHIDRA_CAST<RoomConfig_Stage **>((GHIDRA_CAST<char *>(roomSet) + 0x18));
MVar7 = modIt;
RVar4 = roomSet;
}
if (oldRoom != GHIDRA_CAST<RoomConfig_Stage *>(0x0)) {
pRVar8 = oldRoom + -1;
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 8;
_eh_vector_destructor_iterator_(oldRoom,0x5c,GHIDRA_UINT(*pRVar8),RoomConfigRoom::dtor);
operator_delete(pRVar8,GHIDRA_INT(*pRVar8) * 0x5c + 4);
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 5;
RVar4 = roomSet;
}
*GHIDRA_CAST<uint **>((GHIDRA_CAST<char *>(RVar4) + 0x18)) = puStack_9c;
*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(RVar4) + 0x1c)) = uStack_8c;
}
if (roomIndex < uStack_8c) {
roomOffset = roomIndex * 0x5c;
do {
RoomConfig::ReadRoom((void *)RVar4,roomIndex,savedStageId,file);
*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(RVar4) + 0x18)) + 4 + roomOffset)) = savedMode;
puStack_9c = RoomSet::GetVariantSet
(GHIDRA_CAST<RoomSet *>(RVar4),
*GHIDRA_CAST<uint *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(RVar4) + 0x18)) + 8 + roomOffset)));
uStack_8c = *GHIDRA_CAST<uint *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(RVar4) + 0x18)) + 0xc + roomOffset));
isInserted = VariantRanges::Insert(uStack_8c);
if (isInserted == '\0') {
uVar6 = *puStack_9c;
ptr = *GHIDRA_CAST<int **>((uVar6 + 8));
if ((ptr == GHIDRA_CAST<int *>(0x0)) || (*ptr + 2 != *GHIDRA_CAST<int *>((uVar6 + 4)))) {
*GHIDRA_CAST<int *>((uVar6 + 4)) = *GHIDRA_CAST<int *>((uVar6 + 4)) + 1;
uStack_8c = *GHIDRA_CAST<uint *>((*puStack_9c + 4));
}
else {
uStack_8c = *ptr + 1;
*GHIDRA_CAST<int *>((uVar6 + 8)) = ptr[2];
*GHIDRA_CAST<int *>((*puStack_9c + 4)) = ptr[1];
operator_delete(ptr,0xc);
}
}
*GHIDRA_CAST<uint *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(RVar4) + 0x18)) + 0xc + roomOffset)) = uStack_8c;
roomOffset = roomOffset + 0x5c;
roomIndex = roomIndex + 1;
} while (roomIndex < *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(RVar4) + 0x1c)));
MVar7 = modIt;
}
(**(code **)*file)(1);
}
}
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0xff;
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))) = 0xffffff;
if (0xf < uStack_28) {
uVar6 = uStack_28 + 1;
psVar3 = contentPath[0];
if (0xfff < uVar6) {
psVar3 = GHIDRA_CAST<std_string *>(contentPath[0][-1]._capacity);
uVar6 = uStack_28 + 0x24;
if (GHIDRA_CAST<byte *>(0x1f) < GHIDRA_CAST<byte *>((GHIDRA_INT(contentPath[0]) + (-4 - GHIDRA_INT(psVar3))))) {
LAB_008f868f:
/* WARNING: Subroutine does not return */
_invalid_parameter_noinfo_noreturn();
}
}
operator_delete(psVar3,uVar6);
}
stageId = savedStageId;
mode = savedMode;
}
modIt = (ModManager)(GHIDRA_INT(MVar7) + 4);
} while (modIt != this[1]);
}
ExceptionList = local_1c;
return;
}
// 008f86c0
void ModManager::LoadModCurses()
{
byte *resolvedPath;
std_string *psVar1;
int *in_ECX;
void *resolvedPath;
uint uVar2;
undefined4 *modIt;
std_string fileName;
std_string *contentPath [5];
uint contentPathCapacity;
uint local_14;
void *local_10;
undefined1 *puStack_c;
std_string *local_8;
puStack_c = &LAB_00b07ac5;
local_10 = ExceptionList;
local_14 = __security_cookie ^ GHIDRA_UINT((contentPath + 10));
ExceptionList = &local_10;
if ((g_game != GHIDRA_CAST<Game *>(0x0)) && (modIt = GHIDRA_CAST<undefined4 *>(*in_ECX), modIt != GHIDRA_CAST<undefined4 *>(in_ECX[1])))
{
do {
if (*GHIDRA_CAST<char *>((GHIDRA_INT(*modIt) + 0xfd)) != '\0') {
fileName._capacity = 0xf;
fileName._size = 10;
builtin_strncpy(fileName._buf,"curses.xml",0xb);
local_8 = GHIDRA_CAST<std_string *>(0x0);
(GHIDRA_CAST<Mod *>(((void *)*modIt)))->Mod::GetContentPath(GHIDRA_CAST<std_string *>(contentPath),&fileName);
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 2;
if (0xf < fileName._capacity) {
uVar2 = fileName._capacity + 1;
resolvedPath = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)fileName._buf)) + 0x0)));
if (0xfff < uVar2) {
resolvedPath = *(void **)((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(fileName._buf)) + 0x0))) + -4);
uVar2 = fileName._capacity + 0x24;
if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(fileName._buf)) + 0x0))) + (-4 - GHIDRA_INT(resolvedPath))))) goto LAB_008f884d;
}
operator_delete(resolvedPath,uVar2);
}
psVar1 = GHIDRA_CAST<std_string *>(contentPath);
if (0xf < contentPathCapacity) {
psVar1 = contentPath[0];
}
resolvedPath = FileSystem::ResolvePath(GHIDRA_CAST<byte *>(psVar1));
if (resolvedPath != GHIDRA_CAST<byte *>(0x0)) {
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 3;
tracked_alloc(1,resolvedPath,0);
local_8 = GHIDRA_CAST<std_string *>(CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x1))),2));
psVar1 = GHIDRA_CAST<std_string *>(contentPath);
if (0xf < contentPathCapacity) {
psVar1 = contentPath[0];
}
(GHIDRA_CAST<RoomConfig *>((&g_game->_roomConfig)))->RoomConfig::LoadCursesXml(GHIDRA_CAST<byte *>(psVar1),1);
}
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 0xff;
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x1))) = 0xffffff;
if (0xf < contentPathCapacity) {
uVar2 = contentPathCapacity + 1;
psVar1 = contentPath[0];
if (0xfff < uVar2) {
psVar1 = GHIDRA_CAST<std_string *>(contentPath[0][-1]._capacity);
uVar2 = contentPathCapacity + 0x24;
if (GHIDRA_CAST<byte *>(0x1f) < GHIDRA_CAST<byte *>((GHIDRA_INT(contentPath[0]) + (-4 - GHIDRA_INT(psVar1))))) {
LAB_008f884d:
/* WARNING: Subroutine does not return */
_invalid_parameter_noinfo_noreturn();
}
}
operator_delete(psVar1,uVar2);
}
}
modIt = modIt + 1;
} while (modIt != GHIDRA_CAST<undefined4 *>(in_ECX[1]));
}
ExceptionList = local_10;
return;
}
// 008f8a60
void ModManager::RenderCustomGameOver(int playerType, Vector *position)
{
byte bVar1;
byte *currentAnimChar;
uint uVar2;
void *unused;
std_string *nameChar;
void *pvVar3;
EntityConfig_Player *playerConfig;
bool isLess;
std_string *displayName;
void *displayNameText [4];
uint displayNameTextSize;
uint displayNameTextCapacity;
uint local_14;
void *local_10;
undefined1 *puStack_c;
void *local_8;
byte *animData;
ANM2 *gameOverAnm;
local_8 = (void *)0xffffffff;
puStack_c = &LAB_00aff10d;
local_10 = ExceptionList;
local_14 = __security_cookie ^ GHIDRA_UINT((displayNameText + 10));
if (playerType < 0) {
return;
}
pvVar3 = (g_manager->_entityConfig)._players._begin;
unused = (void *)(GHIDRA_INT((g_manager->_entityConfig)._players._end) - GHIDRA_INT(pvVar3));
if (GHIDRA_INT(unused) / 0x148 <= playerType) {
return;
}
playerConfig = GHIDRA_CAST<EntityConfig_Player *>((playerType * 0x148 + GHIDRA_INT(pvVar3)));
if (playerConfig == GHIDRA_CAST<EntityConfig_Player *>(0x0)) {
return;
}
gameOverAnm = playerConfig->_moddedGameOverANM2;
if (gameOverAnm == GHIDRA_CAST<ANM2 *>(0x0)) {
return;
}
ExceptionList = &local_10;
displayName = EntityConfig_Player::GetDisplayName
(playerConfig,GHIDRA_CAST<std_string *>(displayNameText),unused);
local_8 = (void *)0x0;
if (0xf < displayName->_capacity) {
displayName = *GHIDRA_CAST<std_string **>(displayName->_buf);
}
animData = (gameOverAnm->_animState)._animData;
if (animData != GHIDRA_CAST<byte *>(0x0)) {
currentAnimChar = animData;
nameChar = displayName;
if (0xf < *GHIDRA_CAST<uint *>((animData + 0x14))) {
currentAnimChar = *GHIDRA_CAST<byte **>(animData);
}
do {
bVar1 = *currentAnimChar;
isLess = bVar1 < (byte)nameChar->_buf[0];
if (bVar1 != nameChar->_buf[0]) {
LAB_008f8b40:
uVar2 = -GHIDRA_UINT(isLess) | 1;
goto LAB_008f8b45;
}
if (bVar1 == 0) break;
bVar1 = currentAnimChar[1];
isLess = bVar1 < (byte)nameChar->_buf[1];
if (bVar1 != nameChar->_buf[1]) goto LAB_008f8b40;
currentAnimChar = currentAnimChar + 2;
nameChar = GHIDRA_CAST<std_string *>((nameChar->_buf + 2));
} while (bVar1 != 0);
uVar2 = 0;
LAB_008f8b45:
if ((uVar2 == 0) && ((animData[0x34] == 0 || ((gameOverAnm->_animState)._isPlaying != 0))))
goto LAB_008f8b70;
}
bVar1 = (GHIDRA_CAST<ANM2 *>((gameOverAnm)))->ANM2::SetAnimation(GHIDRA_CAST<byte *>(displayName),1);
if (bVar1 != 0) {
(GHIDRA_CAST<AnimationState *>((&gameOverAnm->_animState)))->AnimationState::Rewind();
(gameOverAnm->_animState)._isPlaying = 1;
}
LAB_008f8b70:
local_8 = (void *)0xffffffff;
if (0xf < displayNameTextCapacity) {
uVar2 = displayNameTextCapacity + 1;
pvVar3 = displayNameText[0];
if (0xfff < uVar2) {
pvVar3 = *(void **)(GHIDRA_INT(displayNameText[0]) + -4);
uVar2 = displayNameTextCapacity + 0x24;
if (0x1f < GHIDRA_UINT((GHIDRA_INT(displayNameText[0]) + (-4 - GHIDRA_INT(pvVar3))))) {
/* WARNING: Subroutine does not return */
_invalid_parameter_noinfo_noreturn();
}
}
operator_delete(pvVar3,uVar2);
}
displayNameTextSize = 0;
displayNameTextCapacity = 0xf;
displayNameText[0] = (void *)(GHIDRA_UINT(displayNameText[0]) & 0xffffff00);
(GHIDRA_CAST<ANM2 *>((playerConfig->_moddedGameOverANM2)))->ANM2::Render(position,&g_vectorZero,&g_vectorZero);
ExceptionList = local_10;
return;
}
// 008f8c00
void ModManager::Reset()
{
void *this_00;
Game *pGVar1;
uint uVar2;
uint uVar3;
this_00 = g_luaEngine;
KAGE_LogMessage(1,GHIDRA_CAST<byte *>("Lua is resetting!\n"));
(GHIDRA_CAST<LuaEngine *>((this_00)))->LuaEngine::destroy();
(GHIDRA_CAST<LuaEngine *>((this_00)))->LuaEngine::Init(*GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(this_00) + 0x1c)));
if (DAT_00c79860 != 0) {
this[0x8097] = (ModManager)0x3;
}
FUN_008f5960();
ListMods(this);
LoadShaders(this);
Manager::unload_configs();
LoadModContent(this);
if (g_menuManager != GHIDRA_CAST<MenuManager *>(0x0)) {
pause_screen_unload_sprites();
AnmCache::Clear();
FUN_00954710();
(GHIDRA_CAST<Menu_Character *>((&g_menuManager->_menuCharacter)))->Menu_Character::Reset();
Menu_Collection::reset();
}
if (g_game != GHIDRA_CAST<Game *>(0x0)) {
uVar3 = 0;
uVar2 = 0;
pGVar1 = g_game;
do {
if (uVar3 < 0x25) {
RoomConfig_Stage::unload
(GHIDRA_CAST<RoomConfig_Stage *>((pGVar1->_ventricleRazorPortals + uVar2 + 0x598)));
pGVar1 = g_game;
}
uVar2 = uVar2 + 0xc4;
uVar3 = uVar3 + 1;
} while (uVar2 < 0x1c54);
}
return;
}
// 008f8d00
void ModManager::RenderCustomCharacterMenu(int characterId, Vector *renderPos, Sprite *defaultSprite)
{
byte bVar1;
byte *pbVar2;
uint uVar3;
void *unused;
void *extraout_ECX;
std_string *psVar4;
void *pvVar5;
ANM2 *menuSprite;
EntityConfig_Player *playerConfig;
bool isLess;
std_string *displayName;
void *displayNameStr [4];
uint displayNameSize;
uint displayNameCapacity;
uint local_18;
void *local_10;
undefined1 *puStack_c;
void *local_8;
byte *animData;
local_8 = (void *)0xffffffff;
puStack_c = &LAB_00af85cd;
local_10 = ExceptionList;
local_18 = __security_cookie ^ GHIDRA_UINT((displayNameStr + 0xb));
ExceptionList = &local_10;
if (characterId < 0) {
LAB_008f8e9e:
(GHIDRA_CAST<Sprite *>((defaultSprite)))->Sprite::RenderLayer(0,renderPos,&g_vectorZero,&g_vectorZero);
ExceptionList = local_10;
return;
}
pvVar5 = (g_manager->_entityConfig)._players._begin;
unused = (void *)(GHIDRA_INT((g_manager->_entityConfig)._players._end) - GHIDRA_INT(pvVar5));
if (((GHIDRA_INT(unused) / 0x148 <= characterId) ||
(playerConfig = GHIDRA_CAST<EntityConfig_Player *>((characterId * 0x148 + GHIDRA_INT(pvVar5))),
playerConfig == GHIDRA_CAST<EntityConfig_Player *>(0x0))) ||
(menuSprite = playerConfig->_moddedMenuBackgroundANM2, menuSprite == GHIDRA_CAST<ANM2 *>(0x0)))
goto LAB_008f8e9e;
if (playerConfig->_renderCustomBackground == 0) {
(GHIDRA_CAST<Sprite *>((defaultSprite)))->Sprite::RenderLayer(0,renderPos,&g_vectorZero,&g_vectorZero);
menuSprite = playerConfig->_moddedMenuBackgroundANM2;
unused = extraout_ECX;
}
displayName = EntityConfig_Player::GetDisplayName
(playerConfig,GHIDRA_CAST<std_string *>(displayNameStr),unused);
local_8 = (void *)0x0;
if (0xf < displayName->_capacity) {
displayName = *GHIDRA_CAST<std_string **>(displayName->_buf);
}
animData = (menuSprite->_animState)._animData;
if (animData != GHIDRA_CAST<byte *>(0x0)) {
pbVar2 = animData;
psVar4 = displayName;
if (0xf < *GHIDRA_CAST<uint *>((animData + 0x14))) {
pbVar2 = *GHIDRA_CAST<byte **>(animData);
}
do {
bVar1 = *pbVar2;
isLess = bVar1 < (byte)psVar4->_buf[0];
if (bVar1 != psVar4->_buf[0]) {
LAB_008f8e05:
uVar3 = -GHIDRA_UINT(isLess) | 1;
goto LAB_008f8e0a;
}
if (bVar1 == 0) break;
bVar1 = pbVar2[1];
isLess = bVar1 < (byte)psVar4->_buf[1];
if (bVar1 != psVar4->_buf[1]) goto LAB_008f8e05;
pbVar2 = pbVar2 + 2;
psVar4 = GHIDRA_CAST<std_string *>((psVar4->_buf + 2));
} while (bVar1 != 0);
uVar3 = 0;
LAB_008f8e0a:
if ((uVar3 == 0) && ((animData[0x34] == 0 || ((menuSprite->_animState)._isPlaying != 0))))
goto LAB_008f8e35;
}
bVar1 = (GHIDRA_CAST<ANM2 *>((menuSprite)))->ANM2::SetAnimation(GHIDRA_CAST<byte *>(displayName),1);
if (bVar1 != 0) {
(GHIDRA_CAST<AnimationState *>((&menuSprite->_animState)))->AnimationState::Rewind();
(menuSprite->_animState)._isPlaying = 1;
}
LAB_008f8e35:
local_8 = (void *)0xffffffff;
if (0xf < displayNameCapacity) {
uVar3 = displayNameCapacity + 1;
pvVar5 = displayNameStr[0];
if (0xfff < uVar3) {
pvVar5 = *(void **)(GHIDRA_INT(displayNameStr[0]) + -4);
uVar3 = displayNameCapacity + 0x24;
if (0x1f < GHIDRA_UINT((GHIDRA_INT(displayNameStr[0]) + (-4 - GHIDRA_INT(pvVar5))))) {
/* WARNING: Subroutine does not return */
_invalid_parameter_noinfo_noreturn();
}
}
operator_delete(pvVar5,uVar3);
}
displayNameSize = 0;
displayNameCapacity = 0xf;
displayNameStr[0] = (void *)(GHIDRA_UINT(displayNameStr[0]) & 0xffffff00);
(GHIDRA_CAST<ANM2 *>((playerConfig->_moddedMenuBackgroundANM2)))->ANM2::Render(renderPos,&g_vectorZero,&g_vectorZero);
ExceptionList = local_10;
return;
}
// 008f9f40
void ModManager::add_mod_entry(std_string *name, std_string *dir, std_string *path)
{
uint *puVar1;
byte *resolvedPath;
byte ****ppppbVar2;
undefined4 *unfinishedFile;
void *pvVar3;
uint uVar4;
uint isMetadataMissing;
void *entryName [4];
uint entryNameSize;
uint entryNameCapacity;
void *entryDir [4];
uint entryDirSize;
uint entryDirCapacity;
void *entryPath [4];
undefined4 entryPathSize;
uint entryPathCapacity;
undefined1 isDisabled;
byte ****disablePath [4];
undefined4 disablePathSize;
uint disablePathCapacity;
byte ****metadataPath [4];
undefined4 metadataPathSize;
uint metadataPathCapacity;
byte ****unfinishedPath [4];
undefined4 unfinishedPathSize;
uint unfinishedPathCapacity;
byte ****modPath [4];
std_string *modPathSize;
uint modPathCapacity;
uint local_14;
void *local_10;
undefined1 *puStack_c;
byte ***local_8;
local_8 = GHIDRA_CAST<byte ***>(0xffffffff);
puStack_c = &LAB_00b07c40;
local_10 = ExceptionList;
local_14 = __security_cookie ^ GHIDRA_UINT((modPath + 10));
ExceptionList = &local_10;
(GHIDRA_CAST<std::string *>((GHIDRA_CAST<char *>(modPath))))->std::string::string(path);
entryNameSize = 0;
entryNameCapacity = 0xf;
entryName[0] = (void *)0x0;
entryDirSize = 0;
entryDirCapacity = 0xf;
entryDir[0] = (void *)0x0;
entryPathSize = 0;
entryPathCapacity = 0xf;
entryPath[0] = (void *)0x0;
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 1;
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x1))) = 0;
if (GHIDRA_CAST<std_string *>(entryName) != name) {
puVar1 = &name->_size;
if (0xf < name->_capacity) {
name = *GHIDRA_CAST<std_string **>(name->_buf);
}
(GHIDRA_CAST<std::string *>((GHIDRA_CAST<char *>(entryName))))->std::string::assign(GHIDRA_CAST<byte *>(name),*puVar1);
}
if (GHIDRA_CAST<std_string *>(entryDir) != dir) {
puVar1 = &dir->_size;
if (0xf < dir->_capacity) {
dir = *GHIDRA_CAST<std_string **>(dir->_buf);
}
(GHIDRA_CAST<std::string *>((GHIDRA_CAST<char *>(entryDir))))->std::string::assign(GHIDRA_CAST<byte *>(dir),*puVar1);
}
ppppbVar2 = GHIDRA_CAST<byte ****>(modPath);
if (0xf < modPathCapacity) {
ppppbVar2 = modPath[0];
}
(GHIDRA_CAST<std::string *>((GHIDRA_CAST<char *>(entryPath))))->std::string::assign(GHIDRA_CAST<byte *>(ppppbVar2),GHIDRA_UINT(modPathSize));
if (0x7fffffffU - GHIDRA_INT(modPathSize) < 0xb) {
LAB_008fa37c:
/* WARNING: Subroutine does not return */
std::string::_Xlen();
}
ppppbVar2 = GHIDRA_CAST<byte ****>(modPath);
if (0xf < modPathCapacity) {
ppppbVar2 = modPath[0];
}
(GHIDRA_CAST<std::string *>((GHIDRA_CAST<char *>(disablePath))))->std::string::concat(GHIDRA_INT(this),modPathSize,GHIDRA_CAST<byte *>(ppppbVar2),GHIDRA_UINT(modPathSize),
GHIDRA_CAST<byte *>("/disable.it"),0xb);
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 2;
ppppbVar2 = GHIDRA_CAST<byte ****>(disablePath);
if (0xf < disablePathCapacity) {
ppppbVar2 = disablePath[0];
}
resolvedPath = FileSystem::ResolvePath(GHIDRA_CAST<byte *>(ppppbVar2));
isDisabled = resolvedPath != GHIDRA_CAST<byte *>(0x0);
if (resolvedPath != GHIDRA_CAST<byte *>(0x0)) {
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 3;
tracked_alloc(1,resolvedPath,0);
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 2;
}
if (0x7fffffffU - GHIDRA_INT(modPathSize) < 0xd) goto LAB_008fa37c;
ppppbVar2 = GHIDRA_CAST<byte ****>(modPath);
if (0xf < modPathCapacity) {
ppppbVar2 = modPath[0];
}
(GHIDRA_CAST<std::string *>((GHIDRA_CAST<char *>(metadataPath))))->std::string::concat(GHIDRA_INT(this),modPathSize,GHIDRA_CAST<byte *>(ppppbVar2),GHIDRA_UINT(modPathSize)
,GHIDRA_CAST<byte *>("/metadata.xml"),0xd);
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 4;
ppppbVar2 = GHIDRA_CAST<byte ****>(metadataPath);
if (0xf < metadataPathCapacity) {
ppppbVar2 = metadataPath[0];
}
resolvedPath = FileSystem::ResolvePath(GHIDRA_CAST<byte *>(ppppbVar2));
if (resolvedPath != GHIDRA_CAST<byte *>(0x0)) {
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 5;
tracked_alloc(1,resolvedPath,0);
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 4;
}
isMetadataMissing = resolvedPath != GHIDRA_CAST<byte *>(0x0) ^ 1;
if (0x7fffffffU - GHIDRA_INT(modPathSize) < 0xe) goto LAB_008fa37c;
ppppbVar2 = GHIDRA_CAST<byte ****>(modPath);
if (0xf < modPathCapacity) {
ppppbVar2 = modPath[0];
}
(GHIDRA_CAST<std::string *>((GHIDRA_CAST<char *>(unfinishedPath))))->std::string::concat(GHIDRA_INT(this),modPathSize,GHIDRA_CAST<byte *>(ppppbVar2),
GHIDRA_UINT(modPathSize),GHIDRA_CAST<byte *>("/unfinished.it"),0xe);
local_8 = GHIDRA_CAST<byte ***>(CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x1))),6));
ppppbVar2 = GHIDRA_CAST<byte ****>(unfinishedPath);
if (0xf < unfinishedPathCapacity) {
ppppbVar2 = unfinishedPath[0];
}
unfinishedFile = (GHIDRA_CAST<SaveDataManager *>((&PTR_vftable_00c5aa80)))->SaveDataManager::open_file_write(GHIDRA_CAST<byte *>(ppppbVar2),0);
if (unfinishedFile != GHIDRA_CAST<undefined4 *>(0x0)) {
(**(code **)*unfinishedFile)(1);
}
FUN_008fc5b0(&isMetadataMissing);
if (0xf < unfinishedPathCapacity) {
uVar4 = unfinishedPathCapacity + 1;
ppppbVar2 = unfinishedPath[0];
if (0xfff < uVar4) {
ppppbVar2 = GHIDRA_CAST<byte ****>(unfinishedPath[0][-1]);
uVar4 = unfinishedPathCapacity + 0x24;
if (GHIDRA_CAST<byte *>(0x1f) < GHIDRA_CAST<byte *>((GHIDRA_INT(unfinishedPath[0]) + (-4 - GHIDRA_INT(ppppbVar2)))))
goto LAB_008fa34e;
}
operator_delete(ppppbVar2,uVar4);
}
unfinishedPathSize = 0;
unfinishedPathCapacity = 0xf;
unfinishedPath[0] = GHIDRA_CAST<byte ****>((GHIDRA_UINT(unfinishedPath[0]) & 0xffffff00));
if (0xf < metadataPathCapacity) {
uVar4 = metadataPathCapacity + 1;
ppppbVar2 = metadataPath[0];
if (0xfff < uVar4) {
ppppbVar2 = GHIDRA_CAST<byte ****>(metadataPath[0][-1]);
uVar4 = metadataPathCapacity + 0x24;
if (GHIDRA_CAST<byte *>(0x1f) < GHIDRA_CAST<byte *>((GHIDRA_INT(metadataPath[0]) + (-4 - GHIDRA_INT(ppppbVar2))))) goto LAB_008fa34e;
}
operator_delete(ppppbVar2,uVar4);
}
metadataPathSize = 0;
metadataPathCapacity = 0xf;
metadataPath[0] = GHIDRA_CAST<byte ****>((GHIDRA_UINT(metadataPath[0]) & 0xffffff00));
if (0xf < disablePathCapacity) {
uVar4 = disablePathCapacity + 1;
ppppbVar2 = disablePath[0];
if (0xfff < uVar4) {
ppppbVar2 = GHIDRA_CAST<byte ****>(disablePath[0][-1]);
uVar4 = disablePathCapacity + 0x24;
if (GHIDRA_CAST<byte *>(0x1f) < GHIDRA_CAST<byte *>((GHIDRA_INT(disablePath[0]) + (-4 - GHIDRA_INT(ppppbVar2))))) goto LAB_008fa34e;
}
operator_delete(ppppbVar2,uVar4);
}
disablePathSize = 0;
disablePathCapacity = 0xf;
disablePath[0] = GHIDRA_CAST<byte ****>((GHIDRA_UINT(disablePath[0]) & 0xffffff00));
if (0xf < entryPathCapacity) {
uVar4 = entryPathCapacity + 1;
pvVar3 = entryPath[0];
if (0xfff < uVar4) {
pvVar3 = *(void **)(GHIDRA_INT(entryPath[0]) + -4);
uVar4 = entryPathCapacity + 0x24;
if (0x1f < GHIDRA_UINT((GHIDRA_INT(entryPath[0]) + (-4 - GHIDRA_INT(pvVar3))))) goto LAB_008fa34e;
}
operator_delete(pvVar3,uVar4);
}
if (0xf < entryDirCapacity) {
uVar4 = entryDirCapacity + 1;
pvVar3 = entryDir[0];
if (0xfff < uVar4) {
pvVar3 = *(void **)(GHIDRA_INT(entryDir[0]) + -4);
uVar4 = entryDirCapacity + 0x24;
if (0x1f < GHIDRA_UINT((GHIDRA_INT(entryDir[0]) + (-4 - GHIDRA_INT(pvVar3))))) goto LAB_008fa34e;
}
operator_delete(pvVar3,uVar4);
}
if (0xf < entryNameCapacity) {
uVar4 = entryNameCapacity + 1;
pvVar3 = entryName[0];
if (0xfff < uVar4) {
pvVar3 = *(void **)(GHIDRA_INT(entryName[0]) + -4);
uVar4 = entryNameCapacity + 0x24;
if (0x1f < GHIDRA_UINT((GHIDRA_INT(entryName[0]) + (-4 - GHIDRA_INT(pvVar3))))) goto LAB_008fa34e;
}
operator_delete(pvVar3,uVar4);
}
if (0xf < modPathCapacity) {
uVar4 = modPathCapacity + 1;
ppppbVar2 = modPath[0];
if (0xfff < uVar4) {
ppppbVar2 = GHIDRA_CAST<byte ****>(modPath[0][-1]);
uVar4 = modPathCapacity + 0x24;
if (GHIDRA_CAST<byte *>(0x1f) < GHIDRA_CAST<byte *>((GHIDRA_INT(modPath[0]) + (-4 - GHIDRA_INT(ppppbVar2))))) {
LAB_008fa34e:
/* WARNING: Subroutine does not return */
_invalid_parameter_noinfo_noreturn();
}
}
operator_delete(ppppbVar2,uVar4);
}
ExceptionList = local_10;
return;
}
// 008fa390
void ModManager::UpdateWorkshopMods()
{
undefined2 *puVar1;
undefined1 *puVar2;
byte bVar3;
std_string *psVar4;
int iVar5;
byte *pbVar6;
int ****ppppiVar7;
int ****ppppiVar8;
undefined4 *markerFile;
byte ****ppppbVar9;
LPCSTR ***ppppCVar10;
char *statusKey;
int ****ppppiVar11;
LPCSTR ***ppppCVar12;
uint uVar13;
qword *allocCounter;
int ****ppppiVar14;
int entriesBegin;
int ****ppppiVar15;
int *in_stack_00000004;
_SHFILEOPSTRUCTA deleteOp;
_SHFILEOPSTRUCTA fileOp;
int *workshopEntries;
uint entryIdx;
undefined1 *local_2a8;
int ****modDirString;
char isUnfinishedExists;
int ****local_29c;
int ****local_298;
LPCSTR ***local_294;
int ****local_290;
byte ****markerPath [5];
uint markerPathCapacity;
byte ****unfinishedPath [4];
undefined4 unfinishedPathSize;
uint unfinishedPathCapacity;
int ****sourcePath;
int ***pppiStack_258;
int ***pppiStack_254;
int ***pppiStack_250;
int ****sourcePathSize;
int ****sourcePathCapacity;
LPCSTR ***uninstallPath;
int ***pppiStack_240;
int ***pppiStack_23c;
int ***pppiStack_238;
int ****uninstallPathSize;
int ****uninstallPathCapacity;
int ****modPath;
int ***pppiStack_228;
int ***pppiStack_224;
int ***pppiStack_220;
int ****modPathSize;
int ****modPathCapacity;
byte uninstallingText [256];
byte installingText [256];
uint stackCookie;
void *local_10;
undefined1 *puStack_c;
undefined4 local_8;
qword allocatedBytes;
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 0xff;
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x1))) = 0xffffff;
puStack_c = &LAB_00b07cb7;
local_10 = ExceptionList;
stackCookie = __security_cookie ^ GHIDRA_UINT((installingText + 0x110));
ExceptionList = &local_10;
workshopEntries = in_stack_00000004;
entryIdx = 0;
entriesBegin = *in_stack_00000004;
iVar5 = in_stack_00000004[1] - entriesBegin >> 0x1f;
if ((in_stack_00000004[1] - entriesBegin) / 0x50 + iVar5 != iVar5) {
do {
ppppiVar15 = GHIDRA_CAST<int ****>((entryIdx * 0x50 + entriesBegin));
local_29c = ppppiVar15;
if (*ppppiVar15 == GHIDRA_CAST<int ***>(0x2)) {
pbVar6 = string_table_translate(&g_manager->_stringTablePc,GHIDRA_CAST<byte *>("#MOD_UNINSTALLING"));
sprintf_s(uninstallingText,0x100,pbVar6);
pbVar6 = uninstallingText;
do {
bVar3 = *pbVar6;
pbVar6 = pbVar6 + 1;
} while (bVar3 != 0);
(GHIDRA_CAST<std::string *>((&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((g_manager)) + 0x4a6dc))))))->std::string::assign(uninstallingText,
GHIDRA_INT(pbVar6) - GHIDRA_INT((uninstallingText + 1)));
local_29c = GHIDRA_CAST<int ****>(ppppiVar15[0xb]);
ppppiVar14 = ppppiVar15 + 7;
uninstallPath = GHIDRA_CAST<LPCSTR ***>(0x0);
uninstallPathSize = GHIDRA_CAST<int ****>(0x0);
uninstallPathCapacity = GHIDRA_CAST<int ****>(0x0);
if (GHIDRA_CAST<int ***>(0xf) < ppppiVar15[0xc]) {
ppppiVar14 = GHIDRA_CAST<int ****>(*ppppiVar14);
}
if (&DAT_0000000f < local_29c) {
ppppiVar15 = GHIDRA_CAST<int ****>((GHIDRA_UINT(local_29c) | 0xf));
if (GHIDRA_CAST<int ****>(0x7fffffff) < ppppiVar15) {
ppppiVar15 = GHIDRA_CAST<int ****>(0x7fffffff);
}
uninstallPath = std::_Allocate(GHIDRA_UINT((GHIDRA_INT(ppppiVar15) + 1)));
memcpy(uninstallPath,ppppiVar14,(size_t)(GHIDRA_INT(local_29c) + 1));
uninstallPathCapacity = ppppiVar15;
}
else {
uninstallPath = GHIDRA_CAST<LPCSTR ***>(*ppppiVar14);
pppiStack_240 = ppppiVar14[1];
pppiStack_23c = ppppiVar14[2];
pppiStack_238 = ppppiVar14[3];
uninstallPathCapacity = GHIDRA_CAST<int ****>(&DAT_0000000f);
}
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 6;
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x1))) = 0;
uninstallPathSize = local_29c;
(GHIDRA_CAST<std::string *>((GHIDRA_CAST<char *>(&uninstallPath))))->std::string::append(&DAT_00b76eac,1);
ppppiVar11 = GHIDRA_CAST<int ****>(0x0);
ppppCVar12 = uninstallPath;
ppppiVar15 = uninstallPathSize;
ppppiVar14 = uninstallPathCapacity;
if (uninstallPathSize != GHIDRA_CAST<int ****>(0x0)) {
do {
ppppCVar10 = GHIDRA_CAST<LPCSTR ***>(&uninstallPath);
if (&DAT_0000000f < ppppiVar14) {
ppppCVar10 = ppppCVar12;
}
if (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(ppppCVar10) + GHIDRA_INT(ppppiVar11))) == '/') {
ppppCVar10 = GHIDRA_CAST<LPCSTR ***>(&uninstallPath);
if (&DAT_0000000f < ppppiVar14) {
ppppCVar10 = ppppCVar12;
}
*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(ppppCVar10) + GHIDRA_INT(ppppiVar11))) = 0x5c;
ppppCVar12 = uninstallPath;
ppppiVar15 = uninstallPathSize;
ppppiVar14 = uninstallPathCapacity;
}
ppppiVar11 = GHIDRA_CAST<int ****>((GHIDRA_INT(ppppiVar11) + 1));
} while (ppppiVar11 < ppppiVar15);
}
if (ppppiVar15 < ppppiVar14) {
uninstallPathSize = GHIDRA_CAST<int ****>((GHIDRA_INT(ppppiVar15) + 1));
ppppCVar10 = GHIDRA_CAST<LPCSTR ***>(&uninstallPath);
if (&DAT_0000000f < ppppiVar14) {
ppppCVar10 = ppppCVar12;
}
*GHIDRA_CAST<undefined2 *>((GHIDRA_CAST<char *>(ppppCVar10) + GHIDRA_INT(ppppiVar15))) = 0;
}
else {
if (ppppiVar15 == GHIDRA_CAST<int ****>(0x7fffffff)) goto LAB_008fb119;
local_290 = GHIDRA_CAST<int ****>((GHIDRA_UINT((GHIDRA_INT(ppppiVar15) + 1)) | 0xf));
if (local_290 < GHIDRA_CAST<int ****>(0x80000000)) {
if (GHIDRA_CAST<int ****>((0x7fffffff - (GHIDRA_UINT(ppppiVar14) >> 1))) < ppppiVar14) {
local_290 = GHIDRA_CAST<int ****>(0x7fffffff);
}
else {
ppppiVar11 = GHIDRA_CAST<int ****>((GHIDRA_INT(ppppiVar14) + (GHIDRA_UINT(ppppiVar14) >> 1)));
if (local_290 < ppppiVar11) {
local_290 = ppppiVar11;
}
}
}
else {
local_290 = GHIDRA_CAST<int ****>(0x7fffffff);
}
local_294 = std::_Allocate(GHIDRA_UINT((GHIDRA_INT(local_290) + 1)));
ppppCVar12 = uninstallPath;
uninstallPathSize = GHIDRA_CAST<int ****>((GHIDRA_INT(ppppiVar15) + 1));
uninstallPathCapacity = local_290;
local_29c = GHIDRA_CAST<int ****>((GHIDRA_INT(local_294) + GHIDRA_INT(ppppiVar15)));
local_298 = GHIDRA_CAST<int ****>((GHIDRA_CAST<undefined1 *>((GHIDRA_INT(ppppiVar15) + 1)) + GHIDRA_INT(local_294)));
if (ppppiVar14 < GHIDRA_CAST<int ****>(0x10)) {
memcpy(local_294,&uninstallPath,(size_t)ppppiVar15);
*GHIDRA_CAST<undefined1 *>(local_29c) = 0;
*GHIDRA_CAST<undefined1 *>(local_298) = 0;
}
else {
memcpy(local_294,uninstallPath,(size_t)ppppiVar15);
ppppiVar15 = GHIDRA_CAST<int ****>((GHIDRA_INT(ppppiVar14) + 1));
*GHIDRA_CAST<undefined1 *>(local_29c) = 0;
*GHIDRA_CAST<undefined1 *>(local_298) = 0;
ppppCVar10 = ppppCVar12;
if (GHIDRA_CAST<int ****>(0xfff) < ppppiVar15) {
ppppCVar10 = GHIDRA_CAST<LPCSTR ***>(ppppCVar12[-1]);
ppppiVar15 = ppppiVar14 + 9;
if (GHIDRA_CAST<undefined1 *>(0x1f) < GHIDRA_CAST<undefined1 *>((GHIDRA_INT(ppppCVar12) + (-4 - GHIDRA_INT(ppppCVar10)))))
goto LAB_008fb113;
}
operator_delete(ppppCVar10,GHIDRA_UINT(ppppiVar15));
}
uninstallPath = local_294;
}
deleteOp.hwnd = (HWND)0x0;
deleteOp.wFunc = 0;
deleteOp.pFrom = (LPCSTR)0x0;
deleteOp.pTo = (LPCSTR)0x0;
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(deleteOp)) + 0x18))) = 0;
(*GHIDRA_CAST<undefined8 *>((GHIDRA_CAST<char *>(&(deleteOp)) + 0x10))) = 0;
(*GHIDRA_CAST<undefined2 *>((GHIDRA_CAST<char *>(&(deleteOp.lpszProgressTitle)) + 0x2))) = 0;
if (_glfw == 0) {
_glfwInputError(0x10001,0);
deleteOp.hwnd = (HWND)0x0;
}
else if (DAT_00c73694 == 0x60001) {
deleteOp.hwnd = *GHIDRA_CAST<HWND *>((GHIDRA_CAST<char *>(g_glfwWindow) + 0x2b4));
}
else {
_glfwInputError(0x1000e,"Win32: Platform not initialized");
deleteOp.hwnd = (HWND)0x0;
}
deleteOp.fFlags = 0x614;
deleteOp.pFrom = (LPCSTR)&uninstallPath;
if (&DAT_0000000f < uninstallPathCapacity) {
deleteOp.pFrom = (LPCSTR)uninstallPath;
}
deleteOp.wFunc = 3;
SHFileOperationA(&deleteOp);
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 0xff;
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x1))) = 0xffffff;
if (&DAT_0000000f < uninstallPathCapacity) {
ppppiVar15 = GHIDRA_CAST<int ****>((GHIDRA_INT(uninstallPathCapacity) + 1));
ppppCVar12 = uninstallPath;
if (GHIDRA_CAST<int ****>(0xfff) < ppppiVar15) {
ppppCVar12 = GHIDRA_CAST<LPCSTR ***>(uninstallPath[-1]);
ppppiVar15 = uninstallPathCapacity + 9;
if (GHIDRA_CAST<undefined1 *>(0x1f) < GHIDRA_CAST<undefined1 *>((GHIDRA_INT(uninstallPath) + (-4 - GHIDRA_INT(ppppCVar12)))))
goto LAB_008fb113;
}
operator_delete(ppppCVar12,GHIDRA_UINT(ppppiVar15));
}
uninstallPathSize = GHIDRA_CAST<int ****>(0x0);
uninstallPathCapacity = GHIDRA_CAST<int ****>(&DAT_0000000f);
uninstallPath = GHIDRA_CAST<LPCSTR ***>((GHIDRA_UINT(uninstallPath) & 0xffffff00));
}
else {
statusKey = "#MOD_INSTALLING";
if (*ppppiVar15 != GHIDRA_CAST<int ***>(0x1)) {
statusKey = "#MOD_UPDATING";
}
pbVar6 = string_table_translate(&g_manager->_stringTablePc,GHIDRA_CAST<byte *>(statusKey));
sprintf_s(installingText,0x100,pbVar6);
pbVar6 = installingText;
do {
bVar3 = *pbVar6;
pbVar6 = pbVar6 + 1;
} while (bVar3 != 0);
(GHIDRA_CAST<std::string *>((&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((g_manager)) + 0x4a6dc))))))->std::string::assign(installingText,
GHIDRA_INT(pbVar6) - GHIDRA_INT((installingText + 1)));
local_290 = GHIDRA_CAST<int ****>(ppppiVar15[0xb]);
ppppiVar14 = ppppiVar15 + 7;
sourcePath = GHIDRA_CAST<int ****>(0x0);
sourcePathSize = GHIDRA_CAST<int ****>(0x0);
sourcePathCapacity = GHIDRA_CAST<int ****>(0x0);
if (GHIDRA_CAST<int ***>(0xf) < ppppiVar15[0xc]) {
ppppiVar14 = GHIDRA_CAST<int ****>(*ppppiVar14);
}
if (&DAT_0000000f < local_290) {
ppppiVar15 = GHIDRA_CAST<int ****>((GHIDRA_UINT(local_290) | 0xf));
if (GHIDRA_CAST<int ****>(0x7fffffff) < ppppiVar15) {
ppppiVar15 = GHIDRA_CAST<int ****>(0x7fffffff);
}
sourcePath = std::_Allocate(GHIDRA_UINT((GHIDRA_INT(ppppiVar15) + 1)));
memcpy(sourcePath,ppppiVar14,(size_t)(GHIDRA_INT(local_290) + 1));
sourcePathSize = local_290;
sourcePathCapacity = ppppiVar15;
}
else {
sourcePath = GHIDRA_CAST<int ****>(*ppppiVar14);
pppiStack_258 = ppppiVar14[1];
pppiStack_254 = ppppiVar14[2];
pppiStack_250 = ppppiVar14[3];
sourcePathCapacity = GHIDRA_CAST<int ****>(&DAT_0000000f);
sourcePathSize = local_290;
}
modDirString = local_29c + 0xd;
local_8 = 0;
modPath = GHIDRA_CAST<int ****>(0x0);
modPathSize = GHIDRA_CAST<int ****>(0x0);
modPathCapacity = GHIDRA_CAST<int ****>(0x0);
ppppiVar15 = GHIDRA_CAST<int ****>(local_29c[0x11]);
local_290 = modDirString;
if (GHIDRA_CAST<int ***>(0xf) < local_29c[0x12]) {
local_290 = GHIDRA_CAST<int ****>(*modDirString);
}
if (&DAT_0000000f < ppppiVar15) {
ppppiVar14 = GHIDRA_CAST<int ****>((GHIDRA_UINT(ppppiVar15) | 0xf));
if (GHIDRA_CAST<int ****>(0x7fffffff) < ppppiVar14) {
ppppiVar14 = GHIDRA_CAST<int ****>(0x7fffffff);
}
modPath = std::_Allocate(GHIDRA_UINT((GHIDRA_INT(ppppiVar14) + 1)));
memcpy(modPath,local_290,(size_t)(GHIDRA_INT(ppppiVar15) + 1));
modPathCapacity = ppppiVar14;
}
else {
modPath = GHIDRA_CAST<int ****>(*local_290);
pppiStack_228 = local_290[1];
pppiStack_224 = local_290[2];
pppiStack_220 = local_290[3];
modPathCapacity = GHIDRA_CAST<int ****>(&DAT_0000000f);
}
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 1;
modPathSize = ppppiVar15;
(GHIDRA_CAST<std::string *>((GHIDRA_CAST<char *>(&sourcePath))))->std::string::append(&DAT_00b76eac,1);
(GHIDRA_CAST<std::string *>((GHIDRA_CAST<char *>(&modPath))))->std::string::append(&DAT_00b76eac,1);
ppppiVar15 = GHIDRA_CAST<int ****>(0x0);
if (sourcePathSize != GHIDRA_CAST<int ****>(0x0)) {
ppppiVar14 = sourcePathCapacity;
ppppiVar11 = sourcePath;
ppppiVar7 = sourcePathSize;
do {
ppppiVar8 = GHIDRA_CAST<int ****>(&sourcePath);
if (&DAT_0000000f < ppppiVar14) {
ppppiVar8 = ppppiVar11;
}
if (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(ppppiVar8) + GHIDRA_INT(ppppiVar15))) == '/') {
ppppiVar7 = GHIDRA_CAST<int ****>(&sourcePath);
if (&DAT_0000000f < ppppiVar14) {
ppppiVar7 = ppppiVar11;
}
*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(ppppiVar7) + GHIDRA_INT(ppppiVar15))) = 0x5c;
ppppiVar14 = sourcePathCapacity;
ppppiVar11 = sourcePath;
ppppiVar7 = sourcePathSize;
}
ppppiVar15 = GHIDRA_CAST<int ****>((GHIDRA_INT(ppppiVar15) + 1));
} while (ppppiVar15 < ppppiVar7);
}
ppppiVar15 = GHIDRA_CAST<int ****>(0x0);
if (modPathSize != GHIDRA_CAST<int ****>(0x0)) {
ppppiVar14 = modPathSize;
ppppiVar11 = modPathCapacity;
ppppiVar7 = modPath;
do {
ppppiVar8 = GHIDRA_CAST<int ****>(&modPath);
if (&DAT_0000000f < ppppiVar11) {
ppppiVar8 = ppppiVar7;
}
if (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(ppppiVar8) + GHIDRA_INT(ppppiVar15))) == '/') {
ppppiVar14 = GHIDRA_CAST<int ****>(&modPath);
if (&DAT_0000000f < ppppiVar11) {
ppppiVar14 = ppppiVar7;
}
*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(ppppiVar14) + GHIDRA_INT(ppppiVar15))) = 0x5c;
ppppiVar14 = modPathSize;
ppppiVar11 = modPathCapacity;
ppppiVar7 = modPath;
}
ppppiVar15 = GHIDRA_CAST<int ****>((GHIDRA_INT(ppppiVar15) + 1));
} while (ppppiVar15 < ppppiVar14);
}
(GHIDRA_CAST<std::string *>((GHIDRA_CAST<char *>(&sourcePath))))->std::string::append(&DAT_00b76fc0,3);
ppppiVar15 = sourcePathSize;
local_290 = sourcePathCapacity;
if (sourcePathSize < sourcePathCapacity) {
ppppiVar15 = GHIDRA_CAST<int ****>(&sourcePath);
if (&DAT_0000000f < sourcePathCapacity) {
ppppiVar15 = sourcePath;
}
puVar1 = GHIDRA_CAST<undefined2 *>((GHIDRA_INT(ppppiVar15) + GHIDRA_INT(sourcePathSize)));
sourcePathSize = GHIDRA_CAST<int ****>((GHIDRA_INT(sourcePathSize) + 1));
*puVar1 = 0;
}
else {
if (sourcePathSize == GHIDRA_CAST<int ****>(0x7fffffff)) goto LAB_008fb119;
ppppiVar14 = GHIDRA_CAST<int ****>((GHIDRA_UINT((GHIDRA_INT(sourcePathSize) + 1)) | 0xf));
if (ppppiVar14 < GHIDRA_CAST<int ****>(0x80000000)) {
if (GHIDRA_CAST<int ****>((0x7fffffff - (GHIDRA_UINT(sourcePathCapacity) >> 1))) < sourcePathCapacity) {
ppppiVar14 = GHIDRA_CAST<int ****>(0x7fffffff);
}
else {
ppppiVar11 = GHIDRA_CAST<int ****>(((GHIDRA_UINT(sourcePathCapacity) >> 1) + GHIDRA_INT(sourcePathCapacity)));
if (ppppiVar14 < ppppiVar11) {
ppppiVar14 = ppppiVar11;
}
}
}
else {
ppppiVar14 = GHIDRA_CAST<int ****>(0x7fffffff);
}
local_298 = std::_Allocate(GHIDRA_UINT((GHIDRA_INT(ppppiVar14) + 1)));
ppppiVar11 = sourcePath;
sourcePathSize = GHIDRA_CAST<int ****>((GHIDRA_INT(ppppiVar15) + 1));
local_294 = GHIDRA_CAST<LPCSTR ***>((GHIDRA_CAST<undefined1 *>((GHIDRA_INT(ppppiVar15) + 1)) + GHIDRA_INT(local_298)));
puVar2 = GHIDRA_CAST<undefined1 *>((GHIDRA_INT(ppppiVar15) + GHIDRA_INT(local_298)));
local_2a8 = puVar2;
sourcePathCapacity = ppppiVar14;
if (local_290 < GHIDRA_CAST<int ****>(0x10)) {
memcpy(local_298,&sourcePath,(size_t)ppppiVar15);
*puVar2 = 0;
*GHIDRA_CAST<undefined1 *>(local_294) = 0;
}
else {
memcpy(local_298,sourcePath,(size_t)ppppiVar15);
ppppiVar14 = GHIDRA_CAST<int ****>((GHIDRA_INT(local_290) + 1));
*local_2a8 = 0;
*GHIDRA_CAST<undefined1 *>(local_294) = 0;
ppppiVar15 = ppppiVar11;
if (GHIDRA_CAST<int ****>(0xfff) < ppppiVar14) {
ppppiVar15 = GHIDRA_CAST<int ****>(ppppiVar11[-1]);
ppppiVar14 = local_290 + 9;
if (GHIDRA_CAST<undefined1 *>(0x1f) < GHIDRA_CAST<undefined1 *>((GHIDRA_INT(ppppiVar11) + (-4 - GHIDRA_INT(ppppiVar15)))))
goto LAB_008fb113;
}
operator_delete(ppppiVar15,GHIDRA_UINT(ppppiVar14));
}
sourcePath = local_298;
}
ppppiVar15 = modPathSize;
local_298 = modPathCapacity;
if (modPathSize < modPathCapacity) {
ppppiVar15 = GHIDRA_CAST<int ****>(&modPath);
if (&DAT_0000000f < modPathCapacity) {
ppppiVar15 = modPath;
}
puVar1 = GHIDRA_CAST<undefined2 *>((GHIDRA_INT(ppppiVar15) + GHIDRA_INT(modPathSize)));
modPathSize = GHIDRA_CAST<int ****>((GHIDRA_INT(modPathSize) + 1));
*puVar1 = 0;
}
else {
if (modPathSize == GHIDRA_CAST<int ****>(0x7fffffff)) goto LAB_008fb119;
ppppiVar14 = GHIDRA_CAST<int ****>((GHIDRA_UINT((GHIDRA_INT(modPathSize) + 1)) | 0xf));
if (ppppiVar14 < GHIDRA_CAST<int ****>(0x80000000)) {
if (GHIDRA_CAST<int ****>((0x7fffffff - (GHIDRA_UINT(modPathCapacity) >> 1))) < modPathCapacity) {
ppppiVar14 = GHIDRA_CAST<int ****>(0x7fffffff);
}
else {
ppppiVar11 = GHIDRA_CAST<int ****>(((GHIDRA_UINT(modPathCapacity) >> 1) + GHIDRA_INT(modPathCapacity)));
if (ppppiVar14 < ppppiVar11) {
ppppiVar14 = ppppiVar11;
}
}
}
else {
ppppiVar14 = GHIDRA_CAST<int ****>(0x7fffffff);
}
local_290 = std::_Allocate(GHIDRA_UINT((GHIDRA_INT(ppppiVar14) + 1)));
ppppiVar11 = modPath;
modPathSize = GHIDRA_CAST<int ****>((GHIDRA_INT(ppppiVar15) + 1));
local_294 = GHIDRA_CAST<LPCSTR ***>((GHIDRA_CAST<undefined1 *>((GHIDRA_INT(ppppiVar15) + 1)) + GHIDRA_INT(local_290)));
puVar2 = GHIDRA_CAST<undefined1 *>((GHIDRA_INT(local_290) + GHIDRA_INT(ppppiVar15)));
local_2a8 = puVar2;
modPathCapacity = ppppiVar14;
if (local_298 < GHIDRA_CAST<int ****>(0x10)) {
memcpy(local_290,&modPath,(size_t)ppppiVar15);
*puVar2 = 0;
*GHIDRA_CAST<undefined1 *>(local_294) = 0;
}
else {
memcpy(local_290,modPath,(size_t)ppppiVar15);
ppppiVar14 = GHIDRA_CAST<int ****>((GHIDRA_INT(local_298) + 1));
*local_2a8 = 0;
*GHIDRA_CAST<undefined1 *>(local_294) = 0;
ppppiVar15 = ppppiVar11;
if (GHIDRA_CAST<int ****>(0xfff) < ppppiVar14) {
ppppiVar15 = GHIDRA_CAST<int ****>(ppppiVar11[-1]);
ppppiVar14 = local_298 + 9;
if (GHIDRA_CAST<undefined1 *>(0x1f) < GHIDRA_CAST<undefined1 *>((GHIDRA_INT(ppppiVar11) + (-4 - GHIDRA_INT(ppppiVar15)))))
goto LAB_008fb113;
}
operator_delete(ppppiVar15,GHIDRA_UINT(ppppiVar14));
}
modPath = local_290;
}
fileOp.hwnd = (HWND)0x0;
fileOp.wFunc = 0;
fileOp.pFrom = (LPCSTR)0x0;
fileOp.pTo = (LPCSTR)0x0;
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(fileOp)) + 0x18))) = 0;
(*GHIDRA_CAST<undefined8 *>((GHIDRA_CAST<char *>(&(fileOp)) + 0x10))) = 0;
(*GHIDRA_CAST<undefined2 *>((GHIDRA_CAST<char *>(&(fileOp.lpszProgressTitle)) + 0x2))) = 0;
if (_glfw == 0) {
_glfwInputError(0x10001,0);
fileOp.hwnd = (HWND)0x0;
}
else if (DAT_00c73694 == 0x60001) {
fileOp.hwnd = *GHIDRA_CAST<HWND *>((GHIDRA_CAST<char *>(g_glfwWindow) + 0x2b4));
}
else {
_glfwInputError(0x1000e,"Win32: Platform not initialized");
fileOp.hwnd = (HWND)0x0;
}
fileOp.fFlags = 0x614;
fileOp.pFrom = (LPCSTR)&modPath;
if (&DAT_0000000f < modPathCapacity) {
fileOp.pFrom = (LPCSTR)modPath;
}
fileOp.wFunc = 3;
SHFileOperationA(&fileOp);
ppppiVar15 = GHIDRA_CAST<int ****>(&modPath);
if (&DAT_0000000f < modPathCapacity) {
ppppiVar15 = modPath;
}
CreateDirectoryA((LPCSTR)ppppiVar15,(LPSECURITY_ATTRIBUTES)0x0);
ppppiVar15 = modDirString;
psVar4 = GHIDRA_CAST<std_string *>(modDirString[4]);
if (0x7fffffffU - GHIDRA_INT(psVar4) < 0xe) {
LAB_008fb119:
/* WARNING: Subroutine does not return */
std::string::_Xlen();
}
ppppiVar14 = modDirString;
if (GHIDRA_CAST<int ***>(0xf) < modDirString[5]) {
ppppiVar14 = GHIDRA_CAST<int ****>(*modDirString);
}
(GHIDRA_CAST<std::string *>((GHIDRA_CAST<char *>(markerPath))))->std::string::concat(GHIDRA_INT(modDirString),psVar4,GHIDRA_CAST<byte *>(ppppiVar14),
GHIDRA_UINT(psVar4),GHIDRA_CAST<byte *>("/unfinished.it"),0xe);
local_8 = CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x1))),2);
ppppbVar9 = GHIDRA_CAST<byte ****>(markerPath);
if (0xf < markerPathCapacity) {
ppppbVar9 = markerPath[0];
}
markerFile = (GHIDRA_CAST<SaveDataManager *>((&PTR_vftable_00c5aa80)))->SaveDataManager::open_file_write(GHIDRA_CAST<byte *>(ppppbVar9),0);
if (markerFile != GHIDRA_CAST<undefined4 *>(0x0)) {
(**(code **)*markerFile)(1);
}
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 1;
if (0xf < markerPathCapacity) {
uVar13 = markerPathCapacity + 1;
ppppbVar9 = markerPath[0];
if (0xfff < uVar13) {
ppppbVar9 = GHIDRA_CAST<byte ****>(markerPath[0][-1]);
uVar13 = markerPathCapacity + 0x24;
if (GHIDRA_CAST<byte *>(0x1f) < GHIDRA_CAST<byte *>((GHIDRA_INT(markerPath[0]) + (-4 - GHIDRA_INT(ppppbVar9)))))
goto LAB_008fb113;
}
operator_delete(ppppbVar9,uVar13);
}
fileOp.wFunc = 2;
fileOp.pTo = (LPCSTR)&modPath;
if (&DAT_0000000f < modPathCapacity) {
fileOp.pTo = (LPCSTR)modPath;
}
fileOp.pFrom = (LPCSTR)&sourcePath;
if (&DAT_0000000f < sourcePathCapacity) {
fileOp.pFrom = (LPCSTR)sourcePath;
}
SHFileOperationA(&fileOp);
if (*GHIDRA_CAST<char *>((local_29c + 0x13)) != '\0') {
psVar4 = GHIDRA_CAST<std_string *>(ppppiVar15[4]);
if (0x7fffffffU - GHIDRA_INT(psVar4) < 0xb) goto LAB_008fb119;
ppppiVar14 = ppppiVar15;
if (GHIDRA_CAST<int ***>(0xf) < ppppiVar15[5]) {
ppppiVar14 = GHIDRA_CAST<int ****>(*ppppiVar15);
}
(GHIDRA_CAST<std::string *>((GHIDRA_CAST<char *>(markerPath))))->std::string::concat(GHIDRA_INT(modDirString),psVar4,GHIDRA_CAST<byte *>(ppppiVar14),
GHIDRA_UINT(psVar4),GHIDRA_CAST<byte *>("/disable.it"),0xb);
local_8 = CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x1))),3);
ppppbVar9 = GHIDRA_CAST<byte ****>(markerPath);
if (0xf < markerPathCapacity) {
ppppbVar9 = markerPath[0];
}
markerFile = (GHIDRA_CAST<SaveDataManager *>((&PTR_vftable_00c5aa80)))->SaveDataManager::open_file_write(GHIDRA_CAST<byte *>(ppppbVar9),0);
if (markerFile != GHIDRA_CAST<undefined4 *>(0x0)) {
(**(code **)*markerFile)(1);
}
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 1;
if (0xf < markerPathCapacity) {
uVar13 = markerPathCapacity + 1;
ppppbVar9 = markerPath[0];
if (0xfff < uVar13) {
ppppbVar9 = GHIDRA_CAST<byte ****>(markerPath[0][-1]);
uVar13 = markerPathCapacity + 0x24;
if (GHIDRA_CAST<byte *>(0x1f) < GHIDRA_CAST<byte *>((GHIDRA_INT(markerPath[0]) + (-4 - GHIDRA_INT(ppppbVar9)))))
goto LAB_008fb113;
}
operator_delete(ppppbVar9,uVar13);
}
}
psVar4 = GHIDRA_CAST<std_string *>(ppppiVar15[4]);
if (0x7fffffffU - GHIDRA_INT(psVar4) < 0xe) goto LAB_008fb119;
if (GHIDRA_CAST<int ***>(0xf) < ppppiVar15[5]) {
ppppiVar15 = GHIDRA_CAST<int ****>(*ppppiVar15);
}
(GHIDRA_CAST<std::string *>((GHIDRA_CAST<char *>(unfinishedPath))))->std::string::concat(GHIDRA_INT(modDirString),psVar4,GHIDRA_CAST<byte *>(ppppiVar15),
GHIDRA_UINT(psVar4),GHIDRA_CAST<byte *>("/unfinished.it"),0xe);
local_8 = CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x1))),4);
ppppbVar9 = GHIDRA_CAST<byte ****>(unfinishedPath);
if (0xf < unfinishedPathCapacity) {
ppppbVar9 = unfinishedPath[0];
}
pbVar6 = FileSystem::ResolvePath(GHIDRA_CAST<byte *>(ppppbVar9));
isUnfinishedExists = pbVar6 != GHIDRA_CAST<byte *>(0x0);
if (pbVar6 != GHIDRA_CAST<byte *>(0x0)) {
if (g_mainHeap == (void *)0x0) {
allocCounter = &g_allocatedBytesNoHeap;
}
else {
allocCounter = GHIDRA_CAST<qword *>((GHIDRA_INT(g_mainHeap) + 0x30));
}
uVar13 = *GHIDRA_CAST<uint *>((pbVar6 + -4));
allocatedBytes = *allocCounter;
*GHIDRA_CAST<uint *>(allocCounter) = GHIDRA_UINT(*allocCounter) - uVar13;
*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(allocCounter) + 4)) =
*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(allocCounter) + 4)) - GHIDRA_UINT((GHIDRA_UINT(allocatedBytes) < uVar13));
free(pbVar6 + -4);
}
if (isUnfinishedExists != '\0') {
ppppbVar9 = GHIDRA_CAST<byte ****>(unfinishedPath);
if (0xf < unfinishedPathCapacity) {
ppppbVar9 = unfinishedPath[0];
}
remove(GHIDRA_CAST<char *>(ppppbVar9));
}
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 1;
if (0xf < unfinishedPathCapacity) {
uVar13 = unfinishedPathCapacity + 1;
ppppbVar9 = unfinishedPath[0];
if (0xfff < uVar13) {
ppppbVar9 = GHIDRA_CAST<byte ****>(unfinishedPath[0][-1]);
uVar13 = unfinishedPathCapacity + 0x24;
if (GHIDRA_CAST<byte *>(0x1f) < GHIDRA_CAST<byte *>((GHIDRA_INT(unfinishedPath[0]) + (-4 - GHIDRA_INT(ppppbVar9)))))
goto LAB_008fb113;
}
operator_delete(ppppbVar9,uVar13);
}
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 0;
unfinishedPathSize = 0;
unfinishedPathCapacity = 0xf;
unfinishedPath[0] = GHIDRA_CAST<byte ****>((GHIDRA_UINT(unfinishedPath[0]) & 0xffffff00));
if (&DAT_0000000f < modPathCapacity) {
ppppiVar14 = GHIDRA_CAST<int ****>((GHIDRA_INT(modPathCapacity) + 1));
ppppiVar15 = modPath;
if (GHIDRA_CAST<int ****>(0xfff) < ppppiVar14) {
ppppiVar15 = GHIDRA_CAST<int ****>(modPath[-1]);
ppppiVar14 = modPathCapacity + 9;
if (GHIDRA_CAST<undefined1 *>(0x1f) < GHIDRA_CAST<undefined1 *>((GHIDRA_INT(modPath) + (-4 - GHIDRA_INT(ppppiVar15)))))
goto LAB_008fb113;
}
operator_delete(ppppiVar15,GHIDRA_UINT(ppppiVar14));
}
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 0xff;
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x1))) = 0xffffff;
modPathSize = GHIDRA_CAST<int ****>(0x0);
modPathCapacity = GHIDRA_CAST<int ****>(&DAT_0000000f);
modPath = GHIDRA_CAST<int ****>((GHIDRA_UINT(modPath) & 0xffffff00));
if (&DAT_0000000f < sourcePathCapacity) {
ppppiVar14 = GHIDRA_CAST<int ****>((GHIDRA_INT(sourcePathCapacity) + 1));
ppppiVar15 = sourcePath;
if (GHIDRA_CAST<int ****>(0xfff) < ppppiVar14) {
ppppiVar15 = GHIDRA_CAST<int ****>(sourcePath[-1]);
ppppiVar14 = sourcePathCapacity + 9;
if (GHIDRA_CAST<undefined1 *>(0x1f) < GHIDRA_CAST<undefined1 *>((GHIDRA_INT(sourcePath) + (-4 - GHIDRA_INT(ppppiVar15))))) {
LAB_008fb113:
/* WARNING: Subroutine does not return */
_invalid_parameter_noinfo_noreturn();
}
}
operator_delete(ppppiVar15,GHIDRA_UINT(ppppiVar14));
}
}
entryIdx = entryIdx + 1;
entriesBegin = *workshopEntries;
} while (entryIdx < GHIDRA_UINT(((workshopEntries[1] - entriesBegin) / 0x50)));
}
*GHIDRA_CAST<undefined1 *>((workshopEntries + 3)) = 1;
ExceptionList = local_10;
return;
}