ASM loading fail ._.

Started by Deathwolf, June 21, 2011, 07:51:04 PM

Previous topic - Next topic

Deathwolf

Here is the code which doesn't work -.-"

stwu r1,-80(r1)
stmw r14,8(r1)
lis r16,0x9018 <-- write 9018F19E
ori r16,r16,0xF19E
lis r14,0x9018
ori r14,r14,0xF19E
lhz r14,0(r14) <-- load value into r14
cmpwi r14,0x26FD <-- compaire r14 value with 26FD
bne- ROFL <-- if not equal, branch to ROFL xD

li r15,0x26FF <-- write 26FF to r15
sth r15,0(r16) <-- store r15 value into r16 (9018F19E)

ROFL:
stw r0, 36 (r30)
lmw r14,8(r1)         # pop r14-r31 off the stack
addi r1,r1,80         # release the space



C2000000 00000008
9421FFB0 BDC10008
3E009018 6210F19E
3DC09018 61CEF19E
A1CE0000 2C0E26FD
4082000C 39E026FF
B1F00000 901E0024
B9C10008 38210050
60000000 00000000

why the hell it doesn't work? I'm hanging on this for an half hour o_O

Thanks of any help ._.
lolz

dcx2


Deathwolf

#2
ok thanks but the ASM looks right?

No the stack frame freez the game.
lolz

Bully@Wiiplaza

Quote from: Deathwolf on June 21, 2011, 07:51:04 PM

C2000000 00000008
9421FFB0 BDC10008
3E009018 6210F19E
3DC09018 61CEF19E
A1CE0000 2C0E26FD
4082000C 39E026FF
B1F00000 901E0024
B9C10008 38210050
60000000 00000000

1.) forgot to put the right address?
2.) Original instruction after the stack frame

stwu r1,-80(r1)
stmw r14,8(r1)
lis r16,0x9018
ori r16,r16,0xF19E
lis r14,0x9018
ori r14,r14,0xF19E
lhz r14,0(r14)
cmpwi r14,0x26FD
bne- ROFL
li r15,0x26FF
sth r15,0(r16)
ROFL:
lmw r14,8(r1)
addi r1,r1,80        
stw r0, 36 (r30)

3.) You probably don´t need the stack frame, plus you can shorten it by 1 instruction:

lis r12,0x9018
ori r12,r12,0xF19E
lis r11,0x9018
ori r11,r11,0xF19E
lhz r11,0(r11)
cmpwi r11,0x26FD
bne- ROFL
li r14,0x26FF
sth r14, 0xF19E(r12)
ROFL:  
stw r0, 36 (r30)

4.) The coding you use doesn´t fit that what you want to do, maybe poking this value freezes the game aswell?
5.) Did you double check if your address is not used by multiple people?
My Wii hacking site...
http://bullywiihacks.com/

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

~Bully

dcx2

2) It's usually good practice to put the original instruction last.  However, in this case none of the original instruction's registers were modified, so it can to anywhere.

3) This is full of fail.

li r14,0x26FF
sth r14, 0xF19E(r12)

First, r14 means you should use a stack frame.  Re-use r11 if you wish.

Second, I avoid r11 because it can be difficult to tell if it's safe or not.  It usually is, but it can be tricky.

Third, displacement operands are sign extended.  This means 0xF19E = -3682.  So you won't actually get the address you wanted.  This is why Y.S. used the @ha assembler directive, instead of just @h.

Deathwolf

lolz