Skip to content
Permalink
Browse files

attempt at a 32 bit stmia bot. not supported in ESIL though

  • Loading branch information...
anisse committed Sep 7, 2019
1 parent 56998e3 commit b21d3658b5337c75aa3038b9488b7031ee7dfea3
Showing with 40 additions and 0 deletions.
  1. +16 −0 Makefile
  2. +24 −0 bot21-32.asm
@@ -8,13 +8,23 @@ all: bot1 bot2 bot3 bot4 bot5 bot6 rasm rasm2
%.elf: %.asm
aarch64-linux-gnu-as $< -o $@

%-32.bin: %-32.elf
arm-linux-gnu-objcopy -O binary $< $@

%-32.elf: %-32.asm
arm-linux-gnu-as $< -o $@

bot%: bot%.bin
rax2 -S < $< > $@

run%: bot%
sed -e "s/bot./$</" script > script.gen
r2 -i script.gen malloc://1024

run%-32: bot%-32
sed -e "s/bot./$</" -e "s/bits = 64/bits = 32/" script > script.gen
r2 -i script.gen malloc://1024

rasm%: bot%.rasm
rasm2 -f $< > $@
diff bot$* $<
@@ -25,6 +35,12 @@ bot%.rasm: bot%
echo ".bits 64" >> $<.rasm
cat $< | fold -w8 | sed -e 's/^/.hex /' >> $@

bot%-32.rasm: bot%
echo "# Anisse Astier" > $<.rasm
echo ".arch arm" >> $<.rasm
echo ".bits 32" >> $<.rasm
cat $< | fold -w8 | sed -e 's/^/.hex /' >> $@


# Not working
#runrasm%: rasm%
@@ -0,0 +1,24 @@
# Anisse Astier
#.arch arm
#.bits 32
sub r1, r1, #1
mov r2, r1
mov r3, r1
mov r4, r1
mov r5, r1
mov r6, r1
mov r7, r1
mov r8, r1
mov r9, r1
mov r10, r1
mov r11, r1
mov r12, r1
mov r13, r1
mov r14, r1
stmib r0!, {r1-r3}
stmia r0!, {r1-r15}
stmia r0!, {r1-r15}
stmia r0!, {r1-r15}
stmia r0!, {r1-r15}
stmia r0!, {r1-r15}
stmia r0!, {r1-r15}

0 comments on commit b21d365

Please sign in to comment.
You can’t perform that action at this time.