WiiRd forum

Wii & Gamecube Hacking => Wii Game hacking help => Topic started by: Deathwolf on June 15, 2011, 08:34:49 PM

Title: C2/C0 Pointer Loading instruction.
Post by: Deathwolf on June 15, 2011, 08:34:49 PM
What do I need for ASM pointers?

Example:

The pointer is at the address 805B2FE0. Example the Pointer value shows this new address: 81052FC4

li r4,0x63
lis r11,0x805B
ori r11,r11,0x2FE0
--------------- <--- instruction for "loading into the pointer"
stb r4,0 (??)

Is something like that possible?

Thanks for any help
Title: Re: C2/C0 Pointer Loading instruction.
Post by: dcx2 on June 15, 2011, 09:28:12 PM
Do you mean [805B2FE0] = 81052FC4?


li r4,0x63
lis r11,0x805B
ori r11,r11,0x2FE0
lwz r11,0(r11)
stb r4,0(r11)
Title: Re: C2/C0 Pointer Loading instruction.
Post by: Deathwolf on June 15, 2011, 09:33:42 PM
Like 48 codetype. The address 805B2FE0 have the pointer value 81052FC4.

li r4,0x63
lis r11,0x805B
ori r11,r11,0x2FE0
lwz r11,0(r11)
stb r4,0(r11)

What does this exactly do? It's loading into the address 805B2FE0 and then into the value? But actually the 81052FC4 isn't at the registers of this breakpoint.
Title: Re: C2/C0 Pointer Loading instruction.
Post by: dcx2 on June 15, 2011, 09:41:10 PM
You've been hacking for long enough to know what lwz does.  It (the 5 ASM instructions) is effectively a 48 code type followed by a 10 code type.

First, the code loads r4 with the value 0x63.  Then, it loads the upper 16-bits of r11 with 0x805B.  Then it loads the lower 16-bits of r11 with 0x2FE0.  Then it loads the 32-bit word at address 0(r11) into r11.  Then it stores the value in r4 to the address 0(r11).
Title: Re: C2/C0 Pointer Loading instruction.
Post by: Deathwolf on June 15, 2011, 09:45:18 PM
Your're right! Thanks a lot I've never tried and thought about that. Works perfectly :)