--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>
90 lines
2.4 KiB
C++
90 lines
2.4 KiB
C++
#include "classes.h"
|
|
|
|
// 00a24fd0
|
|
void * SaveDataManager::open_file_read(uint8_t *fileName)
|
|
{
|
|
uint8_t bVar1;
|
|
uint32_t flags;
|
|
int *file;
|
|
uint8_t *pbVar2;
|
|
uint8_t isAppendSlash;
|
|
|
|
flags = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(this) + 4));
|
|
if ((flags & 1) == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("Save data manager has not been initialized\n"));
|
|
flags = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(this) + 4));
|
|
}
|
|
if ((flags & 2) == 0) {
|
|
return (void *)0x0;
|
|
}
|
|
file = operator_new(0x10);
|
|
if (file == GHIDRA_CAST<int *>(0x0)) {
|
|
file = GHIDRA_CAST<int *>(0x0);
|
|
}
|
|
else {
|
|
file[1] = 2;
|
|
file[2] = 0;
|
|
*file = GHIDRA_INT(KAGE)::Filesys::File::vftable;
|
|
file[3] = 0;
|
|
}
|
|
isAppendSlash = 0;
|
|
bVar1 = 0;
|
|
pbVar2 = GHIDRA_CAST<uint8_t *>((**(code **)(*GHIDRA_CAST<int *>(this) + 0x10))());
|
|
pbVar2 = path_join(fileName,pbVar2,bVar1,isAppendSlash);
|
|
if (*(code **)(*file + 0x24) == KAGE::Filesys::File::open) {
|
|
bVar1 = (GHIDRA_CAST<KAGE::Filesys::File *>((file)))->KAGE::Filesys::File::open(pbVar2);
|
|
}
|
|
else {
|
|
bVar1 = (**(code **)(*file + 0x24))();
|
|
}
|
|
if (bVar1 == 0) {
|
|
(**(code **)*file)(1);
|
|
file = GHIDRA_CAST<int *>(0x0);
|
|
}
|
|
if (pbVar2 != GHIDRA_CAST<uint8_t *>(0x0)) {
|
|
operator_delete(pbVar2,1);
|
|
}
|
|
return file;
|
|
}
|
|
|
|
// 00a25090
|
|
void * SaveDataManager::open_file_write(uint8_t *path, int mode)
|
|
{
|
|
char isOk;
|
|
uint32_t uVar1;
|
|
int *piVar2;
|
|
|
|
uVar1 = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(this) + 4));
|
|
if ((uVar1 & 1) == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("Save data manager has not been initialized\n"));
|
|
uVar1 = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(this) + 4));
|
|
}
|
|
if ((uVar1 & 2) != 0) {
|
|
isOk = FUN_00a25200(path);
|
|
if (isOk != '\0') {
|
|
piVar2 = operator_new(0x10);
|
|
if (piVar2 == GHIDRA_CAST<int *>(0x0)) {
|
|
piVar2 = GHIDRA_CAST<int *>(0x0);
|
|
}
|
|
else {
|
|
piVar2[1] = 2;
|
|
piVar2[2] = 0;
|
|
*piVar2 = GHIDRA_INT(KAGE)::Filesys::File::vftable;
|
|
piVar2[3] = 0;
|
|
}
|
|
if (*(code **)(*piVar2 + 0x28) == FUN_00a52610) {
|
|
isOk = FUN_00a52610(path,mode);
|
|
}
|
|
else {
|
|
isOk = (**(code **)(*piVar2 + 0x28))(path,mode);
|
|
}
|
|
if (isOk == '\0') {
|
|
(**(code **)*piVar2)(1);
|
|
piVar2 = GHIDRA_CAST<int *>(0x0);
|
|
}
|
|
return piVar2;
|
|
}
|
|
}
|
|
return (void *)0x0;
|
|
}
|