C# USB Gecko handler

Started by Link, August 06, 2009, 06:42:16 PM

Previous topic - Next topic

Panda On Smack

1 error I have found is if you reload codes from the saved gct file. Sometimes this also corrupts the gct file and you lose the codes you had

Something that I started to build into my mini version was a log of activity, anything that happens is logged in a textfield with basic details so if you poke or dump or search the relevant details are kept with a time stamp.

Often in WiiRd I end up having a notepad file open so i can keep a list of details I have been using

So i dont suggest things you have planned do you have a todo list? Right click menu in the Memory Viewer Tab for example

Thanks Link, its great to be able to see how it all works now in VS

Link

Quote from: hetoan2 on November 20, 2009, 11:32:31 AM
Looks nice Link :D

Love the Watchlist feature :D thanks.

Not that you have to do this, but it'd be nice if you could change the game ID midgame. Say if you use rebooter, just force it to recheck the first 8 bits to re-get the game ID. Just for the sake of organization.

Click the reconnect button.. the reconnect does a complete reinitialization it also reads a new game id.. I am not sure if it would update the code list or the watch list (most likely not) but it will certainly get the new game id.

Quote from: Panda On Smack on November 20, 2009, 01:26:16 PM
1 error I have found is if you reload codes from the saved gct file. Sometimes this also corrupts the gct file and you lose the codes you had

Something that I started to build into my mini version was a log of activity, anything that happens is logged in a textfield with basic details so if you poke or dump or search the relevant details are kept with a time stamp.

Often in WiiRd I end up having a notepad file open so i can keep a list of details I have been using

So i dont suggest things you have planned do you have a todo list? Right click menu in the Memory Viewer Tab for example

Thanks Link, its great to be able to see how it all works now in VS

Yeah, I wonder what's the issue there.. it sometimes does not seem to properly store codes (they are already lost internally).. I am going into deeper checks though. The memory viewer will CERTAINLY get a right click even.. the following parts are planned to go in:

-Upload a bin file
-Break point
-Watchlist (which will also go into the search tab)
-Disassembler

Poke is not planned as poke is already in the memory viewer tab!

Romaap

Quote from: Link on November 21, 2009, 06:59:24 AM
Quote from: hetoan2 on November 20, 2009, 11:32:31 AM
Looks nice Link :D

Love the Watchlist feature :D thanks.

Not that you have to do this, but it'd be nice if you could change the game ID midgame. Say if you use rebooter, just force it to recheck the first 8 bits to re-get the game ID. Just for the sake of organization.

Click the reconnect button.. the reconnect does a complete reinitialization it also reads a new game id.. I am not sure if it would update the code list or the watch list (most likely not) but it will certainly get the new game id.

Quote from: Panda On Smack on November 20, 2009, 01:26:16 PM
1 error I have found is if you reload codes from the saved gct file. Sometimes this also corrupts the gct file and you lose the codes you had

Something that I started to build into my mini version was a log of activity, anything that happens is logged in a textfield with basic details so if you poke or dump or search the relevant details are kept with a time stamp.

Often in WiiRd I end up having a notepad file open so i can keep a list of details I have been using

So i dont suggest things you have planned do you have a todo list? Right click menu in the Memory Viewer Tab for example

Thanks Link, its great to be able to see how it all works now in VS

Yeah, I wonder what's the issue there.. it sometimes does not seem to properly store codes (they are already lost internally).. I am going into deeper checks though. The memory viewer will CERTAINLY get a right click even.. the following parts are planned to go in:

-Upload a bin file
-Break point
-Watchlist (which will also go into the search tab)
-Disassembler

Poke is not planned as poke is already in the memory viewer tab!
You could do something like I was planning to do, a new (small) window for small functions that are pretty important.
Like poke could be on a new window so you can always use it, like in the tools tab a button for show poke window.

Panda On Smack

Something else to keep in mind is that that actual App diocesan have to be the same size as WiiRd, i have no problem with it increasing in size a bit with some extra tabs or common items always at the bottom in any tab

Link

So far I wouldn't know what to add when it comes to more tabs.. a Pointer Search will certainly not come bundled as I already mention in the application. While pointer searching is very cool and an important feature, I seriously feel it would be better off in an external application.. including it would mean you could only do a pointer search while being connected to a game.. and judging deep pointer searches (such as dual or triple pointers) take very long it would be quite tedious!

biolizard89

Quote from: Link on August 06, 2009, 06:42:16 PM
It's done:

http://l0nk.org/GeckoHandler.zip

contains:
-Gecko interface to handle all communcation between PC and Wii - this is a port of the Delphi interface which is used by the WiiRD console. It is completely compatible and not better or worse. WiiRD implements it, that's what you need to do, I do not provide example code (yet)!
-documentation which contains some code snippets for examples! But again: no runnable application!

requires:
-FTDI .NET wrapper at http://www.ftdichip.com/Projects/CodeExamples/CSharp.htm
Hi Link,

In the C# code I see the following in the Dump function:
UInt64 GeckoMemRange = ByteSwap.Swap((UInt64)(((UInt64)startdump << 32) + ((UInt64)enddump)));

This implies to me that the start and end addresses are swapped before sending the data to the USB Gecko.  I think this is different from the C implementation that Nuke posted a while back, in which the bytes for each address were reversed but the start and end addresses were not swapped (i.e. he swapped the endianness for 2 32-bit ints rather than 1 64-bit int).  Which is correct?  (I'm using a modified version of Nuke's C code, and I seem to be crashing the Wii on a regular basis, so I'm wondering if that's my error or if I have a different problem).

Thanks!

Link

To make it short.. BOTH is correct.. the USB Gecko buffers commands, it doesn't matter if you send them in pieces or as one big chunk.. Nuke sends the start address and the end address seperately as Big Endian integers..

The USB Gecko expects the start address in the following format:

[startadress big endian] [end address big endian]

So a dump from 80000000 to 80400000 would be:
80 00 00 00 40 00 00 00

What nuke does.. he has two 32 bit integers: 80000000 and 80400000 which are stored in little endian:
00 00 00 80 and 00 00 40 80 --> then he swaps the first:

80 00 00 00 --> and sends it to the USB Gecko.. then he swaps the second:
80 40 00 00 --> and sends that one to the USB Gecko.. WiiRd sends both together in one 64 bit block..

It internally stores them as a 64 bit integer.. notice again: Little endian!
80000000 << 32 + 80400000 = 8000000080400000

In memory this is stored like: 00 00 40 80 00 00 00 80
Then it performs a 64 bit byte-swap: the out come is:
80 00 00 00 80 40 00 00

Exactly what we want!

ichfly

I want to make a pointer search so i want to know if this is right. The pointer is a U32Int at on memory addres wich is betwean 80000000 and 818000000 so i can sort them wich can be an pointer and which can`t (to make  a faster scan) and some games add a registers as offset.
sorry for bad english

working on pointer search(new version 35% ready) so I won`t make codes yet.

Link

Quote from: ichichfly on December 06, 2009, 09:19:22 PM
I want to make a pointer search so i want to know if this is right. The pointer is a U32Int at on memory addres wich is betwean 80000000 and 818000000 so i can sort them wich can be an pointer and which can`t (to make  a faster scan) and some games add a registers as offset.

As long as you do not lose the actual address while sorting: Yes, that's working and quite a not so unintelligent way to speed up things!

Panda On Smack

Hi Link

Are you still making your app or have you taken it as far as you plan to?

ta

Link

Right now I am on break although I DO(!) want to continue.. some daily life shit came in my way like stupid stuff.. good that it's not long until I have Christmas break ^^

ichfly

O.K. I have some questions about the pointer again

1. Is it faster to make one dump and look what addreses can be the right pointer and than check if they are right with peek each addres adderes or dump it compleat again?

2. Are all pointer in MEM1 or can pointer be in other regions,too?
sorry for bad english

working on pointer search(new version 35% ready) so I won`t make codes yet.

Link

1. Dumping complete is the correct way.. peeking single addresses will take a VERY long time.. a peek is technically a true dump.. just a 4 byte dump.. but internally the dump function is always executed even for a tiny memory peek.

2. Pointers can be everywhere - so far the pointer search of WiiRd is only able to find pointers in one memory area (meaning pointers pointing from MEM1 into MEM2 are not possible although they are (unfortunately) quite likely.

ichfly

#43
O.k. my pointersearch is nearly ready to releas only one question can I use the class GlobalFunctions from the gecko dotNET Beta 0.2 or must i reprogramm it ?

What it can yet

search for pointers in 1 - 4 dumps (one is not realy save)
it is the fastest pointesearch for wii mem1 dumps
negative offset (on/off)
change maxoffset

what it can soon

sorting wich pointer are better
pointer level (can be edited)
anty online cheat function (need a while)
dump funktion
cross mem pointer funktion
code converter
possible pointer search
sorry for bad english

working on pointer search(new version 35% ready) so I won`t make codes yet.

Link

gecko dotNET is open source, all its functions and classes can be freely used without limitation as long as you also release your source codes (GPL)