woot it works.
the stub method works!
it was using that
scePower_driver_0442D852 still to reboot.
thx for the help.
[resolved] reboot psp in 2.71?
[resolved] reboot psp in 2.71?
Last edited by TheBuzzer on Wed Aug 09, 2006 10:40 am, edited 2 times in total.
static u32 FindProc(const char* szMod, const char* szLib, u32 nid)
{
SceModule* modP = sceKernelFindModuleByName(szMod);
if (modP == NULL)
{
printf("Failed to find mod '%s'\n", szMod);
return 0;
}
SceLibraryEntryTable* entP = (SceLibraryEntryTable*)modP->ent_top;
while ((u32)entP < ((u32)modP->ent_top + modP->ent_size))
{
if (entP->libname != NULL && strcmp(entP->libname, szLib) == 0)
{
// found lib
int i;
int count = entP->stubcount + entP->vstubcount;
u32* nidtable = (u32*)entP->entrytable;
for (i = 0; i < count; i++)
{
if (nidtable == nid)
{
u32 procAddr = nidtable[count+i];
// printf("entry found: '%s' '%s' = $%x\n", szMod, szLib, (int)procAddr);
return procAddr;
}
}
printf("Found mod '%s' and lib '%s' but not nid=$%x\n", szMod, szLib, nid);
return 0;
}
entP++;
}
printf("Found mod '%s' but not lib '%s'\n", szMod, szLib);
return 0;
}
static void doreboot(void)
{
int (* reboot) (int);
reboot = (void *)FindProc("scePower_Service", "scePower_driver", 0x79DB9421);
reboot();
}
Then call with doreboot();
There is a better way of doing this, that is by adding the stub file with the function to your code. See this topic.
{
SceModule* modP = sceKernelFindModuleByName(szMod);
if (modP == NULL)
{
printf("Failed to find mod '%s'\n", szMod);
return 0;
}
SceLibraryEntryTable* entP = (SceLibraryEntryTable*)modP->ent_top;
while ((u32)entP < ((u32)modP->ent_top + modP->ent_size))
{
if (entP->libname != NULL && strcmp(entP->libname, szLib) == 0)
{
// found lib
int i;
int count = entP->stubcount + entP->vstubcount;
u32* nidtable = (u32*)entP->entrytable;
for (i = 0; i < count; i++)
{
if (nidtable == nid)
{
u32 procAddr = nidtable[count+i];
// printf("entry found: '%s' '%s' = $%x\n", szMod, szLib, (int)procAddr);
return procAddr;
}
}
printf("Found mod '%s' and lib '%s' but not nid=$%x\n", szMod, szLib, nid);
return 0;
}
entP++;
}
printf("Found mod '%s' but not lib '%s'\n", szMod, szLib);
return 0;
}
static void doreboot(void)
{
int (* reboot) (int);
reboot = (void *)FindProc("scePower_Service", "scePower_driver", 0x79DB9421);
reboot();
}
Then call with doreboot();
There is a better way of doing this, that is by adding the stub file with the function to your code. See this topic.
i tried that already but it does not reboot
also that had a error i tried
static void doreboot(void)
{
int (* reboot) (int);
reboot = (void *)FindProc("scePower_Service", "scePower_driver", 0x79DB9421);
reboot(0);
}
also
static void doreboot(void)
{
void (* reboot) (void);
reboot = (void *)FindProc("scePower_Service", "scePower_driver", 0x79DB9421);
reboot(0);
}
static void doreboot(int)
{
int (* reboot) (int);
reboot = (void *)FindProc("scePower_Service", "scePower_driver", 0x79DB9421);
reboot(0);
}
all did nothing :/
my psp crashes when i try to use this
also that had a error i tried
static void doreboot(void)
{
int (* reboot) (int);
reboot = (void *)FindProc("scePower_Service", "scePower_driver", 0x79DB9421);
reboot(0);
}
also
static void doreboot(void)
{
void (* reboot) (void);
reboot = (void *)FindProc("scePower_Service", "scePower_driver", 0x79DB9421);
reboot(0);
}
static void doreboot(int)
{
int (* reboot) (int);
reboot = (void *)FindProc("scePower_Service", "scePower_driver", 0x79DB9421);
reboot(0);
}
all did nothing :/
my psp crashes when i try to use this
Last edited by TheBuzzer on Wed Aug 09, 2006 9:21 am, edited 1 time in total.