--check: 938/3256 method bodies compile for x86_64 (28.8%), 32-bit layout asserts hold; boot path 3/626 curated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
134 lines
5.3 KiB
C++
134 lines
5.3 KiB
C++
#include "classes.h"
|
|
|
|
// 0091adf0
|
|
void PersistentGameDataReader::read(PersistentGameData *data)
|
|
{
|
|
int *piVar1;
|
|
uint32_t *newNode;
|
|
void *node;
|
|
uint32_t uVar2;
|
|
std_map *bestiaryMap;
|
|
void *insertParent;
|
|
int insertSide;
|
|
void *foundNode;
|
|
std_map *local_28;
|
|
uint32_t local_24;
|
|
std_map *local_20;
|
|
uint32_t local_1c;
|
|
uint32_t i;
|
|
PersistentGameData *encounterCount;
|
|
void *local_10;
|
|
uint8_t *puStack_c;
|
|
uint32_t local_8;
|
|
PersistentGameData *gameData;
|
|
|
|
local_8 = 0xffffffff;
|
|
puStack_c = &LAB_00b0a0b5;
|
|
local_10 = ExceptionList;
|
|
ExceptionList = &local_10;
|
|
piVar1 = GHIDRA_CAST<int *>((GHIDRA_INT(this) + 0x48));
|
|
(**(code **)(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x48)) + 0xc))
|
|
(0,0,__security_cookie ^ GHIDRA_INT(register0x00000010) - 4U);
|
|
gameData = data;
|
|
FUN_0091b650(data->_achievements,0x282);
|
|
(**(code **)(*piVar1 + 0x14))(gameData->_eventCounters,1,0x82c);
|
|
FUN_0091b650(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((gameData)) + 0xae8))),0x2dd);
|
|
(**(code **)(*piVar1 + 0x14))(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((gameData)) + 0xdc8))),1,0x38);
|
|
FUN_0091b650(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((gameData)) + 0xe00))),7);
|
|
FUN_0091b650(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((gameData)) + 0xe07))),0x68);
|
|
(**(code **)(*piVar1 + 0x14))(gameData->_cutsceneCounters,1,0x6c);
|
|
FUN_0091b650(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((gameData)) + 0xe6f))),0x2e);
|
|
node = (gameData->_bestiaryEncounters)._head;
|
|
bestiaryMap = &gameData->_bestiaryEncounters;
|
|
FID_conflict__Erase_tree<fuzzer::fuzzer_allocator<msvc::_Tree_node<fuzzer::TracePC::PCTableEntry_const*,void*>_>_>
|
|
(bestiaryMap,(fuzzer_allocator<msvc::_Tree_node<unsigned_int,void*>_> *)bestiaryMap,
|
|
*(_Tree_node<unsigned_int,void*> **)(GHIDRA_INT(node) + 4));
|
|
*(void **)(GHIDRA_CAST<char *>(node) + 4) = node;
|
|
*(void **)node = node;
|
|
*(void **)(GHIDRA_CAST<char *>(node) + 8) = node;
|
|
(gameData->_bestiaryEncounters)._size = 0;
|
|
encounterCount = GHIDRA_CAST<PersistentGameData *>(0x0);
|
|
(**(code **)(*piVar1 + 0x14))(&encounterCount,1,4);
|
|
i = 0;
|
|
if (encounterCount != GHIDRA_CAST<PersistentGameData *>(0x0)) {
|
|
do {
|
|
uVar2 = i;
|
|
local_20 = GHIDRA_CAST<std_map *>(0xffffffff);
|
|
local_1c = 0xffffffff;
|
|
(**(code **)(*piVar1 + 0x14))(&local_20,1,8);
|
|
msvc::set<int>::find_node(&insertParent,&local_20);
|
|
if ((*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(foundNode) + 0xd)) != '\0') ||
|
|
(node = foundNode, GHIDRA_INT(local_20) < *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(foundNode) + 0x10)))) {
|
|
if ((gameData->_bestiaryEncounters)._size == 0xaaaaaaa) goto LAB_0091b0e5;
|
|
node = bestiaryMap->_head;
|
|
local_8 = 0;
|
|
local_24 = 0;
|
|
local_28 = bestiaryMap;
|
|
newNode = operator_new(0x18);
|
|
local_8 = 0xffffffff;
|
|
local_24 = 0;
|
|
newNode[4] = local_20;
|
|
newNode[5] = 0;
|
|
*newNode = node;
|
|
newNode[1] = node;
|
|
newNode[2] = node;
|
|
*GHIDRA_CAST<uint16_t *>((newNode + 3)) = 0;
|
|
node = (GHIDRA_CAST<msvc::_Tree *>((bestiaryMap)))->msvc::_Tree::_Insert_node(insertParent,insertSide,newNode);
|
|
uVar2 = i;
|
|
}
|
|
i = uVar2 + 1;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(node) + 0x14)) = local_1c;
|
|
} while (i < encounterCount);
|
|
}
|
|
gameData = data;
|
|
bestiaryMap = &data->_bestiaryKills;
|
|
node = bestiaryMap->_head;
|
|
FID_conflict__Erase_tree<fuzzer::fuzzer_allocator<msvc::_Tree_node<fuzzer::TracePC::PCTableEntry_const*,void*>_>_>
|
|
(bestiaryMap,(fuzzer_allocator<msvc::_Tree_node<unsigned_int,void*>_> *)bestiaryMap,
|
|
*(_Tree_node<unsigned_int,void*> **)(GHIDRA_INT(node) + 4));
|
|
*(void **)(GHIDRA_CAST<char *>(node) + 4) = node;
|
|
*(void **)node = node;
|
|
*(void **)(GHIDRA_CAST<char *>(node) + 8) = node;
|
|
(gameData->_bestiaryKills)._size = 0;
|
|
data = GHIDRA_CAST<PersistentGameData *>(0x0);
|
|
(**(code **)(*piVar1 + 0x14))(&data,1,4);
|
|
i = 0;
|
|
if (data != GHIDRA_CAST<PersistentGameData *>(0x0)) {
|
|
do {
|
|
uVar2 = i;
|
|
local_28 = GHIDRA_CAST<std_map *>(0xffffffff);
|
|
local_24 = 0xffffffff;
|
|
(**(code **)(*piVar1 + 0x14))(&local_28,1,8);
|
|
msvc::set<int>::find_node(&insertParent,&local_28);
|
|
if ((*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(foundNode) + 0xd)) != '\0') ||
|
|
(node = foundNode, GHIDRA_INT(local_28) < *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(foundNode) + 0x10)))) {
|
|
if ((gameData->_bestiaryKills)._size == 0xaaaaaaa) {
|
|
LAB_0091b0e5:
|
|
/* WARNING: Subroutine does not return */
|
|
FUN_004170d0();
|
|
}
|
|
node = bestiaryMap->_head;
|
|
local_8 = 1;
|
|
local_1c = 0;
|
|
local_20 = bestiaryMap;
|
|
newNode = operator_new(0x18);
|
|
local_8 = 0xffffffff;
|
|
local_1c = 0;
|
|
newNode[4] = local_28;
|
|
newNode[5] = 0;
|
|
*newNode = node;
|
|
newNode[1] = node;
|
|
newNode[2] = node;
|
|
*GHIDRA_CAST<uint16_t *>((newNode + 3)) = 0;
|
|
node = (GHIDRA_CAST<msvc::_Tree *>((bestiaryMap)))->msvc::_Tree::_Insert_node(insertParent,insertSide,newNode);
|
|
uVar2 = i;
|
|
}
|
|
i = uVar2 + 1;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(node) + 0x14)) = local_24;
|
|
} while (i < data);
|
|
}
|
|
(**(code **)(*piVar1 + 0xc))(0,2);
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|