Passing arguments to another .DOL? November 27, 2010 08:02PM | Registered: 13 years ago Posts: 27 |
Quote
struct __argv dolArgv;
bzero(&dolArgv, sizeof(dolArgv));
dolArgv.argvMagic = ARGV_MAGIC;
dolArgv.length = strlen(filename) + 2;
dolArgv.commandLine = malloc(dolArgv.length);
if (!dolArgv.commandLine)
{
init_video_and_wpad();
printf("Error creating arguments, could not allocate memory for commandLine\n");
printf("Press any button to reboot Wii...\n");
press_button_to_reboot();
}
strcpy(dolArgv.commandLine, filename);
dolArgv.commandLine[dolArgv.length - 1] = '\x00';
dolArgv.argc = 1;
dolArgv.argv = &(dolArgv.commandLine);
dolArgv.endARGV = dolArgv.argv + 1;
run_dol(myBuffer, &dolArgv);
Re: Passing arguments to another .DOL? November 27, 2010 08:05PM | Registered: 13 years ago Posts: 2 |
struct __argv arg; arg.argvMagic = ARGV_MAGIC; arg.length = strlen(filename) + strlen(param1) + strlen(param2) + 5; arg.commandLine = malloc(arg.length); sprintf(arg.commandline, "%s\0%s\0%s\0\0\0");