radare2/test/db/anal/ppc

503 lines
7.9 KiB
Plaintext

NAME=ppc-asserts
FILE=bins/elf/powerpc-linux-gnu-symexec-palindrome
CMDS=<<EOF
%R2_DEBUG_ASSERT=1
aaa
?e done
EOF
EXPECT=<<EOF
done
EOF
RUN
NAME=ppc-aflm
FILE=bins/elf/analysis/elf-ppc-execstack
CMDS=<<EOF
aac
aflsa
aflm
EOF
EXPECT=<<EOF
sym._init:
loc.imp.__gmon_start__
fcn.100015e0
fcn.100264c0
fcn.100016d0:
sym.imp.abort
fcn.100016e0:
sym.imp.abort
fcn.100016f0:
sym.imp.memset
sym.imp.gelf_fsize
fcn.100017a0:
fcn.10001fd0
fcn.10001fd0:
sym.imp.strlen
fcn.10002d10
sym.imp.strcmp
sym.imp.sprintf
sym.imp.mkstemp
sym.imp.__strdup
sym.imp.vfork
sym.imp.waitpid
sym.imp.error
sym.imp.free
fcn.10003f90
sym.imp.unlink
sym.imp.close
fcn.10002660:
fcn.10006120
fcn.10004730
sym.imp.elf_getdata
fcn.1000f2d0
sym.imp.elf_getdata
fcn.10006120
fcn.10006120
sym.imp.gelf_xlatetof
fcn.1000f2d0
sym.imp.gelf_xlatetom
fcn.10006120
sym.imp.abort
fcn.10002ff0:
sym.imp.gelf_fsize
fcn.10002e00
fcn.10025f80
fcn.100030f0:
fcn.10003bc0
sym.imp.elf_getdata
fcn.10003230:
fcn.100030f0
sym.imp.elf_flagscn
fcn.100032c0:
fcn.100030f0
fcn.10003320:
fcn.100030f0
sym.imp.elf_flagscn
fcn.100033d0:
fcn.100030f0
fcn.10003450:
fcn.100030f0
sym.imp.elf_flagscn
fcn.100034d0:
fcn.100030f0
fcn.10003630:
fcn.100030f0
sym.imp.elf_flagscn
fcn.100036e0:
fcn.100030f0
fcn.10003770:
fcn.100030f0
fcn.10003820:
fcn.100030f0
sym.imp.elf_flagscn
fcn.100038d0:
fcn.100030f0
sym.imp.elf_flagscn
fcn.10003e40:
sym.imp.free
sym.imp.elf_getdata
sym.imp.elf_end
sym.imp.fsync
sym.imp.close
sym.imp.elf_end
sym.imp.close
sym.imp.free
sym.imp.free
sym.imp.free
sym.imp.free
sym.imp.free
sym.imp.free
sym.imp.free
fcn.10003f90:
sym.imp.unlink
fcn.10003e40
fcn.10003fe0:
sym.imp.getfilecon
sym.imp.setfilecon
sym.imp.freecon
fcn.10004390:
sym.imp.memset
sym.imp.elf_getdata
sym.imp.elf_getdata
sym.imp.gelf_getsym
fcn.10025b30
sym.imp.gelf_getsym
sym.imp.gelf_update_sym
sym.imp.gelf_getsym
sym.imp.gelf_update_sym
sym.imp.__assert_fail
sym.imp.__assert_fail
fcn.10004730:
fcn.10003ce0
sym.imp.gelf_update_ehdr
sym.imp.gelf_update_phdr
sym.imp.gelf_update_shdr
fcn.10004390
fcn.1000d780
fcn.10004880:
fcn.10004730
sym.imp.elf_update
fcn.100048e0:
fcn.10004880
sym.imp.strlen
sym.imp.memcpy
sym.imp.strlen
sym.imp.memcpy
sym.imp.__fxstat64
sym.imp.fchown
sym.imp.fchmod
fcn.10003e40
sym.imp.time
sym.imp.utime
fcn.10003fe0
sym.imp.rename
sym.imp.unlink
sym.imp.__errno_location
sym.imp.error
sym.imp.unlink
fcn.10005480:
sym.imp.gelf_fsize
fcn.10005a00:
sym.imp.elf_getdata
fcn.10025b30
sym.imp.gelf_getsym
sym.imp.gelf_update_sym
sym.imp.elf_getdata
sym.imp.elf_flagscn
fcn.10005cb0:
sym.imp.memset
sym.imp.elf_getdata
fcn.10025b30
sym.imp.gelf_getdyn
fcn.10006120:
sym.imp.elf_getdata
sym.imp.elf_getdata
fcn.10025b30
sym.imp.gelf_getdyn
sym.imp.gelf_update_dyn
sym.imp.elf_flagscn
sym.imp.__assert_fail
sym.imp.__assert_fail
fcn.10006480:
fcn.10025f80
sym.imp.gelf_update_phdr
sym.imp.error
fcn.10007380:
sym.imp.malloc
fcn.10007450:
sym.imp.strlen
sym.imp.sprintf
sym.imp.mkstemp
sym.imp.elf_begin
sym.imp.gelf_getclass
sym.imp.error
sym.imp.elf_end
sym.imp.unlink
sym.imp.close
sym.imp.free
sym.imp.__assert_fail
fcn.10008d80:
sym.imp.elf_begin
sym.imp.elf_kind
sym.imp.gelf_getehdr
sym.imp.malloc
sym.imp.elf_flagelf
sym.imp.memset
sym.imp.memcpy
sym.imp.gelf_getphdr
sym.imp.elf_getscn
sym.imp.gelf_getshdr
sym.imp.qsort
sym.imp.elf_getscn
sym.imp.gelf_getshdr
sym.imp.error
sym.imp.elf_end
fcn.10007380
sym.imp.memcpy
sym.imp.memcpy
sym.imp.close
sym.imp.__assert_fail
sym.imp.open
fcn.10008f70:
sym.imp.error
fcn.10009f00:
fcn.10002d10
sym.imp.strncmp
sym.imp.strcmp
sym.imp.elf_getdata
sym.imp.elf_getdata
sym.imp.__assert_fail
fcn.1000cbf0
sym.imp.malloc
fcn.1000cb20
sym.imp.error
fcn.1000c650
sym.imp.error
sym.imp.error
sym.imp.error
sym.imp.free
fcn.1000c650
sym.imp.error
sym.imp.error
sym.imp.__assert_fail
sym.imp.__assert_fail
fcn.1000b540:
fcn.1000c440
fcn.1000b8e0:
sym.imp.calloc
fcn.10025b30
fcn.1000cbf0
fcn.1000cbf0
fcn.1000cbf0
fcn.10025f80
sym.imp.error
fcn.1000c650
fcn.1000c650
fcn.1000c650
sym.imp.free
sym.imp.__assert_fail
sym.imp.calloc
sym.imp.error
fcn.1000c650:
sym.imp.free
sym.imp.free
fcn.1000cbf0:
fcn.1000c730
sym.imp.calloc
sym.imp.calloc
fcn.1000ce30:
sym.imp.memset
fcn.1000d410:
sym.imp.elf_getdata
sym.imp.elf_getdata
sym.imp.__assert_fail
sym.imp.__assert_fail
fcn.1000d780:
sym.imp.__assert_fail
fcn.1000e110:
fcn.1000d410
sym.imp.error
fcn.1000ef70:
sym.imp.__assert_fail
fcn.100139b0:
sym.imp.qsort
fcn.1001d690:
fcn.100033b0
EOF
RUN
NAME=ppc-elf
FILE=bins/elf/analysis/elf-ppc-execstack
CMDS=<<EOF
e asm.flags=false
pid 4
EOF
EXPECT=<<EOF
0x100014e0 7c290b78 mr r9, r1
0x100014e4 54210036 rlwinm r1, r1, 0, 0, 0x1b
0x100014e8 38000000 li r0, 0
0x100014ec 9421fff0 stwu r1, -0x10(r1)
EOF
RUN
NAME=ppc-elf entry0 name issue
FILE=bins/elf/analysis/elf-ppc-execstack
CMDS=<<EOF
?e
e asm.flags=true
pid 1
af
afi~name[1]
EOF
EXPECT=<<EOF
0x100014e0 section..text:
0x100014e0 7c290b78 mr r9, r1
entry0
EOF
RUN
NAME=ppc-elf relocs
FILE=bins/elf/analysis/elf-ppc-execstack
CMDS=<<EOF
s 0x10001500
pi 1
EOF
EXPECT=<<EOF
b sym.imp.__libc_start_main
EOF
RUN
NAME=ppc-update-suffix-esil
FILE=bins/elf/a6ppc.out
CMDS=<<EOF
aeim
40ds
dr?r3
dr?r4
10ds
dr?r3
dr?r4
EOF
EXPECT=<<EOF
0x00177fbf
0x10000107
0x00177fc1
0x1000010a
EOF
RUN
NAME=ppc-detect-vtables
FILE=bins/elf/ppc_classes
CMDS=<<EOF
av
EOF
EXPECT=<<EOF
Vtable Found at 0x100016d4
0x100016d4 : No Name found
0x100016d8 : No Name found
0x100016dc : No Name found
Vtable Found at 0x100016e8
0x100016e8 : No Name found
0x100016ec : No Name found
0x100016f0 : No Name found
Vtable Found at 0x100016fc
0x100016fc : No Name found
0x10001700 : No Name found
0x10001704 : No Name found
Vtable Found at 0x10001710
0x10001710 : No Name found
0x10001714 : No Name found
0x10001718 : No Name found
0x1000171c : No Name found
0x10001720 : No Name found
Vtable Found at 0x1000172c
0x1000172c : No Name found
0x10001730 : No Name found
0x10001734 : No Name found
0x10001738 : No Name found
0x1000173c : No Name found
Vtable Found at 0x10001748
0x10001748 : No Name found
0x1000174c : No Name found
0x10001750 : No Name found
0x10001754 : No Name found
0x10001758 : No Name found
Vtable Found at 0x10001764
0x10001764 : No Name found
0x10001768 : No Name found
0x1000176c : No Name found
EOF
RUN
NAME=aoj f0ff2194
FILE=-
CMDS=<<EOF
e asm.arch=ppc
e asm.bits=64
wx f0ff2194
aoj~{}
EOF
EXPECT=<<EOF
[
{
"opcode": "stwu r1, -0x10(r1)",
"disasm": "stwu r1, -0x10(r1)",
"pseudo": "word[r1 - 0x10] = r1",
"description": "Store Word with Update",
"mnemonic": "stwu",
"mask": "ffffffff",
"esil": "r1,-16,r1,+,=[4],-16,r1,+=",
"sign": false,
"id": 1072,
"opex": {
"operands": [
{
"type": "reg",
"value": "r1"
},
{
"type": "mem",
"base": "r1",
"disp": -16
}
]
},
"addr": 0,
"bytes": "f0ff2194",
"size": 4,
"type": "store",
"esilcost": 12,
"cycles": 0,
"failcycles": 0,
"delay": 0,
"stack": "inc",
"stackptr": 16,
"family": "cpu"
}
]
EOF
RUN