ASM glitch..

Started by IRS, July 31, 2010, 03:36:43 PM

Previous topic - Next topic

IRS

Im trying to create a teleportation code for my favorite game.. only one problem.. i cant even get past the first set of tests on correcting the code :\ everytime i turn the code on it instant freezes the game.. im used to this however.. so i set a breakpoint on the line before it.. activate the code.. then hit breakpoint again. and it shows the B to 0x-my address of code- but as soon as the code gets done executing all the pushing registers and hits the first ori in the code (im trying to load several different addresses for later storage..) the ASM then branches off to 8026672C. my code starts around the usual areas!! the ASM is inserted around 8000XXXX (i dont remember the exact range..) i run the code even with everything else off and it still glitches up.. its not a problem with a specific line.. i made an extra branch and a blank (nop) and jumped over that part of the code.. when it hits the ori it still freezes up with the exact same problem.. i was using an extra blank area i found (800000A00) and it would cause that error on that address being loaded.. so i then tried the gecko register method.. the code still did it.......

anyone have a clue what i can do to prevent this from happening..? i can have a different mod set on the EXACT same ASM line and it does nothing similar to what is going on.. its only for this ASM code i created.. if you would like to see the ASM i can pm it to you as i dont want the code to even come close to being public.. its for a game already getting demolished by weak hacks.. this hack is too strong  for the public to get their hands on it.. all im willing to say in public is i push and pop a lot of registers.. the register also thats causing the trouble i believe is... r13 if that offers any solution...

thanks.
I R S

James0x57

If you are, don't use r0 as the destination register.

ori r0,r13,0x1234


IRS

#2
i am not. sorry i should have made it clearer. the ori method i am using is to fully load the register.. like:

lis r7,0x8000
ori r7,r7,0x1810

so r7 will now contain the address of the 3rd gecko register. im testing a different method using totally blank registers right now. if it does work im going to try and use it without burning up my gecko registers.

any reason as to how a code can jump that far without a branch of any kind? thats whats puzzling me...

-edit-
test phase in order. code is still bugging up. i am pulling my values from r4 and storing them later into r3.

Deathwolf

lolz

dcx2

Without more details, it will be hard to help you.  If you're concerned about your code being leaked, you can PM  me your ASM/hook/and the reg/disasm at the hook address during a breakpoint.  I'm probably more fanatical about limiting the release of abusive hacks than nearly anyone else on the forums, so you have nothing to worry about... ;D

Just as an FYI, registers that have "0" are not necessarily safe.  Also, r1, r2, and r13 are never safe.  Ever.  Period.  Even if you push it on the stack.

r13 is a what I believe is called a "data anchor" (so is r2, but I think r2 is a "read-only data" anchor).  It holds a very special value that the game uses to access things like static variables, constants, etc.  If you change the value in r13 you *will* fuck your game up.

I'm very surprised it failed on an ori.  You were just stepping along and suddenly end up in no-man's-land after executing an ori?  Maybe an interrupt was being serviced that used r13...

BTW, my teleporter codes store the coordinates inside the code, instead of using Gecko registers.  You might want to try that.

IRS

if it is still glitching up when i join my matches i will pm the code along lol. i have another hacker i am working with on this game and we are both trying to come up with as many different hacks we can off of co-ordinate hacks. and ok, i will keep in mind to always dodge r0,r1,r2 and r13. (im still having to learn which registers are a death sentence lol.)

also are any of these registers not safe to use? (they are the ones in the current version of the code)
r7
r8
r9
r10
r14
r15
r17
r18
r19

r10 has never had many problems for me before.. although im sure i recall using it much.. if needed i can just use another register instead.  its not too hard to push and pop all the registers anyway ;) lol

thanks everyone for helping!!

Deathwolf

sometimes r12 is free ;)
lolz

IRS

Quote from: Deathwolf on July 31, 2010, 05:29:20 PM
sometimes r12 is free ;)

honestly i have no clue what you are randomly mentioning r12 for.. i know i could probably use the register.. but you are giving no explanation so im kinda lost as to why you are mentioning it.. could you please explain why? lol

Deathwolf

hmm?
r12 writes sometimes 80XXXXXX.
so it's a good safe for some games!
but u already can use other registers...
lolz

IRS

ah, i see what you are saying now lol. im used to mostly seeing r12 as the mctrl register (probably screwed the command up..) but it branches to the control register and then loads from there. (it does this a lot for my game at least) also i noticed an idiotic mistake that i was doing.. it probably explains why the code would freeze randomly.. i was supposed to be popping my registers back.. instead i was storing them over the old data again! *facepalm* so later on down the code execution it would freeze the game.. as the values the game expects to be there have long been deleted and replaced with incorrect values...

dcx2

Actually, r0 is safe-ish.  A lot safer than most registers, believe it or not.  It's just awkward to use with some instructions.

The safety of registers is a very difficult topic...but I tried to do my best to explain it here.  http://wiird.l0nk.org/forum/index.php/topic,6555.0.html

Oh, bctrl is the instruction you meant, not mctrl.  bctrl = Branch to CounTeR and Link, not control.

IRS

#11
oh. lol well im used to the game loading an address into r12 and then branching to it. also i got the code working finally ;) helps to make sure the asm doesnt work for other stuff.. and if it does prevent your code from working there.

also very nice register explanation!! very very very detailed ;) just like all hackers like lol