Gecko dotNET Bugs and Requests

Started by Mal1t1a, January 19, 2010, 12:08:54 AM

Previous topic - Next topic

Bully@Wiiplaza

Quote from: dcx2 on April 02, 2011, 07:42:11 PM
So I went ahead and got myself that USB loader you were talking about.  I repeated my test with Wii Play and Super Mario Galaxy.  No crashes.
I feel dumb now, why does it happen to me?
What about a little video ::)
My Wii hacking site...
http://bullywiihacks.com/

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

~Bully

dcx2

You can try to debug the crash.

First, before causing the crash, make sure that you have hit at least one breakpoint.  A good one to try is an EXBP on 800018A8, which is the first instruction of the code handler.  Once you have set at least one breakpoint, you can hit run again.  I don't know why, but this step is required for debugging crashes.

Once you cause a crash, immediately switch to the BP tab.  Press the Step Into button (and ONLY that button, nothing else).  You should hopefully see the registers and assembly for the crash.  Usually, it's a bad pointer...like a lwz r0,0(r3) and r3 = 00000000.

Also, look in the Logs folder, for a file that was written to today.  It's a text file; inside of it, you should see timestamped lines.  Is there an entry for when your crash occurs?

Bully@Wiiplaza

well the problem is that if I switch from gct codes to mem. viewer at loading screens,
the game makes the beep sound and geckodotnet disconnects from the game and won´t reconnect either (therefore, setting breakpoints won´t work) Then it throws "Received an invalid reply from USB Gecko. Do you want to reconnect"
If I press no, it asks me a few more times till it stops and if it´s yes, it tells me "Connection to the gecko failed, retry?"
Anyway, it´s not that important, I can also use an older geckodotnet for example.
My Wii hacking site...
http://bullywiihacks.com/

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

~Bully

dcx2

#378
I think you misunderstood me.  You do not set a breakpoint after the crash.  If you go to the BP tab and press Step Into *immediately* after a crash, it will sometimes get the crash data.  Also, you might want to try unplugging the USB Gecko from the PC and plugging it back in again, before reconnecting.

Or you could just...not switch to MemView when stuff is loading.

---

I recommend against older versions.  There is a bug in how the code handler dumps memory, sometimes inserting an extra byte, and this offset causes searches to fail.  Because it's in the code handler, it affects all versions, Gecko.NET or WiiRDGUI.

You can verify this for yourself; pause the game so the memory cannot change, and do repeated unknown-equal searches.  You should always get 6,291,456 results for MEM1 or 13,631,488 for MEM2 (it doesn't dump all 64MB of MEM2 because I think the upper part is protected).  But if you keep equals searching for long enough, you'll start getting fewer and fewer results, even though the game is paused.

Older versions of Gecko.NET usually make a very large dump; an extra byte will cause all the search results to shift, so if it hits early it will corrupt a whole search.  On average, if it strikes in the middle it ruins 12MB of data on a MEM1 dump.  Worst case is all 24MB.

WiiRDGUI dumps in 1MB chunks.  If a byte gets corrupt, it only interferes with the last bit of that chunk.  On average, if it strikes in the middle, it only ruins 512kB of memory.  Worst case is 1 MB.  If you open the WiiRD console, you can even see which chunk got corrupted.

0.64.4 begins verifying that the dump transferred without any extra bytes (it also dumps in 1MB chunks, too).  If it finds a corrupted byte, it is fixed.  I think on average, there's a corrupted byte for me every 150 MB or so; sometimes more, sometimes less.

Bully@Wiiplaza

that makes perfectly sence.
But I have the feeling that the search became slower due to the verification, is it true?
If no adresses are lost and no searches will be deleted, that´s worth it.
My Wii hacking site...
http://bullywiihacks.com/

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

~Bully

dcx2

If you look very carefully at the Search label during a dump, it says "Dumping...", but every now and then you'll see it blip for a split second to something else.  It's so fast you can't even see it.  It says "Verifying..."; I put the label there in case verification would cause a crash, you would know it crashed due to verification and not something else.

So yes, it is slower, but you wouldn't notice it without using a watch.

Arudo

Is there anyway for the Gecko dotNET to save previous settings for the memory viewer?

Sometimes I have a tendency to forget to change the search there from ANSI to hex, then I get annoyed when I don't find anything and realize I did something stupid.
-Crazy Hacker Hates You All (definitely)-

ノಠ益ಠ)ノ彡â"»â"â"»

Do NOT PM me about Code Requests

Pro-tip: Hit the Applaud Button

Oh? Failed to read the rules? You're already dead.

dcx2

Yes, it can store settings to an XML config file.  It should already store some, like the addresses for breakpoints and memview and disasm.  Just let me know what others you want to be persistent.  I'll make the memview Search Type persistent in the next release.

By the way, I don't know if you realized, but the top-left corner of memview will tell you what chunk of memory is being dumped.

And 0.64.5+ can add words to the memview Search if you shift click on a cell.  The shift click will also automatically change the search mode to hex for you.  You can shift click multiple cells to form longer searches.  Great for porting with dumps.

Arudo

Well, I just downloaded the 0.64 one. I kind of forgot that you guys update it from time to time.

Looks good so far.
-Crazy Hacker Hates You All (definitely)-

ノಠ益ಠ)ノ彡â"»â"â"»

Do NOT PM me about Code Requests

Pro-tip: Hit the Applaud Button

Oh? Failed to read the rules? You're already dead.

dcx2

Make sure you have 0.64.6.  There's a bug in the dumping that causes corrupted searches...it affects old version of Gecko.NET pretty severely, and it even affects WiiRDGUI to a degree.  New versions of Gecko.NET scan the dump to make sure there wasn't an error.

dcx2

There are three links in my sig.  Make sure you're using the one that can be found via "latest test build" link.

Arudo

-Crazy Hacker Hates You All (definitely)-

ノಠ益ಠ)ノ彡â"»â"â"»

Do NOT PM me about Code Requests

Pro-tip: Hit the Applaud Button

Oh? Failed to read the rules? You're already dead.

strakn

I have two different problems with 0.64.6

One problem happens on my vista machine but not on my win7 machine

The other happens on my win7 machine but not on my vista machine.

On Vista, If I try to do a search, it stops at 4%, the game freezes/breaks, it just says verifying, and then connection to usb gecko is lost and it keeps asking me to try to recconnect. This problem does not happen on my win7 machine, searching works great now using win7.

This is the error log that gecko.net spits out when this happens.

[spoiler]05/04/2011 11:35:03 AM: Opened log
11:35:03 AM: Exception occured!
Exception: FTDIUSBGecko.EUSBGeckoException
FTDIInvalidReply
Message: Exception of type 'FTDIUSBGecko.EUSBGeckoException' was thrown.
Stack Trace:
   at FTDIUSBGecko.USBGecko.sendfail(EUSBErrorCode error)
   at FTDIUSBGecko.USBGecko.Dump(UInt32 startdump, UInt32 enddump, Stream[] saveStream, Dump memdump)
   at GeckoApp.MemSearch.VerifyDump(Dump checkDump, Int32 leftIndex, Int32 rightIndex)
   at GeckoApp.MemSearch.SafeDump(UInt32 startdump, UInt32 enddump, Dump memdump)
   at GeckoApp.MemSearch.PerformBlockSearch(Dump blockDump, List`1 dumpranges)
   at GeckoApp.MemSearch.SearchRefactored(UInt32 sAddress, UInt32 eAddress, List`1 comparisons, SearchSize searchSize)
   at GeckoApp.MainForm.Search_Click(Object sender, EventArgs e)
Inner Exception:
11:35:28 AM: Exception occured!
Exception: FTDIUSBGecko.EUSBGeckoException
FTDICommandSendError
Message: Exception of type 'FTDIUSBGecko.EUSBGeckoException' was thrown.
Stack Trace:
   at FTDIUSBGecko.USBGecko.sendfail(EUSBErrorCode error)
   at FTDIUSBGecko.USBGecko.Dump(UInt32 startdump, UInt32 enddump, Stream[] saveStream, Dump memdump)
   at FTDIUSBGecko.USBGecko.Dump(UInt32 startdump, UInt32 enddump, Stream saveStream)
   at GeckoApp.MemoryViewer.RedirectableDump(UInt32 startAddress, UInt32 endAddress, Stream dumpStream)
Inner Exception:
11:35:32 AM: Exception occured!
Exception: FTDIUSBGecko.EUSBGeckoException
FTDIInvalidReply
Message: Exception of type 'FTDIUSBGecko.EUSBGeckoException' was thrown.
Stack Trace:
   at FTDIUSBGecko.USBGecko.sendfail(EUSBErrorCode error)
   at FTDIUSBGecko.USBGecko.Dump(UInt32 startdump, UInt32 enddump, Stream[] saveStream, Dump memdump)
   at FTDIUSBGecko.USBGecko.Dump(UInt32 startdump, UInt32 enddump, Stream saveStream)
   at GeckoApp.MainForm.CUSBGecko_Click(Object sender, EventArgs e)
Inner Exception:
11:35:33 AM: Exception occured!
Exception: FTDIUSBGecko.EUSBGeckoException
FTDIInvalidReply
Message: Exception of type 'FTDIUSBGecko.EUSBGeckoException' was thrown.
Stack Trace:
   at FTDIUSBGecko.USBGecko.sendfail(EUSBErrorCode error)
   at FTDIUSBGecko.USBGecko.Dump(UInt32 startdump, UInt32 enddump, Stream[] saveStream, Dump memdump)
   at FTDIUSBGecko.USBGecko.Dump(UInt32 startdump, UInt32 enddump, Stream saveStream)
   at GeckoApp.MainForm.CUSBGecko_Click(Object sender, EventArgs e)
Inner Exception:
11:35:53 AM: Exception occured!
Exception: FTDIUSBGecko.EUSBGeckoException
FTDICommandSendError
Message: Exception of type 'FTDIUSBGecko.EUSBGeckoException' was thrown.
Stack Trace:
   at FTDIUSBGecko.USBGecko.sendfail(EUSBErrorCode error)
   at FTDIUSBGecko.USBGecko.Dump(UInt32 startdump, UInt32 enddump, Stream[] saveStream, Dump memdump)
   at FTDIUSBGecko.USBGecko.Dump(UInt32 startdump, UInt32 enddump, Stream saveStream)
   at GeckoApp.MemoryViewer.RedirectableDump(UInt32 startAddress, UInt32 endAddress, Stream dumpStream)
Inner Exception: [/spoiler]

On win7 machine, If I am in memory viewer and have auto update checked, after a few seconds the game freezes/breaks, connection to usb gecko is lost and cannot reconnect. This problem does not happen on my vista machine.

This is the error log that gecko.net gives for this problem.

[spoiler]05/04/2011 11:43:36 AM: Opened log
11:43:36 AM: Exception occured!
Exception: FTDIUSBGecko.EUSBGeckoException
FTDIInvalidReply
Message: Exception of type 'FTDIUSBGecko.EUSBGeckoException' was thrown.
Stack Trace:
   at FTDIUSBGecko.USBGecko.sendfail(EUSBErrorCode error)
   at FTDIUSBGecko.USBGecko.Dump(UInt32 startdump, UInt32 enddump, Stream[] saveStream, Dump memdump)
   at GeckoApp.MemSearch.SafeDump(UInt32 startdump, UInt32 enddump, Dump memdump)
Inner Exception:
11:44:00 AM: Exception occured!
Exception: FTDIUSBGecko.EUSBGeckoException
FTDIReadDataError
Message: Exception of type 'FTDIUSBGecko.EUSBGeckoException' was thrown.
Stack Trace:
   at FTDIUSBGecko.USBGecko.sendfail(EUSBErrorCode error)
   at FTDIUSBGecko.USBGecko.Dump(UInt32 startdump, UInt32 enddump, Stream[] saveStream, Dump memdump)
   at GeckoApp.MemSearch.SafeDump(UInt32 startdump, UInt32 enddump, Dump memdump)
Inner Exception:
11:44:57 AM: Exception occured!
Exception: FTDIUSBGecko.EUSBGeckoException
FTDIInvalidReply
Message: Exception of type 'FTDIUSBGecko.EUSBGeckoException' was thrown.
Stack Trace:
   at FTDIUSBGecko.USBGecko.sendfail(EUSBErrorCode error)
   at FTDIUSBGecko.USBGecko.Dump(UInt32 startdump, UInt32 enddump, Stream[] saveStream, Dump memdump)
   at FTDIUSBGecko.USBGecko.Dump(UInt32 startdump, UInt32 enddump, Stream saveStream)
   at GeckoApp.MemoryViewer.RedirectableDump(UInt32 startAddress, UInt32 endAddress, Stream dumpStream)
Inner Exception:
11:45:00 AM: Exception occured!
Exception: FTDIUSBGecko.EUSBGeckoException
FTDIInvalidReply
Message: Exception of type 'FTDIUSBGecko.EUSBGeckoException' was thrown.
Stack Trace:
   at FTDIUSBGecko.USBGecko.sendfail(EUSBErrorCode error)
   at FTDIUSBGecko.USBGecko.Dump(UInt32 startdump, UInt32 enddump, Stream[] saveStream, Dump memdump)
   at FTDIUSBGecko.USBGecko.Dump(UInt32 startdump, UInt32 enddump, Stream saveStream)
   at GeckoApp.MainForm.CUSBGecko_Click(Object sender, EventArgs e)
Inner Exception:
11:45:01 AM: Exception occured!
Exception: FTDIUSBGecko.EUSBGeckoException
FTDIInvalidReply
Message: Exception of type 'FTDIUSBGecko.EUSBGeckoException' was thrown.
Stack Trace:
   at FTDIUSBGecko.USBGecko.sendfail(EUSBErrorCode error)
   at FTDIUSBGecko.USBGecko.Dump(UInt32 startdump, UInt32 enddump, Stream[] saveStream, Dump memdump)
   at FTDIUSBGecko.USBGecko.Dump(UInt32 startdump, UInt32 enddump, Stream saveStream)
   at GeckoApp.MainForm.CUSBGecko_Click(Object sender, EventArgs e)
Inner Exception:
11:45:01 AM: Exception occured!
Exception: FTDIUSBGecko.EUSBGeckoException
FTDIInvalidReply
Message: Exception of type 'FTDIUSBGecko.EUSBGeckoException' was thrown.
Stack Trace:
   at FTDIUSBGecko.USBGecko.sendfail(EUSBErrorCode error)
   at FTDIUSBGecko.USBGecko.Dump(UInt32 startdump, UInt32 enddump, Stream[] saveStream, Dump memdump)
   at FTDIUSBGecko.USBGecko.Dump(UInt32 startdump, UInt32 enddump, Stream saveStream)
   at GeckoApp.MainForm.CUSBGecko_Click(Object sender, EventArgs e)
Inner Exception:
11:45:04 AM: Exception occured!
Exception: FTDIUSBGecko.EUSBGeckoException
FTDIInvalidReply
Message: Exception of type 'FTDIUSBGecko.EUSBGeckoException' was thrown.
Stack Trace:
   at FTDIUSBGecko.USBGecko.sendfail(EUSBErrorCode error)
   at FTDIUSBGecko.USBGecko.Dump(UInt32 startdump, UInt32 enddump, Stream[] saveStream, Dump memdump)
   at FTDIUSBGecko.USBGecko.Dump(UInt32 startdump, UInt32 enddump, Stream saveStream)
   at GeckoApp.MainForm.CUSBGecko_Click(Object sender, EventArgs e)
Inner Exception:
11:45:05 AM: Exception occured!
Exception: FTDIUSBGecko.EUSBGeckoException
FTDIInvalidReply
Message: Exception of type 'FTDIUSBGecko.EUSBGeckoException' was thrown.
Stack Trace:
   at FTDIUSBGecko.USBGecko.sendfail(EUSBErrorCode error)
   at FTDIUSBGecko.USBGecko.Dump(UInt32 startdump, UInt32 enddump, Stream[] saveStream, Dump memdump)
   at FTDIUSBGecko.USBGecko.Dump(UInt32 startdump, UInt32 enddump, Stream saveStream)
   at GeckoApp.MainForm.CUSBGecko_Click(Object sender, EventArgs e)
Inner Exception:
11:45:05 AM: Exception occured!
Exception: FTDIUSBGecko.EUSBGeckoException
FTDIInvalidReply
Message: Exception of type 'FTDIUSBGecko.EUSBGeckoException' was thrown.
Stack Trace:
   at FTDIUSBGecko.USBGecko.sendfail(EUSBErrorCode error)
   at FTDIUSBGecko.USBGecko.Dump(UInt32 startdump, UInt32 enddump, Stream[] saveStream, Dump memdump)
   at FTDIUSBGecko.USBGecko.Dump(UInt32 startdump, UInt32 enddump, Stream saveStream)
   at GeckoApp.MainForm.CUSBGecko_Click(Object sender, EventArgs e)
Inner Exception:
11:45:06 AM: Exception occured!
Exception: FTDIUSBGecko.EUSBGeckoException
FTDIInvalidReply
Message: Exception of type 'FTDIUSBGecko.EUSBGeckoException' was thrown.
Stack Trace:
   at FTDIUSBGecko.USBGecko.sendfail(EUSBErrorCode error)
   at FTDIUSBGecko.USBGecko.Dump(UInt32 startdump, UInt32 enddump, Stream[] saveStream, Dump memdump)
   at FTDIUSBGecko.USBGecko.Dump(UInt32 startdump, UInt32 enddump, Stream saveStream)
   at GeckoApp.MainForm.CUSBGecko_Click(Object sender, EventArgs e)
Inner Exception:
11:45:16 AM: Exception occured!
Exception: FTDIUSBGecko.EUSBGeckoException
FTDICommandSendError
Message: Exception of type 'FTDIUSBGecko.EUSBGeckoException' was thrown.
Stack Trace:
   at FTDIUSBGecko.USBGecko.sendfail(EUSBErrorCode error)
   at FTDIUSBGecko.USBGecko.Dump(UInt32 startdump, UInt32 enddump, Stream[] saveStream, Dump memdump)
   at FTDIUSBGecko.USBGecko.Dump(UInt32 startdump, UInt32 enddump, Stream saveStream)
   at GeckoApp.MemoryViewer.RedirectableDump(UInt32 startAddress, UInt32 endAddress, Stream dumpStream)
Inner Exception:
[/spoiler]

dcx2

The game pauses at the beginning of a search in order to prevent memory from changing when it starts dumping the next block.  If the search does not complete, it will not unpause.  It is not really frozen.

The FTDIInvalidReply during FTDIUSBGecko.USBGecko.Dump() means that something with the connection to the USB Gecko broke in some probably unrecoverable way.

The cascade of SendError's and InvalidReply's are failed attempts to re-establish connection to the USB Gecko.

Does this happen reproducibly at the 4% marker?  Sounds like the first block transferred okay (16 packets of ~63k each).  It proceeded to verify the dump, which involves dumping a mere two bytes.  And then started to fail.  I would be surprised if this happens repeatably at the same point.  How about a MEM2 search?

---

For the second one, there is some confusion.  You said it breaks during Memory Viewer.  But there are no calls from Memory Viewer in the log.  [spoiler=excessive technical details]It says that SafeDump was called...but there are only two ways to call SafeDump; called by PerformBlockSearch when searching, as in the first error log, or dumping on the tools tab.  But I don't see the event handler for the Tools' dump button.  For that matter, I don't see any event handler.  How was SafeDump called?  It can't just call itself...maybe it was called from within an exception handler, which explains the missing stack trace?[/spoiler]

This time we got another invalid reply, but during the main dump instead of during verification.  It's odd that it's the same type of error as before, just at a different time.

Why are you getting all of these invalid replies?  Have you tried unplugging the USB Gecko from the PC, waiting for the device removal to complete (Windows will ding), and then reconnecting it?

strakn

Quote from: dcx2 on April 05, 2011, 04:52:02 PM

Does this happen reproducibly at the 4% marker?  Sounds like the first block transferred okay (16 packets of ~63k each).  It proceeded to verify the dump, which involves dumping a mere two bytes.  And then started to fail.  I would be surprised if this happens repeatably at the same point.  How about a MEM2 search?

For mem1 it happens everytime at 4%, once the connection is lost, i can not reconnect, unpluging and replugging the usb cable does not help,and am forced to reboot the wii.

For mem2 it happens at 2%, i was able to reconnect and unpause the game, but the search fields were all greyed out so i had to close/reopen gecko.net, to try again. Same thing at 2% again

Quote from: dcx2 on April 05, 2011, 04:52:02 PM
For the second one, there is some confusion.  You said it breaks during Memory Viewer.  But there are no calls from Memory Viewer in the log. 
I am not sure, all I do is put it on memory viewer, and within 3 seconds of ticking auto-update, the game pauses and then disconnects.
It also does this if auto-update is not ticked but I click the scroll bar area quickly to change pages.

Quote from: dcx2 on April 05, 2011, 04:52:02 PM
Why are you getting all of these invalid replies?  Have you tried unplugging the USB Gecko from the PC, waiting for the device removal to complete (Windows will ding), and then reconnecting it?
I do this anytime I get a disconnection, I almost always have to do this if the usb cable is plugged in before I start gecko.net, it tells me there is no connection try again, so I have to unplug it, plug it back in click yes then it works.