XML data layer: pugixml (external/pugixml, v1.15), a format-neutral DataNode API for every loader, DataFormat=auto|json|xml (default xml), KAGE's archive file system ported (index once, four unpackers, the original's mount order) so --resources can point at an install's resources/ with no import step, the original XML .anm2 loader beside Anm2Ed JSON, mods' own XML; 72 goldens identical from converted resources and from the install

This commit is contained in:
shweet committed 2026-11-24 05:57:54 -05:00
1 parent 74322af121
commit 6d8a43775d
52 files changed
+1513 -909

No files matched your search

-133
View File
@@ -312,92 +312,6 @@ LAB_00a16b36:
} while( true );
}
// 00a16c60
uint32_t FileSystem::find_mount(uint8_t *param_1, uint8_t *param_2)
{
int iVar1;
uint64_t qVar2;
uint8_t bVar3;
uint8_t *normalizedPath;
uint8_t *archivePath;
int *entry;
int in_ECX;
uint64_t *allocatedBytes;
int mountIndex;
uint8_t hashIter [8];
int hashNode;
int fileSystem;
void *local_10;
uint8_t *puStack_c;
uint32_t local_8;
uint32_t blockSize;
local_8 = 0xffffffff;
puStack_c = &LAB_00b10fa0;
local_10 = ExceptionList;
ExceptionList = &local_10;
fileSystem = in_ECX;
normalizedPath = path_join(param_1,GHIDRA_CAST<uint8_t *>(0x0),0,0);
mountIndex = (*GHIDRA_CAST<int *>((in_ECX + 0xc)) - *GHIDRA_CAST<int *>((in_ECX + 8)) >> 2) + -1;
if (-1 < mountIndex) {
while( true ) {
if (DAT_00c37b14 != 0) {
archivePath = path_join(normalizedPath,
*GHIDRA_CAST<uint8_t **>((*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((in_ECX + 8)) + mountIndex * 4)) + 0xc)),0,
0);
bVar3 = open_archive_file(&PTR_vftable_00c37a10,archivePath,(void **)0x0);
param_1 = GHIDRA_CAST<uint8_t *>(CONCAT13(bVar3,(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(param_1)) + 0x0)))));
if (archivePath != GHIDRA_CAST<uint8_t *>(0x0)) {
operator_delete(archivePath,1);
bVar3 = (*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(param_1)) + 0x3)));
}
if (bVar3 != 0) {
iVar1 = *GHIDRA_CAST<int *>((fileSystem + 8));
*param_2 = 1;
ExceptionList = local_10;
return *GHIDRA_CAST<uint32_t *>((iVar1 + mountIndex * 4));
}
in_ECX = fileSystem;
}
iVar1 = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((in_ECX + 8)) + mountIndex * 4));
param_1 = GHIDRA_CAST<uint8_t *>(KAGE_Filesys_FileManager)::GetPrimaryFilePathHash(normalizedPath);
_Find_lower_bound<>(hashIter,&param_1);
if (((*GHIDRA_CAST<char *>((hashNode + 0xd)) == '\0') && (*GHIDRA_CAST<uint8_t **>((hashNode + 0x10)) <= param_1)) &&
(hashNode != *GHIDRA_CAST<int *>((iVar1 + 4)))) {
entry = map_find_value((void *)(iVar1 + 4),GHIDRA_UINT(&param_1));
if (*entry != 0) {
if (normalizedPath != GHIDRA_CAST<uint8_t *>(0x0)) {
local_8 = 0;
tracked_alloc(1,normalizedPath,0);
}
*param_2 = 0;
ExceptionList = local_10;
return *GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>((fileSystem + 8)) + mountIndex * 4));
}
}
mountIndex = mountIndex + -1;
if (mountIndex < 0) break;
in_ECX = fileSystem;
}
}
if (normalizedPath != GHIDRA_CAST<uint8_t *>(0x0)) {
if (g_mainHeap == (void *)0x0) {
allocatedBytes = &g_allocatedBytesNoHeap;
}
else {
allocatedBytes = GHIDRA_CAST<uint64_t *>((GHIDRA_INT(g_mainHeap) + 0x30));
}
blockSize = *GHIDRA_CAST<uint32_t *>((normalizedPath + -4));
qVar2 = *allocatedBytes;
*GHIDRA_CAST<uint32_t *>(allocatedBytes) = GHIDRA_UINT(*allocatedBytes) - blockSize;
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocatedBytes) + 4)) =
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocatedBytes) + 4)) - GHIDRA_UINT((GHIDRA_UINT(qVar2) < blockSize));
free(normalizedPath + -4);
}
ExceptionList = local_10;
return 0;
}
// 00a17180
uint8_t * FileSystem::ResolvePath(uint8_t *path)
{
@@ -456,53 +370,6 @@ uint8_t * FileSystem::ResolvePath(uint8_t *path)
return pbVar1;
}
// 00a178d0
void * FileSystem::Open(uint8_t *path, int *outResolvedPath)
{
uint8_t *resolvedPath;
void *this_00;
void *local_10;
uint8_t *puStack_c;
int *local_8;
resolvedPath = path;
local_8 = GHIDRA_CAST<int *>(0xffffffff);
puStack_c = &LAB_00af0b60;
local_10 = ExceptionList;
if ((path == GHIDRA_CAST<uint8_t *>(0x0)) || (*path == 0)) {
return (void *)0x0;
}
path = GHIDRA_CAST<uint8_t *>(0x0);
ExceptionList = &local_10;
resolvedPath = ResolvePath(resolvedPath);
open_archive_file(this,resolvedPath,&path);
if (path == GHIDRA_CAST<uint8_t *>(0x0)) {
open_disk_file(this_00,resolvedPath,&path);
if (outResolvedPath == GHIDRA_CAST<int *>(0x0)) {
if (resolvedPath == GHIDRA_CAST<uint8_t *>(0x0)) {
ExceptionList = local_10;
return path;
}
local_8 = GHIDRA_CAST<int *>(0x1);
LAB_00a1795c:
tracked_alloc(1,resolvedPath,0);
ExceptionList = local_10;
return path;
}
}
else if (outResolvedPath == GHIDRA_CAST<int *>(0x0)) {
if (resolvedPath == GHIDRA_CAST<uint8_t *>(0x0)) {
ExceptionList = local_10;
return path;
}
local_8 = outResolvedPath;
goto LAB_00a1795c;
}
*outResolvedPath = GHIDRA_INT(resolvedPath);
ExceptionList = local_10;
return path;
}
// 00a17ea0
uint8_t FileSystem::open_disk_file(uint8_t *path, void **outFile)
{