Code:#Editable Subroutine For MOHH2 ;credits to s1n [0x001bf714 0x0a3a00d4] = Do Not Change 0x00680350 0x3c08[First 4 Of Address (real addressing) ] 0x00680354 0x3c09[First 4 Of Hex Value] 0x00680358 0x2529[Last 4 Of Hex Value] 0x0068035c 0xad09[Last 4 Of Address (real addressing) ] 0x00680360 [0x03e00008] = Do Not Change Feel free to change the addresses (0x00680350+) if you are already using a subroutine using those addresses
=How to Make A Subroutine using Ps2Dis=
Step 1Get a Ram Dump of your game. Today we're using MOHH2.Step 2Open Up Ps2Dis and load your dump and set the address table at 08e80000.
This is how it should look like -
Code:Load From - 00000000 Address From - 08e80000Step 3Now We need to find the Code Cave. A code cave is simply a big bunch of zeros. To find the code cave we do this.
Press Ctrl + F and a box should pop up. Hold 0 for about 7-10 seconds and stop. Check the "Hex String" box and hit enter.
Now you should see lots off addresses and the values will all be 0x00000000 and the command will be "nop"Step 4Now minimize Ps2Dis and get a code that you want to make a subroutine of. Convert it to real format by adding 88000000 with a hex calculator. Now once you have your address in real format (do not convert hex into real ; leave hex as it is throughout the guide ; do not do anything to the hex) paste it into notepad alongside with your hex. Ill just use "See Thru Walls".
Code:#See Through Walls 0x00355CAC 0x3c05F000 in Fake formatCode:#see through walls 0x08B55CAC 0x3c05f000 in Real formatStep 5Now double click anywhere on a line and a box should pop up saying
Address [XXXXXXXX] Data [XXXXXXXX]
Label [___________________________________]
Comment [_____________________________________]
Command[nop___________________]Step 6Ignore Everything except the Command box. Change the "nop" command to "lui t0 $[first 4 of code address]".
So this would be mine -
If the 2nd half of the address is bigger than 8000 then we add 1 to the command. That is why instead of 08b5 it is 08b6Code:lui t0 $08b6Step 7Now go to the next one after that line. Double click it and change the command to "lui t1 $[first 4 of hex value]"
So this would be mine
Code:lui t1 $3c05Step 8Now it gets a little tricky.But dont stop now! It's fairly easy if you have good eyes.
Double Click the next line and change the command to "addiu t1 t1 $[Last 4 of hex value]"
So this would be mine -
Code:addiu t1 t1 $f000Step 9Now its a little more tricky than the last. This part is very important.
Double Click the next line and change the command to "sw t1 $[last 4 of code address](t0)"
So this would be mine -
[b] MAKE SURE YOU ADD (t0) WITH THE BRACKETS AFTER THE 4 NUMBERS!!!DO NOT PUT A SPACE BETWEEN $xxxx AND (t0) !!!Code:sw t1 $5CAC(t0)[quote] This part is probably the easiest of the steps.Step 10
Double click the next line and change the command to "jr ra"
So this would be mine -
That simple?Code:jr ra
Now we are almost done!
All we need to is add a hook! The hook for MOHH2 is "0x001bf714" Now We need to add a value for the hook. We can find the value by double clicking the line after the jr ra and adding this command "J $[the first address of the subroutine ( the address that you started the subroutine on) ]
So this is how mine would be
because i started my subroutine at 08e8254Code:J $08e8254
Now a value should come up on the line taht you entered the "J" command on.
Copy that value and paste it into notepad beside your Hook address.
This is how mine looks -
The First Address is the Hook and the value beside it is the Jump value.Code:0x001bf714 0x0a3a0095
Now copy ALL your subroutine addresses and paste em into notepad. Convert em into fake by subtracting 8800000. DO NOT SUBTRACT THE VALUES!!!
So this is my code
#See Though Walls Subroutine
;subroutined by s1n
0x001bf714 0x0a3a0095
0x00680254 0x3c0808b6
0x00680258 0x3c093c05
0x0068025c 0x2529f000
0x00680260 0xad095cac
0x00680264 0x03e00008
========================================
================Thanks==================
========================================
Thanks goes to Sly Xcross for his template and advice about the "addiu t1 t1 $xxxx".
Thanks also to MJKT for helping me with the template and giving me help with "ori t1 t1 $xxxx
The Hook for Mohh2 is below so if you want it and you have not read the guide...
MOHH2 Hook = 0x001bf714