diff options
Diffstat (limited to 'src/wiiu/wiiu.cpp')
| -rw-r--r-- | src/wiiu/wiiu.cpp | 41 |
1 files changed, 18 insertions, 23 deletions
diff --git a/src/wiiu/wiiu.cpp b/src/wiiu/wiiu.cpp index 2588145..41ac110 100644 --- a/src/wiiu/wiiu.cpp +++ b/src/wiiu/wiiu.cpp @@ -4,19 +4,16 @@ #include <idaldr.h> static int idaapi - //accept_file(linput_t *li, char fileformatname[MAX_FILE_FORMAT_NAME], int n) - accept_file(qstring *fileformatname, qstring *processor, linput_t *li, const char *filename) -{ +accept_file(qstring *fileformatname, qstring *processor, linput_t *li, const char * /*filename*/) +{ elf_reader<elf32> elf(li); - if (elf.verifyHeader()) { - if (elf.type() == ELF_FILETYPE_CAFE_RPL) { - - //set_processor_type("ppc", SETPROC_ALL); - //qsnprintf(fileformatname, MAX_FILE_FORMAT_NAME, "WII U RPX/RPL"); - - *processor = "ppc"; + if (elf.verifyHeader()) + { + if (elf.type() == ELF_FILETYPE_CAFE_RPL) + { + *processor = "ppc"; *fileformatname = "WII U RPX/RPL"; - + return ACCEPT_FIRST | 1; } } @@ -25,28 +22,26 @@ static int idaapi } static void idaapi - load_file(linput_t *li, ushort neflags, const char *fileformatname) +load_file(linput_t *li, ushort /*neflags*/, const char * /*fileformatname*/) { set_processor_type("ppc", SETPROC_LOADER); - elf_reader<elf32> elf(li); elf.read(); - - ea_t relocAddr = 0; - if (neflags & NEF_MAN) { - ask_addr(&relocAddr, "Please specify a relocation address base."); - } - + elf_reader<elf32> elf(li); + elf.read(); + cafe_loader ldr(&elf); ldr.apply(); } +#ifdef _WIN32 +__declspec(dllexport) +#endif loader_t LDSC = { IDP_INTERFACE_VERSION, LDRF_REQ_PROC, accept_file, load_file, - NULL, - NULL, - NULL + nullptr, + nullptr, + nullptr }; - |
