diff options
| author | Crementif <26669564+Crementif@users.noreply.github.com> | 2026-05-21 23:27:58 +0200 |
|---|---|---|
| committer | Crementif <26669564+Crementif@users.noreply.github.com> | 2026-05-22 00:52:12 +0200 |
| commit | f78b28db5b3d1a9387bd18b1f2efe15b6d09dcb4 (patch) | |
| tree | 47370fa6044f5dd138f6a8344745ed8070968b9e /src/wiiu/wiiu.cpp | |
| parent | 283dd15c854eaf1ae8b967305050775183f30754 (diff) | |
Add RPX/RPL relocation support and improve overall accuracy
Diffstat (limited to 'src/wiiu/wiiu.cpp')
| -rw-r--r-- | src/wiiu/wiiu.cpp | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/src/wiiu/wiiu.cpp b/src/wiiu/wiiu.cpp index 41ac110..fbf0802 100644 --- a/src/wiiu/wiiu.cpp +++ b/src/wiiu/wiiu.cpp @@ -9,7 +9,11 @@ accept_file(qstring *fileformatname, qstring *processor, linput_t *li, const cha elf_reader<elf32> elf(li); if (elf.verifyHeader()) { - if (elf.type() == ELF_FILETYPE_CAFE_RPL) + if (elf.type() == ELF_FILETYPE_CAFE_RPL + && elf.machine() == EM_PPC + && elf.osabi() == ELF_IDENT_OS_CAFE + && elf.bitsize() == ELFCLASS32 + && elf.endian() == ELFDATA2MSB) { *processor = "ppc"; *fileformatname = "WII U RPX/RPL"; @@ -25,11 +29,22 @@ static void idaapi load_file(linput_t *li, ushort /*neflags*/, const char * /*fileformatname*/) { set_processor_type("ppc", SETPROC_LOADER); + inf_set_app_bitness(32); + inf_set_be(true); + inf_set_wide_high_byte_first(true); elf_reader<elf32> elf(li); elf.read(); - cafe_loader ldr(&elf); ldr.apply(); + cafe_loader ldr(&elf); + ldr.apply(); + + if (elf.entry() != 0) + { + inf_set_start_ea(elf.entry()); + add_entry(elf.entry(), elf.entry(), "start", true); + auto_make_proc(elf.entry()); + } } #ifdef _WIN32 |
