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
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
Would you like to react to this message? Create an account in a few clicks or log in to continue.

SneakyCodes Gaming Forum

The Evolution Begins...
 
HomePortalLatest imagesRegisterLog 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
How to Write a two code Subroutine! EmptyFri Apr 10, 2020 11:27 pm by sabian49

» damn sneaky, RiP. It was fun
How to Write a two code Subroutine! EmptySat Oct 11, 2014 1:25 am by Sylen7Nato

» Just Another Blonde Joke xD FUNNY AS FAWK
How to Write a two code Subroutine! EmptyMon Mar 03, 2014 5:37 pm by Rossy Redness

» Hey it's Skinny107
How to Write a two code Subroutine! EmptyTue Dec 03, 2013 8:24 pm by o5Gz

» ps3 hacking!
How to Write a two code Subroutine! EmptyMon Jun 10, 2013 9:42 pm by Sylen7Nato

» PSP ISO List
How to Write a two code Subroutine! EmptyMon Jun 10, 2013 9:28 pm by Sylen7Nato

» tiger render
How to Write a two code Subroutine! EmptyFri May 10, 2013 3:11 pm by mk7

» SWORN.
How to Write a two code Subroutine! EmptySun Dec 09, 2012 6:25 am by EverEffects

» homefront redeem code
How to Write a two code Subroutine! EmptyFri Nov 30, 2012 1:32 am by EverEffects

» Calling Sworn
How to Write a two code Subroutine! EmptyTue Nov 20, 2012 4:34 pm by EverEffects

» Thought Id Stop By And Say Hi
How to Write a two code Subroutine! EmptyThu Nov 15, 2012 3:40 am by HappySnacks69

» An Introduction
How to Write a two code Subroutine! EmptyTue Nov 13, 2012 2:33 am by Ace700

Views
How to Write a two code Subroutine! Image
Powered by web analytics software.
Statistics
We have 4719 registered users
The newest registered user is CraftPR

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

None

Most users ever online was 328 on Sun Jul 04, 2021 8:20 am
Facebook Stream
Top posters
SwoRNLeaDejZ
How to Write a two code Subroutine! Vote_lcapHow to Write a two code Subroutine! Voting_barHow to Write a two code Subroutine! Vote_rcap 
blckhwksfan
How to Write a two code Subroutine! Vote_lcapHow to Write a two code Subroutine! Voting_barHow to Write a two code Subroutine! Vote_rcap 
-Ch33zy-
How to Write a two code Subroutine! Vote_lcapHow to Write a two code Subroutine! Voting_barHow to Write a two code Subroutine! Vote_rcap 
EverEffects
How to Write a two code Subroutine! Vote_lcapHow to Write a two code Subroutine! Voting_barHow to Write a two code Subroutine! Vote_rcap 
l7annylvlex
How to Write a two code Subroutine! Vote_lcapHow to Write a two code Subroutine! Voting_barHow to Write a two code Subroutine! Vote_rcap 
+Elegance
How to Write a two code Subroutine! Vote_lcapHow to Write a two code Subroutine! Voting_barHow to Write a two code Subroutine! Vote_rcap 
Whiteyy
How to Write a two code Subroutine! Vote_lcapHow to Write a two code Subroutine! Voting_barHow to Write a two code Subroutine! Vote_rcap 
JZydex
How to Write a two code Subroutine! Vote_lcapHow to Write a two code Subroutine! Voting_barHow to Write a two code Subroutine! Vote_rcap 
PumaSnIpejZ
How to Write a two code Subroutine! Vote_lcapHow to Write a two code Subroutine! Voting_barHow to Write a two code Subroutine! Vote_rcap 
kHaoZ
How to Write a two code Subroutine! Vote_lcapHow to Write a two code Subroutine! Voting_barHow to Write a two code Subroutine! Vote_rcap 






Share | 
 

 How to Write a two code Subroutine!

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

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

How to Write a two code Subroutine! _
PostSubject: How to Write a two code Subroutine!   How to Write a two code Subroutine! EmptyWed 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
SwoRNLeaDejZ

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

How to Write a two code Subroutine! _
PostSubject: Re: How to Write a two code Subroutine!   How to Write a two code Subroutine! EmptyMon 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.
Back to top Go down
https://sneakycodez.forumotion.com
KnightMaire
Vip
Vip
KnightMaire

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

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


old topic mate ;p
Back to top Go down
http://cryptsnipers.co.cc
Sponsored content




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


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

Create a forum on Forumotion | ©phpBB | Free forum support | Report an abuse | Forumotion.com