WiiRd forum

USB Gecko Related => USB Gecko Dev => Topic started by: giantpune on December 19, 2009, 02:23:41 AM

Title: Source Code for gecko engine (wii side)?
Post by: giantpune on December 19, 2009, 02:23:41 AM
I am looking for the source code for the kenobiwii handler which is copied into wii memory by the wii before a game is started.  specifically i want to see what needs to be done to get homebrew to boot with it.  i have tried a few different things and i cant get everything to work like it should.i really dont care if its the new or old engine, since i really dont need 8000 lines of cheat codes.  i just want to view the memory and take screenshots (and cheat at homebrew games).
Title: Re: Source Code for gecko engine (wii side)?
Post by: Link on December 19, 2009, 06:58:13 AM
http://code.google.com/p/usbgecko/source/browse/trunk/Gecko_src/code%20handler/codehandler.s

http://code.google.com/p/geckodownloads/downloads/list

That's the code handler.. it does not say though how it is included into game code, it will give you an idea though about the handler itself!
Title: Re: Source Code for gecko engine (wii side)?
Post by: giantpune on December 19, 2009, 07:05:03 PM
damn.  i was hoping for c or c++.  looks like its time for me to learn a bit of asm.
Title: Re: Source Code for gecko engine (wii side)?
Post by: Romaap on December 20, 2009, 02:18:55 AM
ASM is fairly easy if you have experience with other programming languages.
Title: Re: Source Code for gecko engine (wii side)?
Post by: giantpune on December 20, 2009, 05:58:49 AM
well, im half way there.  i got a function to dump the framebuffer or to convert it to a png and dump it if the project is linked with pngu.  now for that pesky memory viewing...
Title: Re: Source Code for gecko engine (wii side)?
Post by: brkirch on December 20, 2009, 06:59:26 PM
The code for debugging homebrew is already mostly there, you just need to:
1. Set "Gecko Pause Start" to "YES".
2. Use geckoload.exe to transfer a DOL executable to Gecko OS.
3. Use WiiRD to manually hook the DOL executable.

You will probably need to disassemble the homebrew executable on your PC to find a good location to hook from, but if you have access to the source code for the homebrew you want to debug then I would recommend compiling it and using the ELF file for finding the memory address to hook from and the DOL file for loading onto the Wii.  The reason there isn't a hook for homebrew yet is because there are a lot of variations between the code generated from different versions of devkitpro so it is difficult to find code that is common between all homebrew executables and executes often.
Title: Re: Source Code for gecko engine (wii side)?
Post by: conanac on December 23, 2009, 04:11:32 AM

I am also interested to learn this. Does anyone have an example how to find memory address in a wiibrew application to put a hook from (the last step in brkirch posting)? I have developed wiibrew applications: e.g. turnip and DiiLC, and it would be nice if I could run them through geckoos and then be able to take screenshots or seeing how the applications run within geckoos.

Thanks in advance.