Originally posted by luc-ita
View Post
Code:
[COLOR="#008000"]// Obtain data from s4[/COLOR] address $20255C48 [COLOR="#008000"]//address starts out as "2" so my compiler output is in 32 bit constant write format.[/COLOR] jal $a0000[COLOR="#008000"] //jump and link to our Code Cave[/COLOR] [COLOR="#008000"]///////////////////////////////////////////////////// // Code Cave Start /////////////////////////////////////////////////////[/COLOR] address $200a0000 [COLOR="#008000"] // original code stored at 0x255C48 because we hi-jacked that address.[/COLOR] daddu s4, a0, zero [COLOR="#008000"]// load data from s4 in to t0 // t0 now contains the data stored at the addresss of s4[/COLOR] lw t0, $0000(s4) [COLOR="#008000"]/* You can now alter the data stored at s4 or any data of the addresses that start at s4. */[/COLOR] [COLOR="#008000"]// return to original function[/COLOR] jr ra nop [COLOR="#008000"]///////////////////////////////////////////////////// // Code Cave End /////////////////////////////////////////////////////[/COLOR]
Code:
20255C48 0C028000 200A0000 0080A02D 200A0004 8E880000 200A0008 03E00008 200A000C 00000000

Comment