mirror of
https://github.com/radareorg/radare2.git
synced 2025-02-07 14:19:06 +00:00
![pancake](/assets/img/avatar_default.png)
Fix all opcode constructions listed in t/test.arm Add 'hlt' opcode for arm. Minor changes in arm disassembly output Typing !#number you re-run the command in !history !history is now listed (! is an alias) Added API to access history from dietline
48 lines
818 B
Bash
Executable File
48 lines
818 B
Bash
Executable File
#!/bin/sh
|
|
|
|
AS=arm
|
|
|
|
foo() {
|
|
A=$(rasm2 -a arm -b ${BITS} "$1")
|
|
B=$(rasm2 -d -a arm -b ${BITS} "$A" | cut -d ';' -f 1 | sed -e 's,\ *$,,g')
|
|
if [ "${1}" = "${B}" ]; then
|
|
printf "OK %s %20s %20s\n" "$A" "$B" "$1"
|
|
else
|
|
printf "FAILED %s %20s %20s\n" "$A" "$B" "$1"
|
|
fi
|
|
}
|
|
|
|
if [ -n "$1" ]; then
|
|
foo "$1"
|
|
exit 0
|
|
fi
|
|
|
|
|
|
BITS=32
|
|
# arm32
|
|
foo 'bkpt 0x0000'
|
|
foo 'svc 0x1024'
|
|
foo 'hlt 0x1024'
|
|
foo 'hlt 0x1234'
|
|
#foo 'cmp r7, 1338'
|
|
#foo 'cmp r7, 666'
|
|
foo 'cmp r7, 0xfe'
|
|
foo 'cmp r7, 0x20'
|
|
foo 'tst r4, r5' # e1140505
|
|
foo 'tst r4, r5, lsl 10' # e1140505
|
|
foo 'cmp r1, r2'
|
|
foo 'cmp r1, r2, lsl r3'
|
|
foo 'cmp sl, fp, lsl r3'
|
|
foo 'cmp sl, fp, ror r1'
|
|
foo 'mvn r4, 0x21' # e3e04020
|
|
foo 'add r2, r2, r1'
|
|
foo 'mov r2, 0x21'
|
|
foo 'mov r2, 0x21'
|
|
foo 'sub r1, r3, r3'
|
|
foo 'push {r1, r2}'
|
|
foo 'bx r3'
|
|
foo 'blx r4'
|
|
|
|
# thumb
|
|
BITS=16
|