radare2/test/db/cmd/cmd_meta

621 lines
16 KiB
Plaintext

NAME=Cf. crash
FILE=-
CMDS=<<EOF
Cf.
EOF
EXPECT=<<EOF
EOF
RUN
NAME=vars commenting
FILE=malloc://1024
CMDS=<<EOF
e asm.arch=x86
e asm.bits=64
s 0x10
af
afvb 8 arg_8h int
afvb -8 var_8h uint32_t
afvs 8 var_sp_8h uint32_t
afvr rax var_rax uint64_t
Cvb 0x8 comment for arg_8h
Cvb -8 comment for var_8h
Cvr var_rax comment for var_rax
Cvs var_sp_8h comment for var_sp_8h
pd1~comment
?e --
Cvb
Cvb*
?e --
Cvr
Cvr*
?e --
Cvs
Cvs*
?e --
Cvb- arg_8h
pd1~comment
?e --
Cvb- -8
pd1~comment
?e --
Cvs- 8
pd1~comment
?e --
Cvr- var_rax
pd1~comment
?e --
EOF
EXPECT=<<EOF
| ; var uint32_t var_8h @ rbp-0x8 ; comment for var_8h
| ; arg int arg_8h @ rbp+0x8 ; comment for arg_8h
| ; arg uint32_t var_sp_8h @ rsp+0x8 ; comment for var_sp_8h
| ; arg uint64_t var_rax @ rax ; comment for var_rax
--
arg_8h : comment for arg_8h
var_8h : comment for var_8h
"Cvb arg_8h base64:Y29tbWVudCBmb3IgYXJnXzho @ 0x00000010"
"Cvb var_8h base64:Y29tbWVudCBmb3IgdmFyXzho @ 0x00000010"
--
var_rax : comment for var_rax
"Cvr var_rax base64:Y29tbWVudCBmb3IgdmFyX3JheA== @ 0x00000010"
--
var_sp_8h : comment for var_sp_8h
"Cvs var_sp_8h base64:Y29tbWVudCBmb3IgdmFyX3NwXzho @ 0x00000010"
--
| ; var uint32_t var_8h @ rbp-0x8 ; comment for var_8h
| ; arg uint32_t var_sp_8h @ rsp+0x8 ; comment for var_sp_8h
| ; arg uint64_t var_rax @ rax ; comment for var_rax
--
| ; arg uint32_t var_sp_8h @ rsp+0x8 ; comment for var_sp_8h
| ; arg uint64_t var_rax @ rax ; comment for var_rax
--
| ; arg uint64_t var_rax @ rax ; comment for var_rax
--
--
EOF
RUN
NAME=Cvb variable null pointer deref
FILE=bins/elf/analysis/x64-simple
CMDS=<<EOF
aaa
Cvb local_10
EOF
EXPECT=<<EOF
EOF
RUN
NAME=CL FAIL if no file
BROKEN=1
FILE=--
CMDS=<<EOF
CL $$ foo
CL.
EOF
EXPECT=<<EOF
foo
EOF
RUN
NAME=CL FAIL if no rbinfile
BROKEN=1
FILE=-
CMDS=<<EOF
CL $$ foo
CL.
EOF
EXPECT=<<EOF
foo
EOF
RUN
NAME=CL base64
FILE=bins/elf/arg
CMDS=<<EOF
CL $$ base64:SEVMTE8gV09STEQ=
CL*
EOF
EXPECT=<<EOF
HELLO WORLD
EOF
RUN
NAME=CC.
FILE=-
CMDS=<<EOF
CC hello @ 10
CC.
CC.10
CC.@10
CC@10
EOF
EXPECT=<<EOF
hello
hello
0x0000000a CCu "hello"
EOF
RUN
NAME=CL add
FILE=-
BROKEN=1
CMDS=<<EOF
CL $$ foo.c:123
e asm.lines=0
e asm.flags=0
e asm.dwarf=1
e asm.cmt.col=20
CC-*
pd 1
CL-*
pd 1
EOF
EXPECT=<<EOF
0x00000000 0000 add byte [rax], al ; foo:123
0x00000000 0000 add byte [rax], al
EOF
RUN
NAME=CL add ok
FILE=bins/elf/hello.ppc
CMDS=<<EOF
CL $$ foo.c:123
e asm.lines=0
e asm.flags=0
e asm.dwarf=1
e asm.cmt.col=20
CC-*
pd 1
CL-*
pd 1
EOF
EXPECT=<<EOF
0x10000308 7c290b78 mr r9, r1 ; foo.c:123
0x10000308 7c290b78 mr r9, r1
EOF
RUN
NAME=CL-addr-file-line
FILE=bins/elf/hello.ppc
CMDS=<<EOF
CL
EOF
EXPECT=<<EOF
file: /home/hawk/crosstool-ng-git/.build/src/glibc-2.27/csu/elf-init.c
line: 68
addr: 0x100004c8
file: /home/hawk/crosstool-ng-git/.build/src/glibc-2.27/csu/../sysdeps/powerpc/powerpc32//crti.S
line: 89
addr: 0x1000060c
file: /home/hawk/crosstool-ng-git/.build/src/glibc-2.27/csu/../sysdeps/powerpc/powerpc32//start.S
line: 62
addr: 0x10000308
file: /home/hawk/crosstool-ng-git/.build/src/glibc-2.27/csu/elf-init.c
line: 87
addr: 0x10000518
file: /home/hawk/crosstool-ng-git/.build/src/glibc-2.27/csu/../sysdeps/powerpc/powerpc32//crtn.S
line: 46
addr: 0x10000304
file: /home/hawk/crosstool-ng-git/.build/src/glibc-2.27/csu/../sysdeps/powerpc/powerpc32//crti.S
line: 68
addr: 0x100002d4
file: /home/hawk/crosstool-ng-git/.build/src/glibc-2.27/csu/../sysdeps/powerpc/powerpc32//crtn.S
line: 45
addr: 0x10000300
file: /home/hawk/crosstool-ng-git/.build/src/glibc-2.27/csu/../sysdeps/powerpc/powerpc32//crtn.S
line: 49
addr: 0x10000618
file: /home/hawk/crosstool-ng-git/.build/src/glibc-2.27/csu/../sysdeps/powerpc/powerpc32//start.S
line: 72
addr: 0x10000318
file: /home/hawk/crosstool-ng-git/.build/src/glibc-2.27/csu/../sysdeps/powerpc/powerpc32//start.S
line: 71
addr: 0x10000314
file: /home/hawk/crosstool-ng-git/.build/src/glibc-2.27/csu/../sysdeps/powerpc/powerpc32//crti.S
line: 74
addr: 0x100002ec
file: /home/hawk/crosstool-ng-git/.build/src/glibc-2.27/csu/../sysdeps/powerpc/powerpc32//start.S
line: 69
addr: 0x10000310
file: /home/hawk/crosstool-ng-git/.build/src/glibc-2.27/csu/elf-init.c
line: 87
addr: 0x10000548
file: /home/hawk/crosstool-ng-git/.build/src/glibc-2.27/csu/../sysdeps/powerpc/powerpc32//crti.S
line: 85
addr: 0x100005fc
file: /home/hawk/crosstool-ng-git/.build/src/glibc-2.27/csu/../sysdeps/powerpc/powerpc32//crti.S
line: 89
addr: 0x10000614
file: /home/hawk/crosstool-ng-git/.build/src/glibc-2.27/csu/elf-init.c
line: 88
addr: 0x10000544
file: /home/hawk/crosstool-ng-git/.build/src/glibc-2.27/csu/../sysdeps/powerpc/powerpc32//start.S
line: 87
addr: 0x1000032c
file: /home/hawk/crosstool-ng-git/.build/src/glibc-2.27/csu/elf-init.c
line: 87
addr: 0x10000540
file: /home/hawk/crosstool-ng-git/.build/src/glibc-2.27/csu/../sysdeps/powerpc/powerpc32//crti.S
line: 66
addr: 0x100002c8
file: /home/hawk/crosstool-ng-git/.build/src/glibc-2.27/csu/elf-init.c
line: 89
addr: 0x10000554
file: /home/hawk/crosstool-ng-git/.build/src/glibc-2.27/csu/../sysdeps/powerpc/powerpc32//crti.S
line: 65
addr: 0x100002c4
file: /home/hawk/crosstool-ng-git/.build/src/glibc-2.27/csu/../sysdeps/powerpc/powerpc32//crtn.S
line: 43
addr: 0x100002f8
file: /home/hawk/crosstool-ng-git/.build/src/glibc-2.27/csu/elf-init.c
line: 88
addr: 0x1000052c
file: /home/hawk/crosstool-ng-git/.build/src/glibc-2.27/csu/../sysdeps/powerpc/powerpc32//crti.S
line: 64
addr: 0x100002c0
file: /home/hawk/crosstool-ng-git/.build/src/glibc-2.27/csu/../sysdeps/powerpc/powerpc32//crti.S
line: 88
addr: 0x10000608
file: /home/hawk/crosstool-ng-git/.build/src/glibc-2.27/csu/../sysdeps/powerpc/powerpc32//start.S
line: 87
addr: 0x10000328
file: /home/hawk/crosstool-ng-git/.build/src/glibc-2.27/csu/../sysdeps/powerpc/powerpc32//start.S
line: 84
addr: 0x10000324
file: /home/hawk/crosstool-ng-git/.build/src/glibc-2.27/csu/../sysdeps/powerpc/powerpc32//crtn.S
line: 42
addr: 0x100002f4
file: /home/hawk/crosstool-ng-git/.build/src/glibc-2.27/csu/../sysdeps/powerpc/powerpc32//crti.S
line: 86
addr: 0x10000600
file: /home/hawk/crosstool-ng-git/.build/src/glibc-2.27/csu/../sysdeps/powerpc/powerpc32//start.S
line: 83
addr: 0x10000320
file: /home/hawk/crosstool-ng-git/.build/src/glibc-2.27/csu/../sysdeps/powerpc/powerpc32//crti.S
line: 71
addr: 0x100002dc
file: /home/hawk/crosstool-ng-git/.build/src/glibc-2.27/csu/../sysdeps/powerpc/powerpc32//crti.S
line: 87
addr: 0x10000604
file: /home/hawk/crosstool-ng-git/.build/src/glibc-2.27/csu/elf-init.c
line: 96
addr: 0x1000057c
file: /home/hawk/crosstool-ng-git/.build/src/glibc-2.27/csu/elf-init.c
line: 87
addr: 0x10000528
file: /home/hawk/crosstool-ng-git/.build/src/glibc-2.27/csu/elf-init.c
line: 86
addr: 0x1000050c
file: /home/hawk/crosstool-ng-git/.build/src/glibc-2.27/csu/elf-init.c
line: 106
addr: 0x10000584
file: /home/hawk/crosstool-ng-git/.build/src/glibc-2.27/csu/../sysdeps/powerpc/powerpc32//start.S
line: 64
addr: 0x1000030c
file: /home/hawk/crosstool-ng-git/.build/src/glibc-2.27/csu/../sysdeps/powerpc/powerpc32//crtn.S
line: 53
addr: 0x1000062c
file: /home/hawk/crosstool-ng-git/.build/src/glibc-2.27/csu/../sysdeps/powerpc/powerpc32//crti.S
line: 67
addr: 0x100002cc
file: /home/hawk/crosstool-ng-git/.build/src/glibc-2.27/csu/elf-init.c
line: 106
addr: 0x10000590
file: /home/hawk/crosstool-ng-git/.build/src/glibc-2.27/csu/../sysdeps/powerpc/powerpc32//crti.S
line: 74
addr: 0x100002e8
file: /home/hawk/crosstool-ng-git/.build/src/glibc-2.27/csu/../sysdeps/powerpc/powerpc32//crtn.S
line: 50
addr: 0x1000061c
file: /home/hawk/crosstool-ng-git/.build/src/glibc-2.27/csu/../sysdeps/powerpc/powerpc32//crtn.S
line: 44
addr: 0x100002fc
file: /home/hawk/crosstool-ng-git/.build/src/glibc-2.27/csu/../sysdeps/powerpc/powerpc32//crti.S
line: 72
addr: 0x100002e0
file: /home/hawk/crosstool-ng-git/.build/src/glibc-2.27/csu/../sysdeps/powerpc/powerpc32//crtn.S
line: 53
addr: 0x10000628
file: /home/hawk/crosstool-ng-git/.build/src/glibc-2.27/csu/../sysdeps/powerpc/powerpc32//crti.S
line: 73
addr: 0x100002e4
file: /home/hawk/crosstool-ng-git/.build/src/glibc-2.27/csu/../sysdeps/powerpc/powerpc32//crtn.S
line: 51
addr: 0x10000620
file: /home/hawk/crosstool-ng-git/.build/src/glibc-2.27/csu/../sysdeps/powerpc/powerpc32//crtn.S
line: 52
addr: 0x10000624
file: /home/hawk/crosstool-ng-git/.build/src/glibc-2.27/csu/../sysdeps/powerpc/powerpc32//start.S
line: 73
addr: 0x1000031c
file: /home/hawk/crosstool-ng-git/.build/src/glibc-2.27/csu/../sysdeps/powerpc/powerpc32//crti.S
line: 63
addr: 0x100002bc
file: /home/hawk/crosstool-ng-git/.build/src/glibc-2.27/csu/elf-init.c
line: 83
addr: 0x10000508
file: /home/hawk/crosstool-ng-git/.build/src/glibc-2.27/csu/../sysdeps/powerpc/powerpc32//crti.S
line: 69
addr: 0x100002d8
EOF
RUN
NAME=CLj
FILE=bins/elf/hello.ppc
CMDS=<<EOF
CLj~{}
EOF
EXPECT=<<EOF
[
{
"file": "/home/hawk/crosstool-ng-git/.build/src/glibc-2.27/csu/elf-init.c",
"line": 68,
"addr": 268436680
},
{
"file": "/home/hawk/crosstool-ng-git/.build/src/glibc-2.27/csu/../sysdeps/powerpc/powerpc32//crti.S",
"line": 89,
"addr": 268437004
},
{
"file": "/home/hawk/crosstool-ng-git/.build/src/glibc-2.27/csu/../sysdeps/powerpc/powerpc32//start.S",
"line": 62,
"addr": 268436232
},
{
"file": "/home/hawk/crosstool-ng-git/.build/src/glibc-2.27/csu/elf-init.c",
"line": 87,
"addr": 268436760
},
{
"file": "/home/hawk/crosstool-ng-git/.build/src/glibc-2.27/csu/../sysdeps/powerpc/powerpc32//crtn.S",
"line": 46,
"addr": 268436228
},
{
"file": "/home/hawk/crosstool-ng-git/.build/src/glibc-2.27/csu/../sysdeps/powerpc/powerpc32//crti.S",
"line": 68,
"addr": 268436180
},
{
"file": "/home/hawk/crosstool-ng-git/.build/src/glibc-2.27/csu/../sysdeps/powerpc/powerpc32//crtn.S",
"line": 45,
"addr": 268436224
},
{
"file": "/home/hawk/crosstool-ng-git/.build/src/glibc-2.27/csu/../sysdeps/powerpc/powerpc32//crtn.S",
"line": 49,
"addr": 268437016
},
{
"file": "/home/hawk/crosstool-ng-git/.build/src/glibc-2.27/csu/../sysdeps/powerpc/powerpc32//start.S",
"line": 72,
"addr": 268436248
},
{
"file": "/home/hawk/crosstool-ng-git/.build/src/glibc-2.27/csu/../sysdeps/powerpc/powerpc32//start.S",
"line": 71,
"addr": 268436244
},
{
"file": "/home/hawk/crosstool-ng-git/.build/src/glibc-2.27/csu/../sysdeps/powerpc/powerpc32//crti.S",
"line": 74,
"addr": 268436204
},
{
"file": "/home/hawk/crosstool-ng-git/.build/src/glibc-2.27/csu/../sysdeps/powerpc/powerpc32//start.S",
"line": 69,
"addr": 268436240
},
{
"file": "/home/hawk/crosstool-ng-git/.build/src/glibc-2.27/csu/elf-init.c",
"line": 87,
"addr": 268436808
},
{
"file": "/home/hawk/crosstool-ng-git/.build/src/glibc-2.27/csu/../sysdeps/powerpc/powerpc32//crti.S",
"line": 85,
"addr": 268436988
},
{
"file": "/home/hawk/crosstool-ng-git/.build/src/glibc-2.27/csu/../sysdeps/powerpc/powerpc32//crti.S",
"line": 89,
"addr": 268437012
},
{
"file": "/home/hawk/crosstool-ng-git/.build/src/glibc-2.27/csu/elf-init.c",
"line": 88,
"addr": 268436804
},
{
"file": "/home/hawk/crosstool-ng-git/.build/src/glibc-2.27/csu/../sysdeps/powerpc/powerpc32//start.S",
"line": 87,
"addr": 268436268
},
{
"file": "/home/hawk/crosstool-ng-git/.build/src/glibc-2.27/csu/elf-init.c",
"line": 87,
"addr": 268436800
},
{
"file": "/home/hawk/crosstool-ng-git/.build/src/glibc-2.27/csu/../sysdeps/powerpc/powerpc32//crti.S",
"line": 66,
"addr": 268436168
},
{
"file": "/home/hawk/crosstool-ng-git/.build/src/glibc-2.27/csu/elf-init.c",
"line": 89,
"addr": 268436820
},
{
"file": "/home/hawk/crosstool-ng-git/.build/src/glibc-2.27/csu/../sysdeps/powerpc/powerpc32//crti.S",
"line": 65,
"addr": 268436164
},
{
"file": "/home/hawk/crosstool-ng-git/.build/src/glibc-2.27/csu/../sysdeps/powerpc/powerpc32//crtn.S",
"line": 43,
"addr": 268436216
},
{
"file": "/home/hawk/crosstool-ng-git/.build/src/glibc-2.27/csu/elf-init.c",
"line": 88,
"addr": 268436780
},
{
"file": "/home/hawk/crosstool-ng-git/.build/src/glibc-2.27/csu/../sysdeps/powerpc/powerpc32//crti.S",
"line": 64,
"addr": 268436160
},
{
"file": "/home/hawk/crosstool-ng-git/.build/src/glibc-2.27/csu/../sysdeps/powerpc/powerpc32//crti.S",
"line": 88,
"addr": 268437000
},
{
"file": "/home/hawk/crosstool-ng-git/.build/src/glibc-2.27/csu/../sysdeps/powerpc/powerpc32//start.S",
"line": 87,
"addr": 268436264
},
{
"file": "/home/hawk/crosstool-ng-git/.build/src/glibc-2.27/csu/../sysdeps/powerpc/powerpc32//start.S",
"line": 84,
"addr": 268436260
},
{
"file": "/home/hawk/crosstool-ng-git/.build/src/glibc-2.27/csu/../sysdeps/powerpc/powerpc32//crtn.S",
"line": 42,
"addr": 268436212
},
{
"file": "/home/hawk/crosstool-ng-git/.build/src/glibc-2.27/csu/../sysdeps/powerpc/powerpc32//crti.S",
"line": 86,
"addr": 268436992
},
{
"file": "/home/hawk/crosstool-ng-git/.build/src/glibc-2.27/csu/../sysdeps/powerpc/powerpc32//start.S",
"line": 83,
"addr": 268436256
},
{
"file": "/home/hawk/crosstool-ng-git/.build/src/glibc-2.27/csu/../sysdeps/powerpc/powerpc32//crti.S",
"line": 71,
"addr": 268436188
},
{
"file": "/home/hawk/crosstool-ng-git/.build/src/glibc-2.27/csu/../sysdeps/powerpc/powerpc32//crti.S",
"line": 87,
"addr": 268436996
},
{
"file": "/home/hawk/crosstool-ng-git/.build/src/glibc-2.27/csu/elf-init.c",
"line": 96,
"addr": 268436860
},
{
"file": "/home/hawk/crosstool-ng-git/.build/src/glibc-2.27/csu/elf-init.c",
"line": 87,
"addr": 268436776
},
{
"file": "/home/hawk/crosstool-ng-git/.build/src/glibc-2.27/csu/elf-init.c",
"line": 86,
"addr": 268436748
},
{
"file": "/home/hawk/crosstool-ng-git/.build/src/glibc-2.27/csu/elf-init.c",
"line": 106,
"addr": 268436868
},
{
"file": "/home/hawk/crosstool-ng-git/.build/src/glibc-2.27/csu/../sysdeps/powerpc/powerpc32//start.S",
"line": 64,
"addr": 268436236
},
{
"file": "/home/hawk/crosstool-ng-git/.build/src/glibc-2.27/csu/../sysdeps/powerpc/powerpc32//crtn.S",
"line": 53,
"addr": 268437036
},
{
"file": "/home/hawk/crosstool-ng-git/.build/src/glibc-2.27/csu/../sysdeps/powerpc/powerpc32//crti.S",
"line": 67,
"addr": 268436172
},
{
"file": "/home/hawk/crosstool-ng-git/.build/src/glibc-2.27/csu/elf-init.c",
"line": 106,
"addr": 268436880
},
{
"file": "/home/hawk/crosstool-ng-git/.build/src/glibc-2.27/csu/../sysdeps/powerpc/powerpc32//crti.S",
"line": 74,
"addr": 268436200
},
{
"file": "/home/hawk/crosstool-ng-git/.build/src/glibc-2.27/csu/../sysdeps/powerpc/powerpc32//crtn.S",
"line": 50,
"addr": 268437020
},
{
"file": "/home/hawk/crosstool-ng-git/.build/src/glibc-2.27/csu/../sysdeps/powerpc/powerpc32//crtn.S",
"line": 44,
"addr": 268436220
},
{
"file": "/home/hawk/crosstool-ng-git/.build/src/glibc-2.27/csu/../sysdeps/powerpc/powerpc32//crti.S",
"line": 72,
"addr": 268436192
},
{
"file": "/home/hawk/crosstool-ng-git/.build/src/glibc-2.27/csu/../sysdeps/powerpc/powerpc32//crtn.S",
"line": 53,
"addr": 268437032
},
{
"file": "/home/hawk/crosstool-ng-git/.build/src/glibc-2.27/csu/../sysdeps/powerpc/powerpc32//crti.S",
"line": 73,
"addr": 268436196
},
{
"file": "/home/hawk/crosstool-ng-git/.build/src/glibc-2.27/csu/../sysdeps/powerpc/powerpc32//crtn.S",
"line": 51,
"addr": 268437024
},
{
"file": "/home/hawk/crosstool-ng-git/.build/src/glibc-2.27/csu/../sysdeps/powerpc/powerpc32//crtn.S",
"line": 52,
"addr": 268437028
},
{
"file": "/home/hawk/crosstool-ng-git/.build/src/glibc-2.27/csu/../sysdeps/powerpc/powerpc32//start.S",
"line": 73,
"addr": 268436252
},
{
"file": "/home/hawk/crosstool-ng-git/.build/src/glibc-2.27/csu/../sysdeps/powerpc/powerpc32//crti.S",
"line": 63,
"addr": 268436156
},
{
"file": "/home/hawk/crosstool-ng-git/.build/src/glibc-2.27/csu/elf-init.c",
"line": 83,
"addr": 268436744
},
{
"file": "/home/hawk/crosstool-ng-git/.build/src/glibc-2.27/csu/../sysdeps/powerpc/powerpc32//crti.S",
"line": 69,
"addr": 268436184
}
]
EOF
RUN