How to Write a two code Subroutine!
SneakyCodes Gaming Forum
Welcome to SneakyCodes. Contrary to what some may want you to think, SneakyWorld.forumotion is IN NO WAY affiliated with SneakyCodez. Anyone who tries to tell you different, is a lying piece of shit.

SneakyCodes is in the process of an entire site reboot, with no sections, topics, forums, and users. Feel free to sign up, and check back regularly for updates.

Thank you,
SwoRNLeaDejZ


SneakyCodes Gaming Forum

The Evolution Begins...
 
HomePortalRegisterLog inSneakyCodes RSS Feed
Everyone go to SneakyWorld! Link on the home page!
Sneaky Generators

Sneaky Image Editor
The Walking Dead Game

All Generators By SwoRNLeaDejZ


FTB3 Room Generator
FTB3 Name Generator
FTB2 Tag Generator
FTB2 Name Generator
FTB2 Room Generator


Donate to SneakyCodes Today!
Affiliates
Please Join and Visit the SneakyCodes Affiliates




We Love A-G!!!!

Join TheUnseenCoders.com Today!!


Free Forumotion Designs


kHaoZ is a frickin beast :)

Tech Support Guy
Latest topics
» Deepest regards to the Sneaky Community
Tue Oct 28, 2014 5:42 am by _-_EVIL-LOCO_-_

» damn sneaky, RiP. It was fun
Sat Oct 11, 2014 1:25 am by Sylen7Nato

» Just Another Blonde Joke xD FUNNY AS FAWK
Mon Mar 03, 2014 5:37 pm by Rossy Redness

» Hey it's Skinny107
Tue Dec 03, 2013 8:24 pm by o5Gz

» ps3 hacking!
Mon Jun 10, 2013 9:42 pm by Sylen7Nato

» PSP ISO List
Mon Jun 10, 2013 9:28 pm by Sylen7Nato

» tiger render
Fri May 10, 2013 3:11 pm by mk7

» SWORN.
Sun Dec 09, 2012 6:25 am by EverEffects

» homefront redeem code
Fri Nov 30, 2012 1:32 am by EverEffects

» Calling Sworn
Tue Nov 20, 2012 4:34 pm by EverEffects

» Thought Id Stop By And Say Hi
Thu Nov 15, 2012 3:40 am by HappySnacks69

» An Introduction
Tue Nov 13, 2012 2:33 am by Ace700

Views
Powered by web analytics software.
Statistics
We have 4719 registered users
The newest registered user is CraftPR

Our users have posted a total of 13085 messages in 2891 subjects
Who is online?
In total there are 2 users online :: 0 Registered, 0 Hidden and 2 Guests

None

Most users ever online was 59 on Sat Dec 03, 2011 5:04 pm
Facebook Stream
Top posters
SwoRNLeaDejZ
 
blckhwksfan
 
-Ch33zy-
 
EverEffects
 
l7annylvlex
 
+Elegance
 
Whiteyy
 
JZydex
 
PumaSnIpejZ
 
kHaoZ
 






Share | 
 

 How to Write a two code Subroutine!

View previous topic View next topic Go down 
AuthorMessage
Architect
Site Poster
Site Poster


Posts : 139
1337ness : 12
Join date : 2010-10-15
Age : 23

PostSubject: How to Write a two code Subroutine!   Wed Oct 20, 2010 1:51 am


How to Write a two Code Subroutine.
===================================
What you Need to know:


-Basic understanding of Mips

-UnderStanding of registers

-How to find a Hook

-How to find a hook value

-Negative rule


~~The Mips you need to know~~
__________________________


lui - load upper immediate
lw - Load Word
ori- Bitwise or immediate
addiu-Add immediate unsigned
sw- Store word
Jr ra- Jump Register Return address


~~Registers~~
______________


Basically a Register Holds something. ie.

lui t0 $1234
lw t0 $5678(t0)

Thos would load the current value at address 0x12345678 into t0

t0-t9 Temporary Registers

~~How to find a hook~~
_____________________



To find a hook:

-- You First Search 03e00008 in exact value

-- You can either Let it Search for about 4-6 min Or when it hits 1%, just stop it.

-- Now that You've got your searches Add them to your database.

-- You can either change the hex to 03e00007 or nop it (00000000).

-- What ever ones freeze can be used as a hook.


--For the hook value, Put the first part of your routine in Real using the following command. J $first address of routine in Real.



~~Negative rule~~
__________________


The Negative Rule:

If the Last 16 bits of your address is over 7FFF then You have to add 0x0001 to the address in real. i.e- 0x1234[8000] is over 7FFF so u add 0x0001 [12358000 in fake].





Now lets get started with our Routine.



The template We will be using
Code:

-Hook
lui t0 $First half of Address
lui t1 $first half of value
addiu t1 t1 $Second half of value
sw t1 $Second half of Address(t0)
lui t2 $First half of code 2
lui t3 $First half of value
addiu t3 t3 $Second half of value
sw t3 $Last half of Address
Jr Ra

Our code Were gonna use :

#This code does Nothing
0x00023454 0x00000001
0x00023458 0x00000002

First: Put the codes in Real addressing

0x00023454 +08800000
0x00023458 +08800000
_____________________
0x08823454 0x00000001
0x08823458 0x00000002


Second:
Put the codes in the template.


-Hook
lui t0 $0882
lui t1 $0000
addiu t1 t1 $0001
sw t1 $3454(t0)
lui t2 $0882
lui t3 $0000
addiu t3 t3 $0002
sw t3 $3458(t2)
Jr Ra

Now We use ps2dis to Plugin the commands and get our Values.

Load Ps2dis from 08800000


Press control F select as hex string and hold zero for 45 seconds. Now we found our Area of Nops we will be working in.


Since we have our area of Nops its time to Start Plugging in the Commands. Im using area 08803000

hook=0x00000098 0x0a200c00

Lui t0 $0882= 0x08803000 0x3c080882

lui t1 $0000= 0x08803004 0x3c090000

addiu t1 t1 $0001= 0x08803008 0x25290001

sw t1 $3454(t0)= 0x0880300C 0xad093454

lui t2 $0882= 0x08803010 0x3c0a0882

lui t3 $0000= 0x08803014 0x3c0b0000

addiu t3 t3 $0002 = 0x08803018 0x256b0002

sw t3 $3458(t2) = 0x08800301c 0xad4b3458

jr ra = 0x08803020 0x03e00008


#Not done yet
0x00000098 0x0a200c00
0x08803000 0x3c080882
0x08803004 0x3c090000
0x08803008 0x25290001
0x0880300C 0xad093454
0x08803010 0x3c0a0882
0x08803014 0x3c0b0000
0x08803018 0x256b0002
0x0880301c 0xad4b3458
0x08803020 0x03e00008



;Now we have to Subtract 0880 from each address.


Done!


#Finished code
0x00000098 0x0a200c00
0x00003000 0x3c080882
0x00003004 0x3c090000
0x00003008 0x25290001
0x0000300C 0xad093454
0x00003010 0x3c0a0882
0x00003014 0x3c0b0000
0x00003018 0x256b0002
0x0000301c 0xad4b3458
0x00003020 0x03e00008



~~Recap~~
___________


#Fake addressing
0x00023454 0x00000001
0x00023458 0x00000002

#Real addressing
0x08823454 0x00000001
0x08823458 0x00000002

#Finished code
0x00000098 0x0a200c00 -hook
0x00003000 0x3c080882 0x0882- First half of First address
0x00003004 0x3c090000 0x0000- First half of first value
0x00003008 0x25290001 0x00000001- Second half of Value
0x0000300C 0xad093454 0x00003454-Second half of Address 1
0x00003010 0x3c0a0882 0x0882 -First half of address 2
0x00003014 0x3c0b0000 0x0000 First half of Value 2
0x00003018 0x256b0002 0x00000002 - Second half of Value 2
0x0000301c 0xad4b3458 0x000003458 - Second half of Address 2
0x00003020 0x03e00008 jr ra


~Architect













Back to top Go down
SwoRNLeaDejZ
Administrator

Administrator
avatar

Posts : 2120
1337ness : 140
Join date : 2010-09-17
Age : 31
Location : Massachusetts

PostSubject: Re: How to Write a two code Subroutine!   Mon Jul 18, 2011 4:16 pm


There is a typo in the first template:

Architect wrote:
-Hook
lui t0 $First half of Address
lui t1 $first half of value
addiu t1 t1 $Second half of value
sw t1 $Second half of Address(t0)
lui t2 $First half of code 2
lui t3 $First half of value
addiu t3 t3 $Second half of value
sw t3 $Last half of Address
Jr Ra

Should read:

sw t3 $Last Half of Address(t2)

Very Happy

Also, to find a hook value for your code, open PS2DIS, double click on any Nop address, and type in this:
Code:
j $[First address of Sub in Real Addressing]
In the COMMAND text box.

So if your sub starts at 0x00001000 then you type:
Code:
j $08801000
In the Command field, and then copy whatever it says in the DATA field as your Hook Value.






Gifts:
[You must be registered and logged in to see this link.] | [You must be registered and logged in to see this link.] | [You must be registered and logged in to see this link.]





PWND

Vist [You must be registered and logged in to see this link.] for free Movies, Music, ISOs, and MUCH MORE!
Back to top Go down
http://sneakycodez.forumotion.com
KnightMaire
Vip
Vip
avatar

Posts : 229
1337ness : 20
Join date : 2011-01-29
Age : 24
Location : Massachusetts

PostSubject: Re: How to Write a two code Subroutine!   Tue Jul 19, 2011 3:09 am


old topic mate ;p




Contact me to request for some PHP assistance Smile
I also have experience in HTML, CSS, and JS/jQuery



I support George Hotz and
the FREEDOM OF INFORMATION

[You must be registered and logged in to see this link.].
Back to top Go down
http://cryptsnipers.co.cc
Sponsored content




PostSubject: Re: How to Write a two code Subroutine!   


Back to top Go down
 

How to Write a two code Subroutine!

View previous topic View next topic Back to top 
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
SneakyCodes Gaming Forum :: PSP Section :: PSP Tutorials-
Jump to:  





SneakyCodes.tk | Sneaky-Media.com


Free GeoHot NOW!
I support George Hotz and
the FREEDOM OF INFORMATION

Forumotion.com | © phpBB | Free forum support | Contact | Report an abuse | Free forum