25 #define ELF_MAGIC 0x464c457f
30 return (stat (filename, &
buffer) == 0);
40 int new_argc = argc + 1;
47 char *new_argv[new_argc];
49 new_argv[0] = (
char *)filename;
50 for (i = 0; i < argc; i++) {
51 new_argv[i + 1] = argv[i];
58 asm volatile(
"break\n");
63 for (i = 0; i < eh->
phnum; i++) {
67 pdata = (
void *)(boot_elf + eph[i].offset);
68 memcpy(eph[i].vaddr, pdata, eph[i].filesz);
70 if (eph[i].memsz > eph[i].filesz)
71 memset(eph[i].vaddr + eph[i].filesz, 0, eph[i].memsz - eph[i].filesz);
static bool file_exists(const char *filename)
int LoadELFFromFile(const char *filename, int argc, char *argv[])
void FlushCache(s32 operation)
s32 ExecPS2(void *entry, void *gp, int num_args, char *args[])