PyiiASMH

Started by hawkeye2777, December 28, 2009, 07:17:12 AM

Previous topic - Next topic

Romaap

VDAPPC is the program that does the conversion IIRC.

hawkeye2777

ASM to Hex: powerpc-eabi-as, powerpc-eabi-ld, powerpc-eabi-objcopy

Hex to ASM: vdappc

Correct me if I'm wrong. In this app, powerpc-eabi is supplied only due to the lack of powerpc-gekko tools for linux and OSX.
Currently "retired" from hacking codes.

giantpune

the "powerpc-gekko-" tools are all included in devkitPPC r17, at least for linux.  i think they changed to '"-eabi-" in r18 or 19.

dcx2

I believe this is consistent with our experience regarding the Paired Singles instructions that are specific to the Gekko architecture.  If you use the -mgekko switch with the powerpc-eabi-as it will recognize them.  Follow the thread starting here http://wiird.l0nk.org/forum/index.php/topic,4845.msg55322.html#msg55322

SouL

Thanks A LOT for this. Now I can code C2 easy. Time to start making ASM codes. :D

dcx2

I found a weird error.

If you have a comment with # and it starts with a number, PyiiASMH will stop at 35%.  So this will not work

# 0

And this will

# x0

hetoan2

i seriously was always wondering why it did that D:

although I'm pretty sure i've gotten this error in other places too inexplicably :(


Check out my site with codes obviously...
http://hetoan2.com/

and youtube...
http://youtube.com/hetoan2

dcx2

Another thing I noticed is that if I use a branch label without defining it (e.g. b _END with no _END: label anywhere else), PyiiASMH gets to 100%, and then...nothing happens.  It took me a while before I realized I was just missing a branch label.

hawkeye2777

#53
I'll check this out when I get a chance.

I may also try to update this in the future as well, possibly trying out a new GUI toolkit and porting this to Python 3.
Currently "retired" from hacking codes.

hawkeye2777

Alright, sorry for the really late reply - have been busy with other stuff I want to get done.

Quote from: dcx2 on May 22, 2011, 06:29:26 PM
I found a weird error.

If you have a comment with # and it starts with a number, PyiiASMH will stop at 35%.  So this will not work

# 0

And this will

# x0

This is not the case for me... can you tell me the version of Python, etc. that you are using? Both comments work just fine. Maybe if you gave a more elaborate example that doesn't work, I could try and figure it out.

Quote from: dcx2 on May 23, 2011, 11:29:20 PM
Another thing I noticed is that if I use a branch label without defining it (e.g. b _END with no _END: label anywhere else), PyiiASMH gets to 100%, and then...nothing happens.  It took me a while before I realized I was just missing a branch label.

I get the following output when doing that: "An error has occured; please try assembling again." From looking at my source, an IO error occurred, so something went wrong during the whole powerpc-eabi-as, powerpc-eabi-ld, and powerpc-eabi-objcopy process.

Hopefully once I start working on this again, I can implement much better error handling/checking than I currently have.
Currently "retired" from hacking codes.

dcx2

No problem man.  Other people have lives, too. ^_^

Here's the versions I'm using.

Python 2.6.5

PyQt4 ("PyQt-Py2.6-gpl-4.7.4-1.exe")

I'll try to come up with some more examples.  Also, it looks like sometimes when it disassembles, it doesn't create the right branch offsets..?  I'll make some examples that are meatier.

Bully@Wiiplaza

Quote from: dcx2 on July 23, 2011, 04:10:39 PM
I'll try to come up with some more examples.  Also, it looks like sometimes when it disassembles, it doesn't create the right branch offsets..?  I'll make some examples that are meatier.
yep.
I assembled a code and applied it....
freeze. LOL
ASMWiird gave a different offset and it didn´t freeze.
My Wii hacking site...
http://bullywiihacks.com/

My youtube account with a lot of hacking videos...
http://www.youtube.com/user/BullyWiiPlaza

~Bully

dcx2

It helps if you give him the code so he can see what went wrong...

hawkeye2777

Hmm, if you want, you can try the latest Python 2 release (2.7.2 at this time) and the latest PyQt to go with it. That's what I have on my computer at the moment.

I'm working on rewriting most of it though, so I may just wait until I get that finished to implement any bug fixes "officially".

Quote from: dcx2 on July 23, 2011, 04:10:39 PM
Also, it looks like sometimes when it disassembles, it doesn't create the right branch offsets..?  I'll make some examples that are meatier.

Yeah, I've seen that before... never really looked into it though. My guess is that Link's tool creates them properly?
Currently "retired" from hacking codes.

dcx2

For me, this C2 code disassembles differently in each app.

[spoiler=C2 code]C20A3DA4 00000009
A95E0048 3D80802D
A16CAED8 716B0400
41820034 A95E005A
896CAEDB 7D6B0774
7D6B1E70 7D4A5A14
2C0A270F 40810008
39400000 2C0A0000
40800008 3940270F
B15E005A 00000000
[/spoiler]

[spoiler=ASMWiiRD]lha r10,72(r30)
lis r12,-32723
lhz r11,-20776(r12)
andi. r11,r11,1024
beq- 0x34
lha r10,90(r30)
lbz r11,-20773(r12)
extsb r11,r11
srawi r11,r11,3
add r10,r10,r11
cmpwi r10,9999
ble- 0x08
li r10,0
cmpwi r10,0
bge- 0x08
li r10,9999
sth r10,90(r30)
[/spoiler]

[spoiler=PyiiASMH]lha r10,72(r30)
lis r12,-32723
lhz r11,-20776(r12)
andi. r11,r11,1024
beq- 0x0034
lha r10,90(r30)
lbz r11,-20773(r12)
extsb r11,r11
srawi r11,r11,3
add r10,r10,r11
cmpwi r10,9999
ble- 0x0034
li r10,0
cmpwi r10,0
bge- 0x0034
li r10,9999
sth r10,90(r30)
[/spoiler]

---

Also, the single line

# 0

still causes 35% stop, but there's the following message in the command line console


Traceback (most recent call last):
  File "F:\Wii\wiird\pyiiasmh-0.9.3-win32\PyiiASMH.py", line 249, in assemble
    numlines = ("%x" % ((len(asm.codelist) / 2) + 1, )).upper()
AttributeError: Assemble instance has no attribute 'codelist'

---

I updated to 2.7.2 and Qt for 2.7.  These problems still happen. =(

On the bright side, if I use undefined symbols in the assembler, it gives me an error now.