用于生成cheat的代码和工具

This commit is contained in:
root 2023-01-28 22:20:17 +08:00
parent 4faf2e0e33
commit fae275e5c0
4 changed files with 40 additions and 0 deletions

View File

@ -0,0 +1,7 @@
#!/bin/bash
PATH=$PATH:/var/devkit/bin
arm-agb-elf-gcc -ffreestanding -nostdlib -nostartfiles -o /tmp/cht /var/asm/exec.s
arm-agb-elf-strip --strip-all /tmp/cht
arm-agb-elf-objdump -fd /tmp/cht
arm-agb-elf-objcopy -O binary -j .text /tmp/cht /tmp/cht.bin
mv /tmp/cht.bin /var/asm/cht.bin

View File

@ -0,0 +1,31 @@
.file "cheat.S"
.text
.align 4
.global _start
.type _start,function
_start:
add r0, r15, #0x28
.Lapply:
ldr r1, [r0], #4
cmp r1, #0
beq .Ldone
ldr r2, [r0], #4
and r3, r2, #255
mov r2, r2, lsr #8
.Lmemset:
strb r3, [r1], #1
subs r2, r2, #1
bne .Lmemset
b .Lapply
.Ldone:
bx r14
.cheat:
.long 0x0200234e
.long 0x00000180
.long 0x0

Binary file not shown.

2
tools/cheat-builder/makebin.sh Executable file
View File

@ -0,0 +1,2 @@
#!/bin/bash
docker run -it --rm -v /root/3ds/devkit/gbatool/devkitadv:/var/devkit -v /root/3ds/devkit/gbatool/asm:/var/asm i386/debian:buster-slim bash /var/asm/build.sh