WiiRd forum

Wii & Gamecube Hacking => WiiRD Remote Debugger => Topic started by: Link on August 17, 2008, 09:00:01 AM

Title: ASM Helper tool
Post by: Link on August 17, 2008, 09:00:01 AM
Well, I decided to write a little helper tool for people who like doing Assembler related codes. As many of you know the WiiRd code system allows you to write assembler code you can add into your game in real-time (C2/D2 codes - or in the code type document: CT6 --> CST1 ).

And well, it was kinda hard to do these kinda codes in my eyes.. writing assembly code.. save as text file.. runnning commands like (turns in.txt in out.bin):

powerpc-gekko-as.exe -mregnames -o source.o in.txt
powerpc-gekko-ld.exe -Ttext 0x80000000 -o source2.o source.o
powerpc-gekko-objcopy.exe -O binary source2.o out.bin

And then.. copy the contents of out.bin from a hex editor in a code, then count the lines, set the address and maybe it works.

So I decided to work on that..

http://wiird.l0nk.org/asmwiird.zip (253 KB)...

There is no readme.. this post will be the readme:

when you open the application it will first recognize that it can't find the assemblers/disassemblers and it will ask you for your WiiRd foldere as the assemblers/disassemblers can normally be found there:

(http://wiird.l0nk.org/doc/asm1.png)

(http://wiird.l0nk.org/doc/asm2.png)

if you have the Windows version of DevkitPro or DevkitPPC, you can also select the bin folder of it.. otherwise selecting the WiiRd folder should also do fine if you didn't trim it down! If the folder does not contain the required files, you'll be warned again however, the application will start. You can still change your work directory using the Settings menu. The work directory will be stored in a simple INI file!

You'll be greated by a very simple interface:

(http://wiird.l0nk.org/doc/asm3.png)

On the left side you can add your own PPC assembly code.. in the address box you enter the address where to link in the code. Then you click on "Tools" - "ASM -> WiiRd" or the arrow to the right and your code will be converted if it is valid, otherwise you'll see assembler issues:

Proper code:
http://wiird.l0nk.org/doc/asm4.png

Invalid code:
http://wiird.l0nk.org/doc/asm5.png

You can also disassemble code.. simply add a code (the last found C2/C3 gets auto-detected) and click the arrow to the left or select "Tools" - "WiiRd -> ASM" and your code will be disassembled:

http://wiird.l0nk.org/doc/asm6.png

I hope this app is of some use for people here!

Bug reports welcome, feature requests only to a certain extent!

Link
Title: ASM Helper tool
Post by: Lunar on August 17, 2008, 09:20:56 AM
Very nice.
Title: ASM Helper tool
Post by: Cross1955 on August 17, 2008, 07:45:44 PM
Awesome! this is cool tool.
When the ASM code is made, I'm helped by this tool.
Title: ASM Helper tool
Post by: James0x57 on August 17, 2008, 10:49:02 PM
OMG, DO WANT!

Thank you man! :D Very nice ^_^
...if only you had this out a week ago. *points at TP v2 USA master code*
lol
Title: ASM Helper tool
Post by: Nuke on August 18, 2008, 03:49:16 AM
great stuff Link, will add this to the site today, once I have sorted out the forum.
Title: ASM Helper tool
Post by: Black_Wolf on August 21, 2008, 10:08:06 AM
umm just a little question, what would be the appropriete way to find the address you want the asm to hook into? does it matter, like will it create a hook at that address, or do you need to locate your own through a breakpoint or reference etc?
Title: ASM Helper tool
Post by: brkirch on August 21, 2008, 11:05:24 AM
It is a great tool for ASM codes, thanks for making it!  :love
I was about to suggest that something needs to be added to make calculating branch instructions offsets easier, but then noticed that labels are supported. :)

Quote from: Black_Wolf;6389umm just a little question, what would be the appropriete way to find the address you want the asm to hook into? does it matter, like will it create a hook at that address, or do you need to locate your own through a breakpoint or reference etc?

You will need to locate the address to use yourself (usually using read and/or write breakpoints) and also you will have to figure out yourself what registers are safe to use.  The important thing that the insert ASM codetype does for you is memory management; the memory location for the ASM is determined by the cheat engine as are the branch instructions to and from the inserted ASM.  The only problem with this is that you have to use the CTR register if you want to branch to any game code, because you won't be able to use a relative offset for a branch instruction.
Title: ASM Helper tool
Post by: Black_Wolf on August 22, 2008, 06:57:17 AM
ah, so its probably easier to just use the code types, and if that not possible, to use the asm injection?
Title: ASM Helper tool
Post by: Power Marshall on September 01, 2008, 01:09:11 PM
Awesome, now I can get help with this tool!
God bless you, Link! ;)
Title: ASM Helper tool
Post by: REDSOXROX on September 01, 2008, 03:42:01 PM
Thank you Link!
Although I still don't fully uderstand ASM codes:(
Title: ASM Helper tool
Post by: Power Marshall on September 01, 2008, 03:44:04 PM
Me either! :lol:
But I'll learn... :)
Title: ASM Helper tool
Post by: REDSOXROX on September 01, 2008, 06:12:19 PM
Quote from: Power Marshall;9050Me either! :lol:
But I'll learn... :)

Looks like a good place to learn (http://www.usbgecko.com/codetypes.htm)
Title: ASM Helper tool
Post by: Power Marshall on September 01, 2008, 07:51:41 PM
It does! :)
Title: ASM Helper tool
Post by: quadra on September 02, 2008, 06:16:35 PM
nice work link