WiiRd forum

Wii & Gamecube Hacking => Wii Game hacking help => Topic started by: Bully@Wiiplaza on September 16, 2010, 10:24:25 PM

Title: Find the invalid code?
Post by: Bully@Wiiplaza on September 16, 2010, 10:24:25 PM
Hey guys,
my question is, how I can find the C2 code/whatever else code, which is freezing my game, when I perform a specific action, if there are about 10 C2 codes activ (in my case), from which 1 only SHOULD do the freeze! I don´t want to freeze and try single adresses till I found it out, is there a good way to "Debug C2 codes" here? :eek: Thanks for answers, some instructions would be good! :)
Title: Re: Find the invalid code?
Post by: dcx2 on September 17, 2010, 12:47:41 AM
I suggest conducting a binary search by hand.  Only use half the codes; if you freeze, then the code is in one of the ones you used.  If you don't freeze, it's one of the ones you didn't use.  Then you take the half that has the freezing code, and split it in half again, and repeat the process.  It should only take about 3 tries before you find the freezing code.

You can also debug C2 codes.  You need to set an execute breakpoint just before the hook, and then once that BP is hit, then apply the codes, and then go back to the breakpoint tab and repeatedly step.  You can then step through your code during its first execution.

Also, if you freeze, you can try hitting Step Into on the breakpoint tab.  It might show you what instruction you're freezing on.
Title: Re: Find the invalid code?
Post by: Bully@Wiiplaza on September 18, 2010, 12:25:58 AM
oh yes, I thought about this aswell, but now it´s clear :P