mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Implemented support for export module entry size 5
This commit is contained in:
parent
2f39c8ca41
commit
f0fc6178da
1 changed files with 7 additions and 4 deletions
|
@ -704,7 +704,9 @@ Module *__KernelLoadELFFromPtr(const u8 *ptr, u32 loadAddress, std::string *erro
|
||||||
u8 vcount;
|
u8 vcount;
|
||||||
u16_le fcount;
|
u16_le fcount;
|
||||||
u32_le resident;
|
u32_le resident;
|
||||||
u32_le extra;
|
u16_le vcountNew;
|
||||||
|
u8 unknown1;
|
||||||
|
u8 unknown2;
|
||||||
};
|
};
|
||||||
|
|
||||||
u32_le *entPos = (u32_le *)Memory::GetPointer(modinfo->libent);
|
u32_le *entPos = (u32_le *)Memory::GetPointer(modinfo->libent);
|
||||||
|
@ -718,6 +720,7 @@ Module *__KernelLoadELFFromPtr(const u8 *ptr, u32 loadAddress, std::string *erro
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
u32_le variableCount = ent->size == 4 ? ent->vcount : ent->vcountNew;
|
||||||
const char *name;
|
const char *name;
|
||||||
if (Memory::IsValidAddress(ent->name)) {
|
if (Memory::IsValidAddress(ent->name)) {
|
||||||
name = Memory::GetCharPointer(ent->name);
|
name = Memory::GetCharPointer(ent->name);
|
||||||
|
@ -737,10 +740,10 @@ Module *__KernelLoadELFFromPtr(const u8 *ptr, u32 loadAddress, std::string *erro
|
||||||
}
|
}
|
||||||
|
|
||||||
u32_le *residentPtr = (u32_le *)Memory::GetPointer(ent->resident);
|
u32_le *residentPtr = (u32_le *)Memory::GetPointer(ent->resident);
|
||||||
u32_le *exportPtr = residentPtr + ent->fcount + ent->vcount;
|
u32_le *exportPtr = residentPtr + ent->fcount + variableCount;
|
||||||
|
|
||||||
if (ent->size != 4) {
|
if (ent->size != 4) {
|
||||||
WARN_LOG_REPORT(LOADER, "Unexpected export module entry size %d, extra=%08x", ent->size, ent->extra);
|
WARN_LOG_REPORT(LOADER, "Unexpected export module entry size %d, vcountNew=%08x, unknown1=%08x, unknown2=&08x", ent->size, ent->vcountNew, ent->unknow1, ent->unknown2);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (u32 j = 0; j < ent->fcount; j++) {
|
for (u32 j = 0; j < ent->fcount; j++) {
|
||||||
|
@ -768,7 +771,7 @@ Module *__KernelLoadELFFromPtr(const u8 *ptr, u32 loadAddress, std::string *erro
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (u32 j = 0; j < ent->vcount; j++) {
|
for (u32 j = 0; j < variableCount; j++) {
|
||||||
u32 nid = residentPtr[ent->fcount + j];
|
u32 nid = residentPtr[ent->fcount + j];
|
||||||
u32 exportAddr = exportPtr[ent->fcount + j];
|
u32 exportAddr = exportPtr[ent->fcount + j];
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue