예제 #1
0
파일: main.c 프로젝트: mikemow/rxTools
static _Noreturn void mainLoop()
{
	uint32_t pad;

	while (true) {
		pad = InputWait();
		if (pad & (BUTTON_DOWN | BUTTON_RIGHT | BUTTON_R1))
			MenuNextSelection();

		if (pad & (BUTTON_UP | BUTTON_LEFT | BUTTON_L1))
			MenuPrevSelection();

		if (pad & BUTTON_A) {
			OpenAnimation();
			MenuSelect();
		}

		if (pad & BUTTON_SELECT) {
			fadeOut();
			ShutDown();
		}

		MenuShow();
	}
}
예제 #2
0
void NandMenu(){
	f_mkdir ("nand");
	MenuInit(&NandOptions);
	MenuShow();

    while (true) {
        u32 pad_state = InputWait();
		if(pad_state & BUTTON_DOWN) MenuNextSelection();
		if(pad_state & BUTTON_UP)   MenuPrevSelection();
		if(pad_state & BUTTON_A)    MenuSelect();
		if(pad_state & BUTTON_B) 	break;
		TryScreenShot();
		MenuShow();
    }
}
예제 #3
0
파일: main.c 프로젝트: motezazer/rxTools
int main(){
	if (Initialize())
		while (1);

	//7.X Keys stuff
	File KeyFile;
	const char *keyfile = "/slot0x25KeyX.bin";
	if(FileOpen(&KeyFile, keyfile, 0)){
		uint8_t keyX[16];
		FileRead(&KeyFile, keyX, 16, 0);
		FileClose(&KeyFile);
		setup_aeskeyX(0x25, keyX);
	}else{
		if (sysver < 7) {
			ConsoleInit();
			ConsoleSetTitle(strings[STR_WARNING]);
			print(strings[STR_ERROR_OPENING], keyfile);
			print(strings[STR_WARNING_KEYFILE]);
			print(strings[STR_PRESS_BUTTON_ACTION], strings[STR_BUTTON_A], strings[STR_CONTINUE]);
			ConsoleShow();
			WaitForButton(BUTTON_A);
		}
	}

	//That's the Main Menu initialization, easy and cool
	OpenAnimation();
	MenuInit(&MainMenu);
	MenuShow();
	while (true) {
		uint32_t pad_state = InputWait();
		if (pad_state & (BUTTON_DOWN | BUTTON_RIGHT | BUTTON_R1)) MenuNextSelection(); //I try to support every theme style
		if (pad_state & (BUTTON_UP   | BUTTON_LEFT  | BUTTON_L1)) MenuPrevSelection();
		if (pad_state & BUTTON_A)    	{ OpenAnimation(); MenuSelect(); }
		if (pad_state & BUTTON_SELECT)	{ fadeOut(); ShutDown(); }
		if (pad_state & BUTTON_START)	{ fadeOut(); returnHomeMenu(); }
		TryScreenShot();
		MenuShow();
	}

	FSDeInit();
	return 0;
}
예제 #4
0
int main(){
	Initialize();
	DrawString(TOP_SCREEN, "SUPPORT THE ORIGINAL, NOT THE IMITATION!", 75, 240-10, GREY, BLACK);
	//7.X Keys stuff
	File KeyFile;
	if(FileOpen(&KeyFile, "/slot0x25KeyX.bin", 0)){
		u8 keyX[16];
		FileRead(&KeyFile, keyX, 16, 0);
		FileClose(&KeyFile);
		setup_aeskeyX(0x25, keyX);
		DrawString(TOP_SCREEN, " NewKeyX ", 0, 240-8, GREEN, BLACK);
	}else{
		if(GetSystemVersion() < 3){
			ConsoleInit();
			print("WARNING:\n\nCannot find slot0x25KeyX.bin.\nSome titles decryption will fail,\nand some some EmuNANDs will not boot.\n\nPress A to continue...\n");
			ConsoleShow();
			WaitForButton(BUTTON_A);
		}
		DrawString(TOP_SCREEN, " NewKeyX ", 0, 240-8, RED, BLACK);
	}
	DrawString(TOP_SCREEN, " EmuNAND ", 0, 240-16, checkEmuNAND() ? GREEN : RED, BLACK);

	//That's the Main Menu initialization, easy and cool
	MenuInit(&MainMenu);
	MenuShow();

    while (true) {
		DrawString(TOP_SCREEN,  "[SELECT] Reboot", 349-18*8, 181-24-8, RED, BLACK);
		DrawString(TOP_SCREEN,  "[START]  Shutdown", 349-18*8, 181-24, RED, BLACK);
        u32 pad_state = InputWait();
		if(pad_state & BUTTON_DOWN) 	MenuNextSelection();
		if(pad_state & BUTTON_UP)   	MenuPrevSelection();
		if(pad_state & BUTTON_A)    	MenuSelect();
		if(pad_state & BUTTON_SELECT)	returnHomeMenu();
		if(pad_state & BUTTON_START)	ShutDown();
		TryScreenShot();
		MenuShow();
    }

    FSDeInit();
    return 0;
}
예제 #5
0
파일: main.c 프로젝트: Golui/rxTools
int main(){
	Initialize();
	//7.X Keys stuff
	File KeyFile;
	if(FileOpen(&KeyFile, "/slot0x25KeyX.bin", 0)){
		u8 keyX[16];
		FileRead(&KeyFile, keyX, 16, 0);
		FileClose(&KeyFile);
		setup_aeskeyX(0x25, keyX);
	}else{
		if(GetSystemVersion() < 3){
			ConsoleInit();
			ConsoleSetTitle("          WARNING");
			print("WARNING:\n\nCannot find slot0x25KeyX.bin. If\nyour firmware version is less than\n7.X, some titles decryption will\nfail, and some EmuNANDs will not\nboot.\n\nPress A to continue...\n");
			ConsoleShow();
			WaitForButton(BUTTON_A);
		}
	}

	//That's the Main Menu initialization, easy and cool
	MenuInit(&MainMenu);
	MenuShow();

	while (true) {
		u32 pad_state = InputWait();
		if (pad_state & (BUTTON_DOWN | BUTTON_RIGHT | BUTTON_R1)) MenuNextSelection(); //I try to support every theme style
		if (pad_state & (BUTTON_UP   | BUTTON_LEFT  | BUTTON_L1)) MenuPrevSelection();
		if(pad_state & BUTTON_A)    	MenuSelect();
		if(pad_state & BUTTON_SELECT)	ShutDown();
		if(pad_state & BUTTON_START)	returnHomeMenu();
		TryScreenShot();
		MenuShow();
	}

	FSDeInit();
	return 0;
}
예제 #6
0
void restoreCoolFiles(){
    int nandtype = NandSwitch();
    if(nandtype == -1){
        return;
    }
    selectedFile = -1;
    MenuInit(&CoolFilesMenu);
    MenuShow();
    while (true) {
        u32 pad_state = InputWait();
		if(pad_state & BUTTON_DOWN) MenuNextSelection();
		if(pad_state & BUTTON_UP)   MenuPrevSelection();
		if(pad_state & BUTTON_A)    { MenuSelect(); break; }
		if(pad_state & BUTTON_B) 	break;
		TryScreenShot();
		MenuShow();
    }
    if(selectedFile == -1) return;
    ConsoleInit();
    ConsoleSetTitle("File Inject : %s", CoolFiles[selectedFile].name);
    char dest[256];
    sprintf(tmpstr, "rxTools/%s", CoolFiles[selectedFile].name);
    sprintf(dest, "%d:%s", nandtype + 1, CoolFiles[selectedFile].path);
    print("Injecting...\n"); ConsoleShow();
    int res = FileCopy(dest, tmpstr);
    char* showres;
    switch(res){
        case 1 : showres = "Success!"; break;
        case -1 : showres = "Cannot write to file!"; break;
        case -2 : showres = "Cannot read from file!"; break;
        default : showres = "Failure!"; break;
    }
    print(showres); print("\n");
    print("\nPress A to exit\n");
	ConsoleShow();
	WaitForButton(BUTTON_A);
}
예제 #7
0
void dumpCoolFiles()
{
	int nandtype = NandSwitch();
	if (nandtype == UNK_NAND) return;

	selectedFile = -1;
	MenuInit(&CoolFilesMenu);
	MenuShow();

	while (true)
	{
		uint32_t pad_state = InputWait();
		if (pad_state & BUTTON_DOWN) MenuNextSelection();
		if (pad_state & BUTTON_UP) MenuPrevSelection();
		if (pad_state & BUTTON_A) { MenuSelect(); break; }
		if (pad_state & BUTTON_B) break;
		TryScreenShot();
		MenuShow();
	}

	if (selectedFile == -1) return;
	ConsoleInit();
	ConsoleSetTitle(strings[STR_DUMP], strings[STR_FILES]);

	char dest[256], tmpstr[sizeof(dest)];
	wchar_t wsrc[sizeof(tmpstr)];
	sprintf(dest, "rxTools/%s", CoolFiles[selectedFile].name);
	sprintf(tmpstr, "%d:%s/%s", nandtype, CoolFiles[selectedFile].path, CoolFiles[selectedFile].name);
	mbstowcs(wsrc, tmpstr, sizeof(tmpstr));
	print(strings[STR_DUMPING], wsrc, dest);
	ConsoleShow();

	unsigned int res = FSFileCopy(dest, tmpstr);
	if (res != 0 && (selectedFile == 1 || selectedFile == 2)){
		if (selectedFile == 1)
		{
			/* Fix for SecureInfo_B */
			sprintf(dest, "rxTools/%.11s%c", CoolFiles[selectedFile].name, 'B');
			sprintf(tmpstr, "%d:%s/%.11s%c", nandtype, CoolFiles[selectedFile].path, CoolFiles[selectedFile].name, 'B');
		}
		else if (selectedFile == 2)
		{
			/* Fix for LocalFriendCodeSeed_A */
			sprintf(dest, "rxTools/%.20s%c", CoolFiles[selectedFile].name, 'A');
			sprintf(tmpstr, "%d:%s/%.20s%c", nandtype, CoolFiles[selectedFile].path, CoolFiles[selectedFile].name, 'A');
		}
		mbstowcs(wsrc, tmpstr, sizeof(tmpstr));
		print(strings[STR_FAILED]);
		print(strings[STR_DUMPING], wsrc, dest);
		ConsoleShow();
		res = FSFileCopy(dest, tmpstr);
	}

	switch ((res >> 8) & 0xFF)
	{
		case 0:
			print(strings[STR_COMPLETED]);
			break;
		case 1:
			print(strings[STR_ERROR_OPENING], tmpstr);
			break;
		case 2:
			print(strings[STR_ERROR_CREATING], dest);
			break;
		case 3:
		case 4:
			print(strings[STR_ERROR_READING], tmpstr);
			break;
		case 5:
		case 6:
			print(strings[STR_ERROR_WRITING], dest);
			break;
		default:
			print(strings[STR_FAILED]);
			break;
	}

	print(strings[STR_PRESS_BUTTON_ACTION], strings[STR_BUTTON_A], strings[STR_CONTINUE]);
	ConsoleShow();
	WaitForButton(BUTTON_A);
}