rizin/test/db/cmd/cmd_meta
Anton Kochkov 39613b5c16
Port C (metainformation) commands to the rzshell (#1752)
* Do not escape strings during the search
* Port `C` (metainformation) commands to the rzshell
* Improve string autodetection
* Remove `Cr` and RZ_META_TYPE_RUN
* Escape `\x1b` as `\e` character in strings
* Move string encoding options to `RzStrEncOptions` struct
* Add `esc_double_quotes` option to `RzStrEncOptions`
* Do not filter out unprintable characters for uppercase check
* Use `esc_double_quotes` when printing the string between '"' in disasm
* Use signed chars on all platforms/architectures

Co-authored-by: Riccardo Schirone <sirmy15@gmail.com>
2021-10-15 16:48:18 +08:00

108 lines
1.9 KiB
Text

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
Cv arg_8h comment for arg_8h
Cv var_8h comment for var_8h
Cv var_rax comment for var_rax
Cv var_sp_8h comment for var_sp_8h
pd1~comment
?e --
Cvb
Cvb*
?e --
Cvr
Cvr*
?e --
Cvs
Cvs*
?e --
Cv- arg_8h
pd1~comment
?e --
Cv- var_8h
pd1~comment
?e --
Cv- var_sp_8h
pd1~comment
?e --
Cv- 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=CC.
FILE==
CMDS=<<EOF
CC hello @ 10
CC.
CC. @ 10
CCl @ 10
EOF
EXPECT=<<EOF
hello
0x0000000a CCu "hello"
EOF
RUN