PSP Elites
Would you like to react to this message? Create an account in a few clicks or log in to continue.


PsP hacking and gaming site
 
HomePortalLatest imagesSearchRegisterLog in

 

 *NOOB PROOF* Subroutine Guide by TheEliteOne aka Crioshinx aka Jinzo X

Go down 
AuthorMessage
TheEliteOne

TheEliteOne


Posts : 72
Join date : 2009-10-25
Age : 31
Location : Earth

*NOOB PROOF* Subroutine Guide by TheEliteOne aka Crioshinx aka Jinzo X Empty
PostSubject: *NOOB PROOF* Subroutine Guide by TheEliteOne aka Crioshinx aka Jinzo X   *NOOB PROOF* Subroutine Guide by TheEliteOne aka Crioshinx aka Jinzo X Icon_minitimeFri Nov 13, 2009 7:14 pm

Guide Credit: Crioshinx aka TheEliteOne aka Jinzo X

You will need ps2dis.exe for this.

Subroutines use the programing language called MIPS, MIPS consists of commands and registers. Here is some info on bytes, you will need to know what they are:
8bit byte: 0x00000000 0x00 The zero in red only changes to: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, and F
16bit byte: 0x00000000 0x0000 The zero in red only changes to: 0, 2, 4, 6, 8, A, and C
32bit byte: 0x00000000 0x00000000 The zero in red only changes to: 0, 4, 8, and C
When i say 16bit or 32bit that refers to the hex values size, if i say Lui loads the first 16bits that means that it's the first four numbers.

Heres MIPS commands that I will be teaching you how to use:

LUI {LOAD UPPER IMMIDIATE}
ADDIU {ADD IMMIDIATE UNASUGNED WORD}
SW {STORE WORD}
NOP {NO OPERATION}

And you will be using the Temperary register, writen as tX, the X is a variable. It varies from 0-9. There is an alternitave to ADDIU, it is ORI {OR IMMIDIATE} but I like to include ADDIU in my guides because it requires the Negitive Hex Rule, so begeners will need to know that. Heres the 'rules' of MIPS that I will teach you:

Negitive Rule:
The 'Negitive Rule' is used when using these commands:
LQ {Load Quarter Word}
SQ {Store Quarter Word}
LH {Load Half Word}
SH {Store Half Word}
LW {Load Word}
SW {Store Word}
ADDIU {Add Immiadiate Unasigned Word}
I Beleive theres more but i haven't learned them yet, I will add them in once i do. If i say something about the negitive ruel then that means you need to add one to the first 16bits of something if the last 16bits is negitive, Positive: 0000 --- 7F80 / Negitive: 7F80 --- FFFF, once I say something about the negitive rule you will understand.

Real Addressing:
If your using the code's address, controller address, or pointer you need to use the real form of them. To do this open you calculator on your computer, click on the View drop down and select Scientific, then check the Hex bubble, now copy and paste your address/pointer into your calculator and add 8800000, the result is your real address.

Lets get to it:

1) Get your ram dump, launch the game you have a code you want to sub, go into a playable area in the game, open NitePR and go to the [PRX] menu and click "Dump Ram in Slot 0?" Now exit to the home menu and connect your PSP to your computer.

2) Open ps2dis.exe, now click on the File drop down and select Open, select your ram dump, it will be in the root of your memory stick.

3) A "Unknown Format" box will pop up, change the "Address From" to 08800000.

4) Now you need to find a blank area in the game where no codes can be found using NitePR, the reson we do this is so the subroutine wont effect any other value in the game. To do this press the "G" key and type the address you want to start your subroutine at, the limits are:

08800610 - 08804000

There are many many more blank areas in games, but this one is in all games and other blank areas i wont list because they might not be in the game your using. But you will have plenty of space there

5) Now your ready to start writing your subroutine, click on a line that has a NOP, that address is in real form right now but if you subtracted 08800000 then that address wont do anything in your game, that what NOPs are, nothing, so we want to Load the first 16bits of the address into your subroutine. So if you look at the commands I will be teaching you above only one says "Load" thats LUI {LOAD UPPER IMMIDIATE} so we are going to chnage the NOP to LUI, don't press enter yet, remember how i said we are using the temperary register which is tX, X is a variable, it ranges from 0-9, lets start with 0, the way we use registers is very simple, write your command then a space then the register then a space, then a "$" then your values, so i am using LUI and t0 so my first line would look like "LUI t0 $" then right after the "$" i would enter the first 16bits of my address, dont add a space or anything, also remember that this is the real address because ps2dis only uses real addressing. So if the first 16bits of my address are 1234 my command line for the first subroutine line in ps2dis would be "LUI t0 $1234" then click enter.

6) Go to the line right below that one, we are now loading the first half of the code's hex value, so we will be using LUI again, but we can use the same register becuase t0 already has something stored in it, so we have to use t1, the hex value dosn't need to be in real format. So if my hex value was 5678 my line would be "LUI t1 $5678" now press enter.

7) Go to the line right below that one, we are now going to be adding and storing the last 16bits of your code's hex value, so you will use ADDIU {ADD IMMIDIATE UNASIGNED WORD} which uses two registers instead of one, one to store data and another to add on to the first 16bits, we will be using the same register for the first 16bits and the last 16bits of the hex value sence ADDIU needs to add to that and store in in t1. If my last 16bits of my hex value was ABCD my command line should say "ADDIU t1 t1 $ABCD" But remember me saying something about the negitive rule, ADDIU uses it. So unless you want your subroutine to freeze we need to look at the last 16bits of the hex value, if there over 7F80 you need to add one to the first 16bits of the hex value. If the second half of my hex value realy was ABCD then i would have to add one to my first 16bits because ABCD is more than 7F80 right? So the first 16bits would have to be changed to "LUI t1 $5679" and the last 16bits line would be "ADDIU t1 t1 $ABCD". If the last 16bits are lower than 7F80 dont exicute the negitve rule.

8] Go to the line right below that one, now we need to store the last 16bits of the address with SW {STORE WORD}, we are going to be using t1 with this as well, so change 'nop' to "SW t1 $" and enter the last 16bits of your address, this also requires the negitive rule, once you have exicuded the negitive rule press enter, it dosn't change from NOP. That's because LQ, SQ, LH, SH, LW, and SW need a (First 16bits Register) at the end, sence i am continuing from t0 (Where the first 16bits of my address are) with the first 16bits of the address i would add a (t0) at the end, if the last 16bits was 1324 my ine would be
"SW t1 $1324(t0)" and i wouldn't have to exicute the negitive rule because the last 16bits are below 7F80. Now the full 32bits of the hex value is stored in t1, the last 16bits of the address are stored in t1 and that (t0) means that SW is loading the first 16bits from there, so now everything is in one register, this allows the subroutine to work.

9) Go down one line from the SW, this command is "JR RA" this dosn't need a number entered in it, just type JR RA and click ok.

10) Now make a new .txt file and type this: (The { } means it's editable to what your doing)
Quote :

#{Code Name}
;Subroutine: {Your Coding Name}
;Code By: {Credit Of The Code You Used}
;{Info, if any}
0x
0x
0x
0x
0x
0x

This is a method of geting your sub on paper faster, now go back to ps2dis, click on the line for the first 16bits of your address, you might want to use these shortcut keys:
Quote :

'Ctrl' + 'C' = Copy The Highlighted Text
'Ctrl' + 'X' = Cut The Highlighted Text
'Ctrl' + 'V' = Paste the Copied or Cuted Text
'Ctrl' + 'Z' = Undo Last Action

Duble click the address and copy it, paste it in the "Label" section, now enter a space and type 0x then copy and paste the data (hex value) into the label section right after the 0x, now highlight the full lebel section and cut it to the first "0x" on notepad, do that with every line from the first 16bits of the address to the jr ra, once your done you should have one blank "0x" in your notepad. If i started my subroutine at 08800610 and i actualy used the values i was using as examples, once i got finished copying and pasting my address and datas to notepad my notepad should look like:
Quote :

#Example
;Subroutine: Crioshinx
;Code By: Bob The Builder, JK
;Use Online Only
0x08800610 0x3c081234
0x08800614 0x3c095679
0x08800618 0x2529abcd
0x0880061C 0xad091324
0x08800620 0x03e00008
0x


11) The final "0x" is for your hook, without a hook your subroutine wont work. You first need a hook address, i will post a guide on finding hooks soon for now use these hooks that work for every game:
08800098
08800024
0880004c
So to use these you need to go back to ps2dis and press "G" and go to one of them, now you need to use J {JUMP} or JAL {JUMP AND LINK} and enter the top address of you subroutine, sence we kept the address in real format we dont have to do any converting, but if for what ever reson your address is not in real format conver it before using it for your hook, heres what my hook would be sence i started at 610 "J $08800610" now i would coy and paste the address and data to the last "0x" now my subroutine is:
Quote :

#Example
;Subroutine: Crioshinx
;Code By: Bob The Builder, JK
;Use Online Only
0x08800610 0x3c081234
0x08800614 0x3c095679
0x08800618 0x2529abcd
0x0880061C 0xad091324
0x08800620 0x03e00008
0x08800098 0x0a200026


12) Now we need to convert the addresse back to cheat format or your cheat devise wont be able to use it, but instead of using a calculator, we can just replace the 0880 with 0000 sence the 0880 part is visible and not 'Realy' part of the code, so press 'Ctrl" + 'H' and replace the 0880 with 0000, my final product is:
Quote :

#Example
;Subroutine: Crioshinx
;Code By: Bob The Builder, JK
;Use Online Only
0x00000610 0x3c081234
0x00000614 0x3c095679
0x00000618 0x2529abcd
0x0000061C 0xad091324
0x00000620 0x03e00008
0x00000098 0x0a200026

But that subroutine wont work because i just chose random number for the values. Yours should though.

To add another code into your subroutine, reapeat steps 5-9 right after the JR RA, just because you have two codes dosn't mean you have two hooks, you always use one hook for your intire subroutine, you can write up to a 6 line code into one subroutine, using at tX registers 0-9. Just follow the pattern.

I hope i have tought you something, i don't ask for +rep or donations just feedback from readers, if you have any questions please reply or shoot me a PM, ill try to answer all them as best i can. Enjoy and happy coding

P.S:
Please dont google, look up or try to find 'templates' there for people who can learn MIPS themselves, I have just tought you how to write subroutine without ever talking about templates, you don't need them, try and learn yourself, or ask a coder, IDK about other people but i love to help.

-Crioshinx/TheEliteOne/Jinzo X
Back to top Go down
 
*NOOB PROOF* Subroutine Guide by TheEliteOne aka Crioshinx aka Jinzo X
Back to top 
Page 1 of 1
 Similar topics
-
» *NOOB PROOF* Advanced Subroutine Guide by TheEliteOne aka Crioshinx aka Jinzo X
» TheEliteOne's Code Searching Guide
» How a Subroutine Works
» How To Write A Code Into A Subroutine
» Hot to write a DMA code into a subroutine

Permissions in this forum:You cannot reply to topics in this forum
PSP Elites :: PSP Section :: PSP Guides :: MIPS/PS2DIS Guides-
Jump to: