Results 1 to 1 of 1
Thread: Makeing Simple Subroutines
06-12-2011, 02:25 PM #1
Makeing Simple Subroutines
Lesson 1 the simplest type of ssubroutine and mips I know.
Makeing a one code subroutine.
Code example I will be useing:
I will need a hook to get the subrountine working so here is a working hook
for mohh1 0x00339D78
Now I need to find a NOP area in the game im makeing the subroutine/joker for
here is a nop area in mohh1 0x00000610
so i make the commands to load the code.
here is how it will look
lui t0 $0896 // This is loading first half of code address. lui is used to load the first 16 its of a adderess/value. Note you have to add 0880. so 0895 is loaded in t0. Theres a negative rule in codeing so if its negative you have to add 1
lui t1 $C48C //This is loading the first half of the value in t1. does not need to add 0880
ori t1 t1 $1c0c //The MIP ori is loading the seconed half of code value in t1 and storeing it to t1 above. does not have to add 0880
sw t1 $c76c(t0) // stores the t1 which we loaded as the value and then storeing it back to t0
jr ra //ends our subroutine
so after your done with MIPS copy and paste in notepad
will look like this
now you subtract 08800000 from the addresses and add 0x to the address and value to put in NitePR format
Now we make a jump command to start our subroutine which would be j $08800610
because our subroutine will start at the address 08800610.
We copy the value and add it to the hook like this
0x00339D78 0x0A200184 <---Our hook with the J value
Now we add the code name and comments and we are done
NOTE: you will need ps2dis and a dump for your game..