+ Reply to Thread
Results 1 to 5 of 5
  1. #1
    Join Date
    Jul 2009
    Posts
    41
    Points
    116,964.00
    Rep Power
    194

    Default How to write a simple sub! VERY EASY!c

    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 1
    Get a Ram Dump of your game. Today we're using MOHH2.
    Step 2
    Open 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 - 08e80000
    Step 3
    Now 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 4
    Now 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 format
    Code:
    #see through walls
    0x08B55CAC 0x3c05f000 in Real format
    Step 5
    Now double click anywhere on a line and a box should pop up saying

    Address [XXXXXXXX] Data [XXXXXXXX]
    Label [___________________________________]
    Comment [_____________________________________]
    Command[nop___________________]
    Step 6
    Ignore Everything except the Command box. Change the "nop" command to "lui t0 $[first 4 of code address]".

    So this would be mine -

    Code:
    lui t0 $08b6
    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 08b6
    Step 7
    Now 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 $3c05
    Step 8
    Now 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 $f000
    Step 9
    Now 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 -

    Code:
    sw t1 $5CAC(t0)
    [b] MAKE SURE YOU ADD (t0) WITH THE BRACKETS AFTER THE 4 NUMBERS!!!DO NOT PUT A SPACE BETWEEN $xxxx AND (t0) !!!
    Step 10
    [quote] This part is probably the easiest of the steps.

    Double click the next line and change the command to "jr ra"

    So this would be mine -

    Code:
    jr ra
    That simple?

    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

    Code:
    J $08e8254
    because i started my subroutine at 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 -

    Code:
    0x001bf714 0x0a3a0095
    The First Address is the Hook and the value beside it is the Jump value.

    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

  2. #2
    Join Date
    Apr 2009
    Location
    Pleasant Hill, OR
    Posts
    1,537
    Points
    2,074,599.73
    Rep Power
    201

    Default

    really nice tut +rep

    3-16-2010
    Quoted from CB: _PRaLiNeS_ being a newfag
    Notice: xWhite_shadowx or any other member of codinghs is forbidden to take _PRaLiNes_ side on this matter lol

  3. #3
    Join Date
    Jul 2009
    Posts
    41
    Points
    116,964.00
    Rep Power
    194

    Default

    thanks

  4. #4
    Join Date
    Apr 2008
    Location
    N0T NEAR Y0U
    Posts
    1,512
    Points
    1,975,988.70
    Rep Power
    213

    Default

    Hey are u the fucker who has been using inf health


  5. #5
    Join Date
    Jul 2009
    Posts
    41
    Points
    116,964.00
    Rep Power
    194

    Default

    Yes i was!

    I saw you.

    ixS1Nxi

+ Reply to Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts