| View previous topic :: View next topic |
| Author |
Message |
Zer01ne
Joined: 08 Sep 2008 Posts: 29
|
Posted: Tue Jun 16, 2009 3:59 am Post subject: [HELP] Hooking sctrlSEGetVersion |
|
|
Hello i have a problem with hooking the function sctrlSEGetVersion
This is part of the hooking code :
| Code: |
int sctrlSEGetVersionPatched(int version)
{
return version;
}
u32 orgaddr[2];
void (* PatchSyscall)(u32 funcaddr, void *newfunc);
PatchSyscall = (void *)sctrlHENFindFunction("SystemControl", "SystemCtrlForKernel", 0x826668E9);
if (!PatchSyscall)
{
PatchSyscall = (void *)sctrlHENFindFunction("SystemControl", "SystemCtrlForKernel", 0x02BFCB5F);
if (!PatchSyscall){
asm("breakn");
return 1;
}
}
//Get sctrlSEGetVersion
orgaddr[0]=sctrlHENFindFunction("SystemControl", "SystemCtrlForKernel", 0xB47C9D77);
//Get sctrlSEGetVersion
orgaddr[1]=sctrlHENFindFunction("SystemControl", "SystemCtrlForUser", 0xB47C9D77);
//Patch sctrlSEGetVersion
PatchSyscall(orgaddr[0], sctrlSEGetVersionPatched);
//Patch sctrlSEGetVersion
PatchSyscall(orgaddr[1], sctrlSEGetVersionPatched);
sceKernelDcacheWritebackAll();
sceKernelIcacheClearAll();
|
The probleme is the hook is not exist do you have a solution ?
Sorry for my english |
|
| Back to top |
|
 |
Torch

Joined: 28 May 2008 Posts: 842
|
Posted: Tue Jun 16, 2009 11:43 pm Post subject: |
|
|
| Its not a syscall, it can't be hooked like that. You need to manually patch the original function to jump to your hook function. |
|
| Back to top |
|
 |
Zer01ne
Joined: 08 Sep 2008 Posts: 29
|
Posted: Fri Jun 19, 2009 6:40 am Post subject: |
|
|
| Torch you have a exemple ? i have tested all code finded on this forum but MAKE_JUMP patchJump and other nothing work !!! |
|
| Back to top |
|
 |
cory1492
Joined: 10 Dec 2004 Posts: 216
|
|
| Back to top |
|
 |
Zer01ne
Joined: 08 Sep 2008 Posts: 29
|
Posted: Fri Jun 19, 2009 10:39 am Post subject: |
|
|
| I have used search but this is dont work if possible sctrlSEGetVersion i cant be hooked ? |
|
| Back to top |
|
 |
kralyk
Joined: 06 Apr 2008 Posts: 114 Location: Czech Republic, central EU
|
Posted: Fri Jun 19, 2009 4:31 pm Post subject: |
|
|
I dont think so, I think more likely you made some error.
Does your module export the pathced function? It has to be exported... _________________ ...sorry for my english... |
|
| Back to top |
|
 |
cory1492
Joined: 10 Dec 2004 Posts: 216
|
Posted: Sat Jun 20, 2009 10:23 am Post subject: |
|
|
| Anything can be hooked, so long as you have permission for the memory region, you can find the function in memory, and are willing to deal with a little assembly/disassembly when pre-made methods don't work as expected. It's not like the PSP has a secure hypervisor clobbering executeable memory modifications... especially once you get HEN in there. |
|
| Back to top |
|
 |
|