The above video goes away if you are a member and logged in, so log in now!
Hackin help –
Can someone tell me how to find the value of a register?
Example: 00111504 a0510050 sb s1, $0050(v0)
This is not a code i'm workin on, rather an example. How would I go about finding what the value is at (v0) before the adding accorrs? I was just wondering, not a pro at this, but could I use this as a reference if thats too hard to explain?
r0 - 00000000 at - 80110000 v0 - 00000086 v1 - 800EFBC0
a0 - 800EFBC0 a1 - 0000FFFF a2 - 800EFBC0 a3 - 0000009E
t0 - 00000000 t1 - 00000001 t2 - FFFFFFFF t3 - 00000004
t4 - FFFF0000 t5 - 00000002 t6 - 00000009 t7 - 000000C5
s0 - 8010BF50 s1 - 8010BF50 s2 - 8010BF50 s3 - 0000001A
s4 - 0000001B s5 - 00000000 s6 - 00000103 s7 - FFFF8000
t8 - 00000001 t9 - 00000001 k0 - 80794AEC k1 - 00000AAA
gp - 00000000 sp - 800F0138 fp - 800F01E0 ra - 8004ABB8
pc - 8004AC78
the values are stored in the registers different ways.
in that SB example you gave, youd have to scroll up and see where s1 (or v0) is loaded with a value. s1 holds the value being stored (so you must want to change v0 to change where the value is being stored).
when im programming in MIPS, i use the 'ori' command (ori register, zero, $value) to load a value cuz its the easiest... but i think hanimars ps2dis makes it appear as a 'li'.
you can also 'addi register, zero, $value'. the 'i' is for immediate, and will allow you to load a constant value (the $value part).
also, certain registers are for certain things...
't' registers are 'temporary' registers, pc = program counter (holds the current address), ra is for the JRs... stuff like that. oh, and register zero ALWAYS holds the value zero. so when you see a 'beq zero, zero...' then it ALWAYS jumps cuz 0 and 0 are always the same.
so to sum it up, you have to read the code and find out where the value is stored in your register (sometimes the ps2dis shows the value in the register in '( )', but usually you have to read the code).
In the event the game's code makes it difficult to determine what value is on the register, it's time to get creative.
1. Create a code to store the register's value in a known, numerically-interpreted memory address. Example: If a code exists for money or experience, etc. in the game, then simply drop the registers value to the address and go to a spot in the game where it can be viewed.
2. Create a code to convert the register's value to ASCII text or whatever character set the game uses and overlay a bit of static text with the results.
3. If the game contains some recognizable routine for sending output to the screen, usurp it to get values you want displayed.
Which method works best (if any) is determined by the game's code.