rizin/test/db/archos/linux-x64/dbg_step
NOT XVilka ba8c170852
Migrate from Capstone to Zydis (x86 architecture) (#5164)
* Added build files [Capstone to Zydis]

* x86 Analysis [Capstone to Zydis]

* Changed x86 RzIL [Capstone to Zydis]

* Changed asm and arch files [Capstone to Zydis]

* Compilation, build error and test fixes [Capstone to Zydis]

* Test changes [Capstone to Zydis]

* Remaining changes [Capstone to Zydis]

* Added BE support [Capstone to Zydis]

---------

Co-authored-by: tushar3q34 <tushar3q34@gmail.com>
2025-05-23 13:03:46 +00:00

303 lines
3.8 KiB
Text

NAME=dbg.step
FILE=/bin/ls
ARGS=-d
CMDS=<<EOF
.dr*
s rip
f+ a @ rip
wx 90
pi 1 # hack this shouldnt be here
ds
.dr*
%v rip-a
EOF
EXPECT=<<EOF
nop
0x1
EOF
RUN
NAME=dbg.symbols
FILE=/bin/ls
ARGS=-d
CMDS=<<EOF
id~?
EOF
EXPECT=<<EOF
0
EOF
RUN
NAME=dso over a breakpoint
FILE=/bin/ls
ARGS=-d
CMDS=<<EOF
dr rax=rip > /dev/null
%vi rax-rip
db @ rip
dso
%vi rax-rip~?^0$
EOF
EXPECT=<<EOF
0
0
EOF
RUN
NAME=ds on jmp reg
FILE=bins/elf/analysis/x86-jmpeax
ARGS=-b 32 -a x86 -d
CMDS=<<EOF
dcu main
5ds
dr eip
EOF
EXPECT=<<EOF
eip = 0x080483d0
EOF
RUN
NAME=ds on calls and jumps
FILE=bins/elf/analysis/calls_x64
ARGS=-a x86 -d
CMDS=<<EOF
wao nop @ 0x00400529
dcu main
2ds
dr rip
2ds
dr rip
2ds
dr rip
ds
dr rip
2ds
dr rip
2ds
dr rip
ds
dr rip
ds
dr rip
dc
EOF
EXPECT=<<EOF
rip = 0x000000000040052f
rip = 0x000000000040053c
rip = 0x0000000000400549
rip = 0x000000000040054f
rip = 0x000000000040055b
rip = 0x0000000000400567
rip = 0x000000000040056e
rip = 0x0000000000400510
EOF
REGEXP_FILTER_ERR=<<EOF
Process exited[ a-zA-Z0-9=]+
EOF
EXPECT_ERR=<<EOF
Process exited with status=0x0
EOF
RUN
NAME=dso on call 1
FILE=bins/elf/analysis/calls_x64
ARGS=-a x86 -d
CMDS=<<EOF
wao nop @ 0x00400529
dcu main
ds
dr rip
dso
dr rip
EOF
EXPECT=<<EOF
rip = 0x0000000000400575
rip = 0x000000000040057c
EOF
RUN
NAME=dso on call 2
FILE=bins/elf/analysis/calls_x64
ARGS=-a x86 -d
CMDS=<<EOF
wao nop @ 0x00400529
dcu main
3ds
dr rip
dso
dr rip
EOF
EXPECT=<<EOF
rip = 0x0000000000400539
rip = 0x000000000040053b
EOF
RUN
NAME=dso on call 3
FILE=bins/elf/analysis/calls_x64
ARGS=-a x86 -d
CMDS=<<EOF
wao nop @ 0x00400529
dcu main
5ds
dr rip
dso
dr rip
EOF
EXPECT=<<EOF
rip = 0x0000000000400546
rip = 0x0000000000400548
EOF
RUN
NAME=dso on call 4
FILE=bins/elf/analysis/calls_x64
ARGS=-a x86 -d
CMDS=<<EOF
wao nop @ 0x00400529
dcu main
6ds
dr rip
dso
dr rip
EOF
EXPECT=<<EOF
rip = 0x0000000000400549
rip = 0x000000000040054e
EOF
RUN
NAME=dbg.dsu
FILE=bins/elf/analysis/calls_x64
ARGS=-a x86 -d
CMDS=<<EOF
dcu main
dsu 0x400546
dr rip
EOF
EXPECT=<<EOF
rip = 0x0000000000400546
EOF
RUN
NAME=dbg.dsui
FILE=bins/elf/analysis/calls_x64
ARGS=-a x86 -d
CMDS=<<EOF
dcu main
dsui mov eax
dr rip
EOF
EXPECT=<<EOF
0x00400575 7 call qword [0x600958]
0x0040052f 10 mov rax, 0x40053c
0x00400539 2 call rax
0x0040053c 10 mov rax, 0x600968
0x00400546 2 call qword [rax]
0x00400549 5 call 0x40054f
0x0040054f 10 mov rax, 0x40055b
0x00400559 2 jmp rax
0x0040055b 10 mov rax, 0x600980
0x00400565 2 jmp qword [rax]
0x00400567 7 jmp qword [0x600988]
0x0040056e 5 call 0x400510
0x00400510 10 mov rdi, 0x600954
0x0040051a 10 mov rsi, 0x600948
0x00400524 5 mov eax, 0x00
rip = 0x0000000000400524
EOF
RUN
NAME=dbg.dsui-2
FILE=bins/elf/analysis/calls_x64
ARGS=-a x86 -d
CMDS=<<EOF
dcu 0x00400574
dsi rax=2
dr rax
EOF
EXPECT=<<EOF
rax = 0x0000000000000002
EOF
RUN
NAME=dbg.dsuo
FILE=bins/elf/analysis/calls_x64
ARGS=-a x86 -d
BROKEN=1
CMDS=<<EOF
dsuo jmp
pi 1 @ rip~[0]
EOF
EXPECT=<<EOF
jmp
EOF
RUN
NAME=dbg.dsei
FILE=bins/elf/analysis/calls_x64
ARGS=-a x86 -d
BROKEN=1
CMDS=<<EOF
dcu main
aei
dsue 0,eax,==
dr rip
EOF
EXPECT=<<EOF
0x0000000000400529
Hello world
EOF
RUN
NAME=dbg.dss
FILE=bins/elf/analysis/calls_x64
ARGS=-a x86 -d
CMDS=<<EOF
dcu main
4dss
dr rip
EOF
EXPECT=<<EOF
rip = 0x0000000000400582
EOF
RUN
NAME=dbg.dcu can reach main
FILE=bins/elf/analysis/calls_x64
ARGS=-a x86 -d
CMDS=<<EOF
dcu main
%v $$
EOF
EXPECT=<<EOF
0x400574
EOF
RUN
NAME=seek follows after ds on 1-byte ins
FILE=bins/elf/analysis/calls_x64
ARGS=-d
CMDS=<<EOF
e dbg.follow=1
e asm.bytes=1
dcu main
dr r13=rip+1 # For Ubuntu 20.04
pd 2
s
ds
s
EOF
EXPECT=<<EOF
;-- main:
;-- rax:
;-- rip:
0x00400574 55 push rbp
;-- r13:
0x00400575 ff1425580960. call qword [loc.pnt_0] ; 0x600958 ; "/\U00000005@"
0x400574
0x400575
EOF
RUN