C# USB Gecko handler

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

Previous topic - Next topic

Link

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

Romaap

Thanks.
I don't think I'll be able to make anything productive but i'll look into it :D

Panda On Smack


giantpune

has anything been made of this yet?  i'd like to see a new and improved version of wiird that uses this.

Link

#4
Quote from: giantpune on October 30, 2009, 09:06:07 AM
has anything been made of this yet?  i'd like to see a new and improved version of wiird that uses this.

Write it.. all functionality of WiiRd is in that little file! I developed it for that.. and it's very unlikely I write it! It has a documentation, it has commented code and I spent hours of porting that because so many people requested it.. to all who still read this: I am utterly depressed how I wasted my time! Sorry to say this! I spent like 50 hours of that piece of code!

I never expected anyone to write a WiiRd copy.. however: I would have been happy myself to just see some use.. even if people just use the code for a simple search tool or something else simple.. no need to reinvent the wheel. Just to show: hey guys, I used it. Nothing to be emberrassed about. But that way.. seeing how nobody seemed to use it..

Panda On Smack

Aww man

This is dedicated to you Link:



When I get more things working i will upload a file, just dumps as per your demo in the txt file


USBGecko gecko = new USBGecko();
gecko.Connect();
FileStream save = new FileStream("data.bin",FileMode.OpenOrCreate);
gecko.Dump(0x80000000,0x80400000,save);
save.Close();
gecko.Disconnect();

Link

Epic.. now it just doesn't respect the contents of the "To" and "From" boxes ;)

Panda On Smack

#7
Heh, took me ages to realise this:

UInt32 From = Convert.ToUInt32(textBox1.Text, 16);

What's the deal in packaging the DLL along with the exe?

http://rapidshare.com/files/300212061/Link.rar.html

Needs the FTD2XX_NET.dll file to be in the same folder. Wasn't sure if I can redistribute this?

It's built in Visual Studio 2008. Version 3.5 of .NET



Got lots of questions but initially how do I use chunkUpdate? I don't understand where to get the data from to pass to it. Is something happening when I call gecko.Dump for me to tap into and read?

Link

Quote from: Panda On Smack on October 30, 2009, 07:11:06 PM
Got lots of questions but initially how do I use chunkUpdate? I don't understand where to get the data from to pass to it. Is something happening when I call gecko.Dump for me to tap into and read?

chunkUpdate is used like a button event or so.. you click the button and the click event gets fired. During dumping the chunkUpdate event is fired to keep you up to date how far the dump has processed.

You create a function called:

void update(UInt32 currentchunk, UInt32 allchunks, UInt32 transferred, UInt32 length, bool fail);

then you connect that function to your USBGecko object.
gecko.chunkUpdate = update;

Now whenever the USBGecko receives new data it will fire the update function.

The parameters are as follows:

currentChunk = a dump or upload is seperated into packets (chunks). This is the number of the package it just transferred!
allchunks = how many packets are to be expected
transferred = how many bytes have already been transferred
length = How many bytes are gonna be transferred totally
fail = False if the last attempted package it tried to transfer failed - after 3 fails it will give up (WiiRd for example shows a / on the console when a package transfer fails..)
     = True if the last attempted package transferred correctly (WiiRd shows a . )

Link

And self-reply:

I also now for demonstration uploaded another Gecko demonstration application:
http://l0nk.org/GCTSend.7z

That one sends code data! It is kinda unfinished (drag & drop of codes does not fully work) but it's good for demonstration. What it does? Simply type in codes (it can't save) and send them to the console. It will create a cheat stream which is sent to the Gecko.

I should note it has the most user friendly code input ever :p you can type in whatever you like in the code field. It will parse the input string and extract digits and A-F - all other characters are ignored - if the parsed string is a multiple of 16 it accepts it!

Panda On Smack

Cheers mate

I hope to have the time to create something that can do as much as WiiRd but short term will try and get all the main things done

Bit of a learning curve

Link

Yeah, that's one of the reasons I made up that cheat code generator.. it's a little more complicated but gives people the idea how it could be used!

Romaap

#12
What a coincidence, I've been trying to make a WiiRDGUI replacement too in C#.
But the only downside is that i can't get it to search fast enough :(
But I have a "watchlist" :)
The update speed of the watchlist is customizable. :D

I will upload a "beta version" when i get that stupid search faster, it works but it takes really long when you have a lot of results.

[spoiler]


[/spoiler]

I have just one question, how does WiiRDGUI search?

Link

WiiRd GUI does a normally search by loading all dumps into a memory stream.. the main speed aspect is: kenobi is an assembly programmer and such.. and this is how his programs look like.. he does very basic operations very close to CPU and he certainly never heard of oop which C# enforces. And thus, as his code gets additionally directly translated to x86 assembly and .NET "only" to IL which runs in interpreted mode there is another speed reason there

Link

Again a self-reply..

I was also working on a kinda concept of a .NET GUI.. which is supposed to be a kinda copy of WiiRd GUI.. of course as I spent 4 days on it so far (4 week days where I had to work besides additionally) it isn't even a shadow of WiiRd GUI.. still it shows the direction we might be heading.

[spoiler]
[/spoiler]

@Romaap: I'd happily exchange information with you if you plan to continue your work - if you have IMs or so, PM me with details ^^