diff options
Diffstat (limited to 'src/vita/vita.cpp')
| -rw-r--r-- | src/vita/vita.cpp | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/src/vita/vita.cpp b/src/vita/vita.cpp new file mode 100644 index 0000000..2707732 --- /dev/null +++ b/src/vita/vita.cpp @@ -0,0 +1,55 @@ + +#include "../elf_common/elf_reader.h" +#include "psp2_loader.h" +#include "sce.h" + +#include <idaldr.h> +#include <memory> + +static int idaapi + accept_file(linput_t *li, char fileformatname[MAX_FILE_FORMAT_NAME], int n) +{ + if (n > 0) + return 0; + + elf_reader<elf32> elf(li); + + if (elf.verifyHeader() && + elf.machine() == EM_ARM) { + const char *type; + + if (elf.type() == ET_SCE_EXEC) + type = "Executable"; + else if (elf.type() == ET_SCE_RELEXEC) + type = "Relocatable Executable"; + else + return 0; + + set_processor_type("ARM", SETPROC_ALL); + + qsnprintf(fileformatname, MAX_FILE_FORMAT_NAME, "Playstation Vita %s", type); + + return ACCEPT_FIRST | 1; + } + + return 0; +} + +static void idaapi + load_file(linput_t *li, ushort neflags, const char *fileformatname) +{ + elf_reader<elf32> elf(li); elf.read(); + psp2_loader ldr(&elf, "vita.txt"); ldr.apply(); +} + +__declspec(dllexport) +loader_t LDSC = +{ + IDP_INTERFACE_VERSION, + 0, + accept_file, + load_file, + NULL, + NULL, + NULL +};
\ No newline at end of file |
