quick question on powerpc code

Disassembly, Reassembly, Tools and devleopment. Going deep with Hardware and Software.
Post Reply
lgtmelo
Posts: 23
Joined: Wed Feb 28, 2024 12:03 am

quick question on powerpc code

Post by lgtmelo »

i have the following:
a.png
and FKLAFUGD is a label for the following address:
b.png
whats the point in calling lis r3,0x5d before calling a lhz command? i mean, wont the lhz just overwrite what the lis did?
from what ive learned:
lis r3,0x5d // this makes r3 = 0x5d0000
lhz r3, offset FKLAFUGD(r3) // this loads whatever is in FKLAFUGD's address (005d25dc), which is 38 f6 into a lhz r3 (which is 000038f6)
kur4o
Posts: 966
Joined: Sun Apr 10, 2016 9:20 pm

Re: quick question on powerpc code

Post by kur4o »

First line loads a pointer to r3

Second line adds offset to pinter to r3, and than data from that offset is stored to r3.

PPc code can use only 16 bit addressing and makes full address out of 2 commands

I have another quick question,

How to set up in IDApro r14-r17 registers with fixed values as in r2 and r13.
lgtmelo
Posts: 23
Joined: Wed Feb 28, 2024 12:03 am

Re: quick question on powerpc code

Post by lgtmelo »

kur4o wrote: Wed May 01, 2024 7:51 am First line loads a pointer to r3

Second line adds offset to pinter to r3, and than data from that offset is stored to r3.

PPc code can use only 16 bit addressing and makes full address out of 2 commands

I have another quick question,

How to set up in IDApro r14-r17 registers with fixed values as in r2 and r13.
hey, thanks for the tip. i managed to read what is actually in the code by doing ctrl+shift+g. second line is r3,0x25dc(r3), which is r3=(r3+0x25dc). since r3 is previously defined as 0x5d, this now makes sense to me! :D
gmtech825
Posts: 193
Joined: Fri Feb 24, 2017 11:27 am

Re: quick question on powerpc code

Post by gmtech825 »

Instead of CTR shift del, you can click on the op and look at the bottom right corner of the screen and it will show the actual code.

I also would love to know how to setup ida register values if anyone knows
Post Reply