 |
forums.ps2dev.org Homebrew PS2, PSP & PS3 Development Discussions
|
| View previous topic :: View next topic |
| Author |
Message |
TheBuzzer
Joined: 06 Feb 2006 Posts: 49
|
Posted: Tue Aug 08, 2006 9:49 am Post subject: [resolved] reboot psp in 2.71? |
|
|
woot it works.
the stub method works!
it was using that
scePower_driver_0442D852 still to reboot.
thx for the help.
Last edited by TheBuzzer on Wed Aug 09, 2006 10:40 am; edited 2 times in total |
|
| Back to top |
|
 |
jas0nuk
Joined: 27 Apr 2006 Posts: 137
|
Posted: Wed Aug 09, 2006 12:10 am Post subject: |
|
|
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[i] == 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. |
|
| Back to top |
|
 |
TheBuzzer
Joined: 06 Feb 2006 Posts: 49
|
Posted: Wed Aug 09, 2006 8:52 am Post subject: |
|
|
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
Last edited by TheBuzzer on Wed Aug 09, 2006 9:21 am; edited 1 time in total |
|
| Back to top |
|
 |
TheBuzzer
Joined: 06 Feb 2006 Posts: 49
|
Posted: Wed Aug 09, 2006 8:56 am Post subject: |
|
|
btw for the .s file
i dont get where the numbers come from for the
STUB_START "sceUtility_netparam_internal",0x40010000,0x00040005
i understand the other numbers but not the first 2 |
|
| Back to top |
|
 |
TheBuzzer
Joined: 06 Feb 2006 Posts: 49
|
Posted: Wed Aug 09, 2006 9:35 am Post subject: |
|
|
woot it works.
the stub method works!
it was using that
scePower_driver_0442D852 still to reboot.
thx for the help. |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|