Codes
WiiRd forum
March 28, 2024, 09:01:47 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Welcome on the new server

Update 4.3 - do NOT update!
Gecko 1.9.3.1
Should I get a USB Gecko, I wanna hack?
How do I use my USB Gecko
Where can I get WiiRd?
 
   Home   CODE DATABASE GAMEHACKING Help Search Login Register  
Pages: [1]
  Print  
Author Topic: USB Gecko C# example  (Read 6734 times)
Nuke
Hacker
Hero Member
*****

Karma: 53
Posts: 661


« on: June 09, 2009, 04:06:25 AM »

Hi,

for those who code in C# here is a USB Gecko code example project i coded, this shows how to use the ftdi chip in C#

It was my first ever program written in C#, so go easy on me Smiley

love the language though and think its great for GUI stuff.

http://www.usbgecko.com/newrip.zip

project was made/compiled in visual studio 2005, but should import to any version higher

Logged

0xFFFFFFuuuuuuu
REDSOXROX
Sum Miles Christi
Hacker
Hero Member
*****

Karma: 24
Posts: 785


RSR


« Reply #1 on: June 09, 2009, 11:08:28 PM »

It worked fine in my Visual Studio C# 2008 Ed.
The program looks really nice Cheesy
Does it work yet? My guess would be in the Gecko menu?

I started learning C# awhile ago, I also really like it for GUI, I haven't been able to program for awhile though angry
Logged

Red Sox vs. Yankees 4/4/2k10 Season Opener
Red Sox: 9 Yankees: 7 Final!
Link
that dev there
Moderator
Hero Member
*****

Karma: 76
Posts: 1254

I hate everyone in this community. Except for you!


WWW
« Reply #2 on: June 10, 2009, 08:55:54 AM »

I was thinking some time ago.. I did learn C# some time ago. WiiRd uses one communication library to communicate with the USB Gecko. This library does everything (usbgecko.pas) - I guess I could port this to C# if there is interest though!
Logged

Panda On Smack
Hacker
Hero Member
*****

Karma: 39
Posts: 606


« Reply #3 on: June 10, 2009, 06:51:35 PM »

I'm interested!

ta
Logged
Link
that dev there
Moderator
Hero Member
*****

Karma: 76
Posts: 1254

I hate everyone in this community. Except for you!


WWW
« Reply #4 on: June 22, 2009, 12:38:47 PM »

So well.. I finally had some time to recheck the code.. well, C# progress is fine.. I implemented the core functions and already one user function.. which is a complicated one: the dump!

right now its syntax would be:

Code:
public void Dump(UInt32 startdump,UInt32 enddump, Stream saveStream) { }

So a basic call would be Dump(0x80000000,0x80400000,fileToSaveTo);

The reason I went for dump is simple. It is a quite complicated, yet absolutely important function. It has the strongest communication part with the Wii console:
  • Reset buffers
  • Announce dump command (send 1 byte 04 to the USB Gecko)
  • Wait for the reply (should be 1 byte - and AA = Acknowledge)
  • Send the memory range to dump in Big Endian to the console: a valid message would be 80 00 00 00 80 40 00 00 = dump from 80000000 to 80400000)
  • wait for ackowledge
  • Now packages are split.. package size of each max package is 63488 bytes (3968 for upload). So the download has to be splitted into packages of maximally 63488 bytes
  • Get a package
  • Check its length - if invalid: retry the package (send BB = retry to console) - after 3 retries give up (send FF to abort dumping)
  • if invalid transfer status reply: give up (Send FF)
  • if length okay and no status error: ackowledge package: send AA
  • Next package or finish if all packages done

So well.. that's the truth behind the dump command for those who didn't know it.. and well..that command being a core command is working. If anyone wants to get a glance at the current communication library with the dump example. Sure!
Logged

Nuke
Hacker
Hero Member
*****

Karma: 53
Posts: 661


« Reply #5 on: July 02, 2009, 07:11:19 AM »

The biggest thing i'd like to see is the debugger improved, rewrote to C#.

How about i come up with some bounty source thing, so we can make this happen and i fund it?

I want to try pick up USB Gecko, and i think the only way i can do this, is either hire coders so i can focus on support or do it as a collaboration community thing and i fund it.

i'm open to suggestions.
Logged

0xFFFFFFuuuuuuu
Nuke
Hacker
Hero Member
*****

Karma: 53
Posts: 661


« Reply #6 on: July 15, 2009, 09:20:00 AM »

made a start on this now.
Logged

0xFFFFFFuuuuuuu
Panda On Smack
Hacker
Hero Member
*****

Karma: 39
Posts: 606


« Reply #7 on: July 15, 2009, 09:52:33 AM »

Nice one!
Logged
Nuke
Hacker
Hero Member
*****

Karma: 53
Posts: 661


« Reply #8 on: July 15, 2009, 03:22:12 PM »

btw Link if you finished that function, i'd be happy to put it on the new site as an example of using C# with USB Gecko.

Logged

0xFFFFFFuuuuuuu
Link
that dev there
Moderator
Hero Member
*****

Karma: 76
Posts: 1254

I hate everyone in this community. Except for you!


WWW
« Reply #9 on: July 16, 2009, 10:58:39 AM »

Sure, I'll get the code asap (when I am at home)
Logged

Nuke
Hacker
Hero Member
*****

Karma: 53
Posts: 661


« Reply #10 on: July 20, 2009, 04:35:45 AM »

thanks buddy.
Logged

0xFFFFFFuuuuuuu
Link
that dev there
Moderator
Hero Member
*****

Karma: 76
Posts: 1254

I hate everyone in this community. Except for you!


WWW
« Reply #11 on: July 20, 2009, 05:33:47 AM »

Contains dump function.. I hope I'll get around porting more functions but for now that's it!

http://l0nk.org/GeckoTest.7z
Logged

Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!