adjusting codehandler?

Started by Bully@Wiiplaza, December 11, 2010, 02:58:10 PM

Previous topic - Next topic

Bully@Wiiplaza

Is it possible to force the codehandler to reboot your game with debugging mode if you crashed?
Would be very useful :D

And what does this do?
lfd f1, -2512 (r3)
My Wii hacking site...
http://bullywiihacks.com/

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

~Bully

megazig

loads a double into f1 from [r3 - 2512]

note: the world needs to use hex. dec is just getting old

dcx2

@Bully,

Most of the time, if you crash, you can recover.  It's just tricky.  If you're using Gecko.NET, then you have to hit at least one breakpoint before crashing.  I'm not sure why that's required, but it is.  I usually use Next with BPNext checked on About tab to satisfy this requirement, but any breakpoint will work.

Next, if you cause a crash,  hit Step Into on the Breakpoint tab.  Crashes are actually breakpoints; that's why you can Step Into and change registers and such.  You should see offending ASM and register dump appear.

Most of the time you'll crash on a load or store that's using a bad pointer.  If you know and/or can figure out the right pointer, you can change the register.  Then you can hit Run, and your game should un-crash.

Sometimes other things can go wrong, though, and the instruction pointer ends up in "no man's land"; i.e. it took a wrong branch or something.  You can go to the Disassembly tab, right click the "right" address (assuming you know it, or can make a good guess), and click "Set SRR0 here" (which only works during breakpoints), and the Breakpoint tab will automatically aim itself at the new instruction.  This can help you recover from some more "advanced crashes" lol

---

lfd = Load Float Double.  You may have noticed that Gecko.NET refers to floats as Singles all the time.  This is because "float" is actually a few different things, and Gecko.NET specifies in particular single precision floats, which are 32-bits.  That's why the ASM usually says lfs stfs etc.

Double precision floats are 64-bits aka "double word", so you need to look at consecutive words in Memory Viewer.  They also parse quite differently from singles, because they have a larger exponent bit field.  How 1.0 = 0x3F800000 in single precision but 0x3FF00000 00000000 in double precision.

There's very little support for doubles in Gecko.NET, except in the ASM step log where all 64 bits are recorded in the log.

---

@megazig, the assembler defaults to showing decimal displacement operands, so I don't mind the dec too much.  What gets me are hex numbers without 0x prefix.  The only exception to that is an address, which is explicitly hex.

heh heh...why do programmer's celebrate Christmas and Halloween at the same time?  [spoiler]Because Dec 25 = Oct 31[/spoiler]

Bully@Wiiplaza

Quote from: dcx2 on December 11, 2010, 10:37:40 PM
@Bully,

Most of the time, if you crash, you can recover.  It's just tricky.  If you're using Gecko.NET, then you have to hit at least one breakpoint before crashing.  I'm not sure why that's required, but it is.  I usually use Next with BPNext checked on About tab to satisfy this requirement, but any breakpoint will work.

Next, if you cause a crash,  hit Step Into on the Breakpoint tab.  Crashes are actually breakpoints; that's why you can Step Into and change registers and such.  You should see offending ASM and register dump appear.

Most of the time you'll crash on a load or store that's using a bad pointer.  If you know and/or can figure out the right pointer, you can change the register.  Then you can hit Run, and your game should un-crash.
yeah if I crashed, I set a breakpoint and it shows me an instruction which had a bad pointer like 7F12345 or 00123456.
But when I found it, I don´t know which value I must put there to recover the game :-[
I put any 80 adress there, then the game had another instruction with a bad value, it never ended ???
My Wii hacking site...
http://bullywiihacks.com/

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

~Bully

dcx2

That is the trick to recovering from a bad pointer crash.  You need to know the right value.  If you put the wrong value in, you just go from one bad pointer to the next.

Sometimes, if you look at the ASM above the bad load/store, you can see where the pointer came from.

BTW, the crash sets the breakpoint for you.  All you need to do is press Step Into once it has already crashed.

Nutmeg

@wiiztec- hex is a shorter way to write binary.  All computers and wiis are just made up of a bunch of "yes" and "no" functions portrayed as 1 and 0.  Hex is used used to write a big line of binary, into something that is easier to understand.  Instead of 4 digits, it's only one.  (Hence, 2^4 = 16)  Oct is the "half-way" step.  Instead of 1 digit for every 4 binary digits, like hex, it is 1 digit for every 3 binary digits.  (Hence, 2^3 = 8) I'm sure Gecko OS could have been written to handle oct codes rather than hex codes.  If you look at gamecube codes, they are not written in hex.

After all that:  It has no use if hex is an option to use (when wouldn't it be? lol)... Hex is more efficient and just as easy to understand.
I'm inbetween your legs... that's not awkward.

James0x57

#6
Octal is most commonly seen for showing the change mode (chmod - for permissions, etc) on files and directories. ..at least, that's where /I've/ seen it the most. =P


It all depends on what base is most useful for displaying the data. You could say that ASCII is a base-256 view of data, for another example.



edit:
@Nutmeg GCN codes are encrypted, when decrypted, we use hex just like all other codes =)