Example #1
0
void gamePluginEntry() {
	u32 ret, key;
	INIT_SHARED_FUNC(plgGetIoBase, 8);
	// wait for game starts up (5 seconds)
	svc_sleepThread(5000000000);

	if (((NS_CONFIG*)(NS_CONFIGURE_ADDR))->sharedFunc[8]) {
		isNewNtr = 1;
	} else {
		isNewNtr = 0;
	}
	
	if (isNewNtr) {
		IoBasePad = plgGetIoBase(IO_BASE_PAD);
	}
	while (1) {
		svc_sleepThread(100000000);
		
		key = getKey();
		if (key == BUTTON_R) {
      u16 *id = (u16*)0x16F4C460;
      char id_str[5] = {0};
      for (size_t i = 0; i < 4u; ++i)
      {
        id_str[i] = (char)READU16(id + i);
      }
      
      u16 result = (u16)strtoul(id_str, NULL, 16);
      WRITEU16(0x15FBEDD0, result);
			waitKeyUp();
		}

	}
}
Example #2
0
void initSharedFunc() {

	INIT_SHARED_FUNC(showDbg, 0);
	INIT_SHARED_FUNC(nsDbgPrint, 1);
	INIT_SHARED_FUNC(plgRegisterMenuEntry, 2);
	INIT_SHARED_FUNC(plgGetSharedServiceHandle, 3);
	INIT_SHARED_FUNC(plgRequestMemory, 4);
	INIT_SHARED_FUNC(plgRegisterCallback, 5);
	INIT_SHARED_FUNC(xsprintf, 6);
	INIT_SHARED_FUNC(controlVideo, 7);
}
void gamePluginEntry()
{
	u32 ret, key;
	u32 i = 0;
	INIT_SHARED_FUNC(plgGetIoBase, 8);
	INIT_SHARED_FUNC(copyRemoteMemory, 9);
	svc_sleepThread(5000000000);
	
	mode = 0;
	if (((NS_CONFIG*)(NS_CONFIGURE_ADDR))->sharedFunc[8])
	{
		isNewNtr = 1;
	} 
	else
	{
		isNewNtr = 0;
	}
	
	if (isNewNtr)
	{
		IoBasePad = plgGetIoBase(IO_BASE_PAD);
	}
	rtReleaseLock(&((NS_CONFIG*)(NS_CONFIGURE_ADDR))->debugBufferLock);
	plgGetSharedServiceHandle("fs:USER", &fsUserHandle);
	updateMenu();
	current_menu = BASE;
	init_menu();
	create_base_menu();
	show_menu(BASE);
	while (1)
	{
		key = getKey();
		if (key == BUTTON_ST + BUTTON_SE)
		{
			show_menu(BASE);
			waitKeyUp();
		}
		key_trigger(key);
		svc_sleepThread(10000000);
		scanCheatMenu();
		do_all_action();		
	}
}