The title says all. What about this?
Write a value 0063 to a non ASM address.
Example to 80354213.
Hook address 80123456
lis r12,0x8035 # load into address 80354213
ori r12,r12,0x4213
li r14,0x0063 # write 0063 to r14
lhz r14,0(r12) # load 0063 value into r12
sth 14,0(r12)
code would be:
C2123456 00000003
3D808035 618C4213
39C00063 A1CC0000
B1CC0000 00000000
I know, normally you have to use a C0 codetype for this but it should be possible to do this with C2!?
would you stack it first? or do you want to leave it live that?
Quote from: Deathwolf on February 26, 2011, 12:07:30 AM
lhz r14,0(r12) # load 0063 value into r12
No.
http://pds.twi.tudelft.nl/vakken/in101/labcourse/instruction-set/lhz.html
Quote from: Patedj on February 26, 2011, 03:12:05 AM
would you stack it first? or do you want to leave it live that?
The stack is not a verb. It is a noun. It describes an area of memory. This area of memory has an address that is given by the stack pointer, r1. So if you look in Memory Viewer at whatever value is in r1, you will be looking at the data that is on the stack.
Imagine you have many books. You put them all in a nice neat pile. They are now a
stack of books. You could think of each book as a function. When one function calls another using a linking branch (bl or bctrl), this would be like putting a new book on top of the stack. When a function completes using blr, this would be like taking a book off the stack.
He was pointing out that r14 is the destination register not r12
Don't look at the registers! Idk if they are free or not. It was just an example. Sure I have to use the Stack frame.
It has nothing to do with what registers you're using.
Quote from: Deathwolf on February 26, 2011, 12:07:30 AM
lhz r14,0(r12) # load 0063 value into r12
lhz does not do what you claim it is doing.
http://pds.twi.tudelft.nl/vakken/in101/labcourse/instruction-set/lhz.html
Quote from: dcx2 on February 26, 2011, 03:17:06 PM
It has nothing to do with what registers you're using.
Quote from: Deathwolf on February 26, 2011, 12:07:30 AM
lhz r14,0(r12) # load 0063 value into r12
lhz does not do what you claim it is doing.
http://pds.twi.tudelft.nl/vakken/in101/labcourse/instruction-set/lhz.html
Oh my bad. Thanks for the info.