OSLink done (#2038)

This commit is contained in:
TakaRikka
2024-01-20 02:53:06 -08:00
committed by GitHub
parent 5ad3727d17
commit 49a4319fb8
14 changed files with 460 additions and 1188 deletions
+8 -8
View File
@@ -346,25 +346,25 @@ bool JUTException::searchPartialModule(u32 address, u32* module_id, u32* section
OSModuleInfo* module = *(OSModuleInfo**)0x800030C8;
while (module) {
OSSectionInfo* section = (OSSectionInfo*)module->info.sectionInfoOffset;
for (u32 i = 0; i < module->mNumSections; section = section + 1, i++) {
if (section->mSize) {
u32 addr = ALIGN_PREV(section->mOffset, 2);
if ((addr <= address) && (address < addr + section->mSize)) {
OSSectionInfo* section = (OSSectionInfo*)module->sectionInfoOffset;
for (u32 i = 0; i < module->numSections; section = section + 1, i++) {
if (section->size) {
u32 addr = ALIGN_PREV(section->offset, 2);
if ((addr <= address) && (address < addr + section->size)) {
if (module_id)
*module_id = module->mId;
*module_id = module->id;
if (section_id)
*section_id = i;
if (section_offset)
*section_offset = address - addr;
if (name_offset)
*name_offset = module->mModuleNameOffset;
*name_offset = module->nameOffset;
return true;
}
}
}
module = (OSModuleInfo*)module->mNext;
module = (OSModuleInfo*)module->link.next;
}
return false;