Quote:
Originally Posted by Mickey`
I can't understand the problem... What's wrong in my routine ?
Code:
.align 2
.thumb
main:
push {r0-r1}
ldr r0, var4200
ldr r1, decrypt
bx r1
pop {r0-r1}
.align 2
var4200:
.word 0x4200
decrypt:
.word 0x0806E455
Ps : Is it possible that the offset of the variable decrypter is different in a French ROM ? Because I found the same data at 0x6E454 in the English ROM and at 0x6E478 in the French ROM. But even with this second offset, the routine doesn't work...
|
Yes, the routine is probably located somewhere else in the French ROM.
Another thing with your routine is that while it works, it will never return. So if you want to know the var address, you'll have to find the end of the var decrypter. To make it return so you can read the addres with a break at the end of your routine (and let the game safely continue after) you will need something like this:
Code:
.text
.align 2
.thumb
.thumb_func
.global getvar
main:
push {lr}
ldr r0, var4200
ldr r1, decrypt
bl bxr1
pop {pc}
bxr1:
bx r1
.align 2
var4200: .word 0x4200
decrypt: .word 0x0806E478+1
Also, why hack a French ROM? Foreign ROMs aren't usually documented that well and some tools don't support them.