Begginners Guide- made for begginers by begginers
Credit - MJKT
Ok today im going to teach you how to turn a normal one line code into a subrotine using a computer program called ps2dis.
Once you learn how to do this you can start to learn jokers and other cool codes('jocolor')
Ok so first what we need is :
-PS2DIS
-A Ram Dump of your game (eg. mohh2)
-one line code converted to real addressing (eg. mohh2 flash)
-----------------
ok before you open ps2dis you need a ram dump of the game your making a Subrotine for.
so go to the game open up nitpr and scroll along to options and you will see this:
Dump ram to slot #0 <--------
click it and it will make a ram dump of your game in the root of your memory stick.
we will need it lator so dont delete it.
----------
next we NEED to convert our codes address to real addressing.
we do this so when we type the bits we need into ps2dis your subrotine will work.
so to convert to real address we just need to Add 8800000 to our normal nitepr code using a hex calculator.
hex calculator:
http://www.squarebox.co.uk/hcalc.htmleg.
here my code
#FLASH
0x0016ADC0 0x3C044080
now type in your address into the calculator and add 8800000
16ADC0 + 8800000 = 896ADC0
so heres our code in real addressing
0896ADC0
(plus a zero on the front so it is 8 didgets)
---------------------------------------------------
---------------------------------------------------
OK WE HAVE EVERYTHING WE NEED SO LETS BEGIN
1.Plug you psp into your computer and put your ram dump file on your computer.
2.Click on ps2dis and it will open.
3. click and drag your Ram dump file into ps2dis and it will say this:
load from 000000000
address from 000000000
now change the address from to 08e80000
load from 0000000000
address from 08e8000000
and click ok....
4.Now we need to find the NOP part of a your Ram dump.
now NOP is an area of zeros in ps2dis.
to get the NOP are press Ctrl F and a new box will appear
saying "find String"
now tick the little box that says "as hex string"
and in the typing box just type in lots and lots of zeros
"000000000000000000000000000000000000000000000000000000000000000000000000"
just hold down the zero button "0" for about 10 seconds.
you should now have a bit in ps2dis where all you can see as values is 0 or NOP
eg.
0x??????? 000000000 nop
0x??????? 000000000 nop
0x??????? 000000000 nop
0x??????? 000000000 nop
0x??????? 000000000 nop
------------------
5.Ok so now we can start writing our subrotine using this template
lui t0 $[First Half Of Address + 1 If Second Half Is 8000 Or More]
lui t1 $[First half Of Hex]
ori t1 t1 $[Second Half Of Hex]
sw t1 $[Second Half Of Address](t0)
JR RA
you confused what to do?
OK so
this is my flash code in real addressing
0896ADC0
when it says first half of a code i means it like, this
0896 ADC0
first half of address is 0896
second half of address is ADC0
you do this with hex value aswell
first half hex value 3c04
2nd half hex value is 4080
-----------------------------
OK so now double click on the first NOP fo the first line.
a box will come up.
there is a mini box called Command. it will have "nop" written in it like this:
Command : nop
now take the first part of our template:
lui t0 $[First Half Of Address + 1 If Second Half Is 8000 Or More]
and replace where it says
Command : nop
to
Command : lui t0 $
(you dont need the brackets)
now it wants us to put our first half of address in there so go ahead and put in it
eg
Command : lui t0 $0896.
that is our first line of the code!!! (but we will be coming back to this line in a minute)
-------------------------------
OK time for the second line and 2nd line of template.
lui t1 $[First half Of Hex]
ok so click on the next nop down and change the command to this.
Command : lui t1 $
now it wants us to put in the fist half of the hex value.
mine is 3C04 so it would look like this.
Command: lui t1 $3c04
click ok.
------------------
the 3rd line.
template for this line is
ori t1 t1 $[Second Half Of Hex]
so replace the command as "ori t1 t1 $ " like we did in the other lines.
my second half of my hex value is 4080 so it would look like this
Command : ori t1 t1 $4080.
get it now?
-----------------
now this is the 4th line and is inportant to look at.
the template
sw t1 $[Second Half Of Address](t0)
now we just do the same as we did before but we keep the (t0) there...
so mine looks like this
Command: sw t1 $ADC0(t0)
now going back to the first line of my code.
in the first line of the template it said
lui t0 $[First Half Of Address + 1 If Second Half Is 8000 Or More]
now look at the (+ 1 if second half is more then 8000)
now back to my code in real addressing.
first half
0896
second half
ADC0
now the second part is higer then 8000 istn it.
ADCO is bigger then 8000
(if your code is different you wont need to do this)
so what we need to do is add 1 to the end of the first half or the address
so 0896 becomes 0897.
UNDERSTAND?
if the second half is more then 8000 then you msut plus 1 to the first half for it to work.
------
now the last line of you code is the JR RA
this is easy so just replace the NOP with a jr ra.
so like this:
Command:jr ra
-----------
THERE!!!--NOW YOU HAVE NEARLY FINISHED YOUR SUBROTINE
-----------
ok now copy those lines you just did down and make sure you save them!!!!
now remember we added 8800000 to make our code real addressing?
we need to now convert are addresses back to fake/nitepr format addressing.
so just take away 8800000 from the address in th hex calculator
eg 08e80244 - 8800000 = 680244.
so your code goes from
EG.
0x08e80244 0x?????????
0x08e80248 0x?????????
0x08e8024c 0x?????????
to
0x00680244 0x?????????
0x00680248 0x?????????
0x0068024c 0x?????????
-----------------------------
my code looks like this (without hook):
#MOHH2 FLASH WITHOUT HOOK
0x00680244 0x3C080897
0x00680248 0x3C093C04
0x0068024C 0x35294080
0x00680250 0xAD09ADC0
0x00680254 0x03E00008
WE ARE SO NEARLY FINSIHED ALL WE NEED NOW IS A HOOK added to our SUB and its done!!
link to hook guide comming soon:
hope this guide helped and i wont have to explain myself again lol!
credit: MJKT