Then its not a hook xD
Then its not a hook xD
Contact me if you want to play the EU version of SOCOM.
@People from the EU game: I dont hack. I sometimes hack back, but I am here to learn. If you are seeing this, then chances are you hack, sorry to those that dont ;)
I can spell SyKotik-KaNun :D
ok thx and I found out that the hooks stay the same on 5.50 gen d then they would be on gen b but I thought theyed change
As X-DuDe said 0000098 is a common one.
You know, there are others common hooks between 0x00000000 and 98.
I'm not talking of these : 0x00000024, -4C and -98.
Let's think about a function in MIPs, all functions usually end by a JR command (with RA as the register).
So it means the lines above JR command (in PS2Dis view) can be used to execute a MIPs code.
It's better for you to understand by showing you an example:
Here the functions starts at -2c and it ends at -4c.
So it means all the commands between -2c and -4c are ALWAYS executed (because this function is always executed in the game).
We can "create" new hooks by replacing nop commands with a J command witch points to a routine you wrote.
Why should we use a J command instead of using a JAL command ?
When I tired to put a JAL command, my PSP froze when I turned on the code in nitePR (whereas the routine works perfectly).
I don't know why, maybe my routine wasn't made correctly to be launched by using a JAL command but it works with a J command.
You have to put a nop command between each J command (1 nop after the J). The nop command is reserved to send a variable (loaded into a0, a1, a2 or a3) to the function (aka routine).
This IS NOT correct :
This IS correct :
You have to know something, when you "create" hooks by this way, your routine hasn't to finish by a JR (ra) command.
The last command has to be a J command which goes back to the function where your hook is. Be careful, it goes AFTER the hook you used for this routine (if it goes before, the function you used for hook will not be executed correctly and if you put a JR RA command as last routine command the MIPs code after the hook will not be executed, that's why we have to make a J command which goes back to function ...).
A little example :
My hook is 0x0000003C.
Let's imagine my routine and it starts at 0x00001500 :
lui t0 , $08D1
ori t0 , t0 , $A7D0
lw t2 , $0000(t0)
addiu t3 , t2 , $0001
sw t3 , $0000(t0)
My hook in nitePR looks like that :
0x0000003C 0x0A200540 ( J command $08801500 )
So my routine has to finish by this :
j $08800040 ( goes to 0x00000040, which is the next line after your hook )
Final code is :
#My Routine
0x00001500 0x3C0808D1
0x00001504 0x3508A7D0
0x00001508 0x8D0A0000
0x0000150C 0x254B0001
0x00001510 0xAD0B0000
0x00001514 0x0A200010
0x0000003C 0x0A200540
That works, THIS is the same thing that :
#My Routine
0x00001500 0x3C0808D1
0x00001504 0x3508A7D0
0x00001508 0x8D0A0000
0x0000150C 0x254B0001
0x00001510 0xAD0B0000
0x00001514 0x03E00008
0x0000004C 0x0A200540
The only drawback of this method is that you have to change the J command if you want to use it with another hook.
Last edited by Linblow; 11-16-2009 at 05:40 PM.
Bookmarks