RAM Write template

Started by Bully@Wiiplaza, June 16, 2011, 07:39:27 PM

Previous topic - Next topic

Bully@Wiiplaza

... for that instruction: lwzx   r3,r3,r0
Can someone help please?
Everything I tried froze the game... :-[
My Wii hacking site...
http://bullywiihacks.com/

My youtube account with a lot of hacking videos...
http://www.youtube.com/user/BullyWiiPlaza

~Bully

Deathwolf

#1
this instruction is fail! it should be lwzx r3,r0,rX
lolz

Bully@Wiiplaza

Quote from: Deathwolf on June 16, 2011, 07:49:01 PM
this instruction is fail! it should be lwzx r3,r0,rX
no it´s not fail.
I need a template for this one.
My Wii hacking site...
http://bullywiihacks.com/

My youtube account with a lot of hacking videos...
http://www.youtube.com/user/BullyWiiPlaza

~Bully

dcx2

Quote from: Deathwolf on June 16, 2011, 07:49:01 PM
this instruction is fail! it should be lwzx r3,r0,rX

That is fail.  All instructions that load values from memory (lwz, lwzx, lwzu, lhz, lbz, etc) are (rA|0) instructions.

http://pds.twi.tudelft.nl/vakken/in101/labcourse/instruction-set/lwzx.html

If you use r0 as rA, it does not use the value in r0, instead it uses the value 0.

lwzx r3,r0,r3 = lwz r3,(r3 + 0), regardless of the contents of r0.

lwzx r3,r3,r0 = lwz r3,(r3 + r0)

---

To answer Bully's question,

li r12,0x63
stwx r12,r3,r0
lwzx r3,r3,r0

Bully@Wiiplaza

#4
Quote from: dcx2 on June 17, 2011, 12:04:13 AM
To answer Bully's question,

li r12,0xXX
stwx r12,r3,r0
lwzx r3,r3,r0
thought this fails... because I tried this template to load into r12, but the game froze.
Maybe I made another mistake or the game wouldn´t take that value? (that´s what I need to find out by myself though)
Let´s dig out a little thread by me and ThomasLin.

http://wiird.l0nk.org/forum/index.php/topic,8223.msg69083.html#msg69083

There ThomasLin told me how he did a RAM Write on a lwzx rX,rY,rX instruction that was about the same template you mentioned.
But it´s probably another case.

EDIT:

Does it also mean that you could do this...

lis r11, 0xVVVV
ori r11, r11, 0xWWWW
stw r11, Y (rX)
lwz rX,Y(rX)


instead of:

stwu r1, -16 (r1)
stw r11, 8 (r1)
lis r11, 0xVVVV
ori r11, r11, 0xWWWW
stw r11, Y (rX)
lwz r11, 8 (r1)
addi r1, r1, 16
lwz rX, Y (rX)
My Wii hacking site...
http://bullywiihacks.com/

My youtube account with a lot of hacking videos...
http://www.youtube.com/user/BullyWiiPlaza

~Bully

dcx2

It's possible the game doesn't like the change you're making with r12.

As always, it helps to post some disassembly.  No one rule will work every time, and sometimes different areas require exceptions to rules.

Bully@Wiiplaza

#6
it liked the change of r12, it just crashed because of r0 or r3, can´t remember.
However: I edited my post above.

---

EDIT:
the template works, only the game still freezes, because it´s executed for too many addresses :D
My Wii hacking site...
http://bullywiihacks.com/

My youtube account with a lot of hacking videos...
http://www.youtube.com/user/BullyWiiPlaza

~Bully