Kodewerx https://www.kodewerx.org/forum/ |
|
Custom ASM AR DS Codes https://www.kodewerx.org/forum/viewtopic.php?f=17&t=429 |
Page 1 of 1 |
Author: | DimondEdge [ Sun Dec 10, 2006 6:25 am ] |
Post subject: | Custom ASM AR DS Codes |
Yeah, in Kenobi's AR DS Codetypes thing, that Is possible, but how do you convert them. Like if I had: [code] mov r0, #0x099 ldr r1, 0x00000001 strb r0, [r1] ;Please ignore syntax errors, I'm doing this quickly [/code] how could I put that in AR format? Thanks! |
Author: | Parasyte [ Sun Dec 10, 2006 6:57 am ] |
Post subject: | |
Use an ARM assembler. I'm partial to GNU AS, which you can find in DevKitPro's DevKitAdv. |
Author: | DimondEdge [ Sun Dec 10, 2006 7:32 am ] |
Post subject: | |
I get this huge mass of data, and I can't figure out how much of it to use. My code [code]push {r0-r3} mov r0, #0x2700 ldr r1, =0x020da7ee strh r0, [r1] mov r2, #0x2700 ldr r3, =0x020da7f0 strh r2, [r3] pop {r0-r3}[/code] Looking at the disassembaly in IDA didn't help much, I'm using arm-eabi-as, too. Thanks De |
Author: | Dualscreenman [ Sun Dec 10, 2006 7:37 am ] |
Post subject: | |
Your BBcode isn't working; might want to check you don't have HTML enabled. ![]() |
Author: | kenobi [ Sun Dec 10, 2006 11:12 am ] |
Post subject: | |
I changed your asm code to : Code: push {r0,r1} mov r0, #0x2700 ldr r1, =0x020da7ee strh r0, [r1] add r1,#0x2 strh r0, [r1] pop {r0-r1} bx r14 Which gives, once 'translated' to asm : Code: E92D0003 E3A00C27 E59F1010 E1C100B0 E2811002 E1C100B0 E8BD0003 E12FFF1E 020DA7EE So the AR code should look like this : Code: E0000000 00000024
E92D0003 E3A00C27 E59F1010 E1C100B0 E2811002 E1C100B0 E8BD0003 E12FFF1E 020DA7EE 00000000 (and don't forget to use the hack's activator before it). |
Author: | DimondEdge [ Sun Dec 10, 2006 2:23 pm ] |
Post subject: | |
But how do you "translate" the asm? Just compiling it dosen't seem to work. |
Author: | Unknown [ Sun Dec 10, 2006 5:01 pm ] |
Post subject: | |
And while j'all on the subject, where do i learn me some o' this ASM? |
Author: | kenobi [ Sun Dec 10, 2006 10:58 pm ] |
Post subject: | |
DimondEdge wrote: But how do you "translate" the asm? Just compiling it dosen't seem to work.
I use no$gba debugger version. I mainly use it to hack stuff (as it has breakpoints support and stuff like that), but I also found it useful when it comes to making custom asm routines. I write my code 'on the fly' by manually entering the instructions which the debugger compiles automatically. Unfortunatly this proggy isn't free (the freeware version doesn't offer debugging features), so you have to 'buy' it for 15$. But I guess any free arm assembler will do the trick. |
Author: | Parasyte [ Mon Dec 11, 2006 11:10 am ] |
Post subject: | |
Parasyte wrote: Use an ARM assembler. I'm partial to GNU AS, which you can find in DevKitPro's DevKitAdv.
|
Author: | DimondEdge [ Mon Dec 11, 2006 2:16 pm ] |
Post subject: | |
kenobi wrote: I use no$gba debugger version. I mainly use it to hack stuff (as it has breakpoints support and stuff like that), but I also found it useful when it comes to making custom asm routines. I write my code 'on the fly' by manually entering the instructions which the debugger compiles automatically.
Unfortunatly this proggy isn't free (the freeware version doesn't offer debugging features), so you have to 'buy' it for 15$. But I guess any free arm assembler will do the trick. Cool! I actually just recived my copy, so I'll try it. Thanks! |
Author: | DimondEdge [ Mon Dec 11, 2006 4:08 pm ] |
Post subject: | |
I get to ldr r1, =0x020da7ee and it says paramiter fail. What's wrong? (no$gba) |
Author: | Dualscreenman [ Mon Dec 11, 2006 4:42 pm ] |
Post subject: | |
Parasyte (prediction) wrote: No$hitGBA sucks ass. Martin Kroth can go to hell.
|
Author: | caitsith2 [ Tue Dec 12, 2006 12:06 am ] |
Post subject: | |
DimondEdge wrote: I get to
ldr r1, =0x020da7ee and it says paramiter fail. What's wrong? (no$gba) Okay, somewhere down below, after your written code, assemble something like Code: mov r0, 0xFE mov r0, 0xFD mov r0, 0xFC Now, right beside the said assembled instructions will be the values they corrospond to. Code: E3A000FE
E3A000FD E3A000FC Now. Where you want ldr r1, =0x020DA7EE, first assemble ldr r1, =0xE3A000FE. Once you are done that, go back to the instruction, and reassemble it as ldr r1, =0x020DA7EE. This should take care of that problem. The big thing, is if you assemble by hand like this, you need to know how many instructions down you wish to do this, and load the mov r0, 0xFE, etc... there. (If your code actually does use mov r0, 0xFE, then don't use that as a planned data item, but rather, use some instruction not being used as code.) I have done this before, in manually writing smaller code segments. If you need to write a larger code segment, then you are better off using an assembler for this purpose. |
Author: | Parasyte [ Tue Dec 12, 2006 9:05 am ] |
Post subject: | |
You may be better off learning to use a real assembler, given such circumstances!! Parasyte wrote: Parasyte wrote: Use an ARM assembler. I'm partial to GNU AS, which you can find in DevKitPro's DevKitAdv. Dualscreenman wrote: Parasyte (prediction) wrote: No$hitGBA sucks ass. Martin Kroth can go to hell. |
Author: | DimondEdge [ Tue Dec 12, 2006 1:53 pm ] |
Post subject: | |
Parasyte wrote: You may be better off learning to use a real assembler, given such circumstances!!
I tried arm-eabi-as, I get a 3-400 byte output. Is there a flag or something to set? |
Author: | Parasyte [ Tue Dec 12, 2006 6:04 pm ] |
Post subject: | |
Assemble it like this: Code: arm-eabi-as -o source.o source.s arm-eabi-objcopy -O binary source.o source.bin Taking Kenobi's code for example (which is weird; he assembled it as ARM, when it looks more like Thumb), source.s will look something like this: Code: .text .org 0 .arm _start: stmfd sp!, {r0,r1} mov r0, #0x2700 ldr r1, =0x020DA7EE strh r0, [r1] strh r0, [r1,#2] ldmfd sp!, {r0,r1} bx lr .pool Or if you really do want Thumb: Code: .text
.org 0 .thumb _start: push {r0,r1} mov r0, #0x27 lsl r0, #8 ldr r1, =0x020DA7EE strh r0, [r1] add r1, #2 strh r0, [r1] pop {r0,r1} bx lr .align 2 .pool |
Author: | DimondEdge [ Tue Dec 12, 2006 6:20 pm ] |
Post subject: | |
Ah. Ok. Thanks for the help! |
Author: | Modman [ Wed Dec 13, 2006 12:12 am ] |
Post subject: | |
You won't find help like that anywhere else on the net. You know it, we know it, and you need to let everyone else know it too. |
Author: | DimondEdge [ Wed Dec 13, 2006 4:19 pm ] |
Post subject: | |
Hmz... I'm still not getting something... I've assembled it, but I don't know where to get the actual things kenobi was showing me. Am I missing something? Should I debug it with VBA or my Xport or something? |
Author: | Parasyte [ Wed Dec 13, 2006 6:10 pm ] |
Post subject: | |
open source.bin in a hex editor, like Hex Workshop. You then need to adjust the endianness (though this can probably be done by GNU AS, directly) which is a matter of byte swapping each 32-bit word. You can do this manually by hand, or through the tools menu in Hex Workshop. Finally, copy each of the 32-bit words, and write them into DS memory using the proper AR code types. And there you go. |
Author: | DimondEdge [ Fri Dec 15, 2006 8:18 pm ] |
Post subject: | |
My out put "source.bin" is Code: 03B427200002034908800231088003BC70470000EEA70D02
I cant find the byte swap thing in the tools. Also, changing to Big Endian, everything just stays the same... |
Author: | Parasyte [ Fri Dec 15, 2006 8:59 pm ] |
Post subject: | |
Tools -> Operations -> Byte Flip That appears to be Thumb binary, so you will want to byte flip as 16-bit, instead of 32-bit. |
Author: | DimondEdge [ Sat Dec 16, 2006 7:03 am ] |
Post subject: | |
So then I just use that with the ASM activator? Cool! |
Page 1 of 1 | All times are UTC - 8 hours [ DST ] |
Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |