rizin/test/db/cmd/comments
Anton Kochkov 2f638cad1e Convert f commands to rzshell
* Changed behavior of `f` to only add flag if there is none
* Changed behavior of `f+` to add flag in any case
* Moved listing subcommands from `f` to `fl`
* Moved listing subcommands from `f.` to `f.l`
* Added subcommand `f.l*` to list all local flags in all functions
* Listing flags at the current offset became `fl.`
* Moved `f=` to `fl=`
* Old `fl` (flag length) now became `fL`
* Removed original `fe` commands
* Old `f?` (check if flag exists) now became `fe`
* Removed `fV` commands
* Removed `fn` commands in favor of `fl` and `asm.flags.real=true`
* Removed `fS` commands (`fSo` and `fSn`)
* `fo` became `fortune` and moved from "flags" to "shell" category
* Removed oldshell handlers of the `z` commands
2022-02-03 21:46:42 +08:00

147 lines
2 KiB
Text

NAME=add comment
FILE=malloc://1024
CMDS=<<EOF
CC hello @ 0x123
C*~?
C*~[3]
EOF
EXPECT=<<EOF
1
0x00000123
EOF
RUN
NAME=#3829 remove comment where another meta is already defined
FILE=bins/elf/analysis/main
CMDS=<<EOF
CCu lol @ str.Hello_World
CC- @ str.Hello_World
pd 1 @ str.Hello_World
EOF
EXPECT=<<EOF
;-- str.Hello_World:
0x004005c4 .string "Hello World" ; len=12
EOF
RUN
NAME=add comment
FILE=malloc://1024
CMDS=<<EOF
CC hello
C*~?
EOF
EXPECT=<<EOF
1
EOF
RUN
NAME=add comment at
FILE=malloc://1024
CMDS=<<EOF
CC hello @ 8
C*~?
CCl*
EOF
EXPECT=<<EOF
1
CCu base64:aGVsbG8= @ 0x00000008
EOF
RUN
NAME=del comment
FILE=malloc://1024
CMDS=<<EOF
CC hello
C*~?
CC-
C*~?
EOF
EXPECT=<<EOF
1
0
EOF
RUN
NAME=add two comment
FILE=malloc://1024
CMDS=<<EOF
CC hello @ 0x200
CC world @ 0x400
C*~?
EOF
EXPECT=<<EOF
2
EOF
RUN
NAME=del comment at address
FILE=malloc://1024
CMDS=<<EOF
CC hello @ 0x200
CC world @ 0x400
CC-@ 0x400
C*~?
EOF
EXPECT=<<EOF
1
EOF
RUN
NAME=multiline comment
FILE=malloc://1024
CMDS=<<EOF
e asm.arch=x86
e asm.bytes=true
e asm.bits=32
CC hello @ 0x200
CC world @ 0x200
CC.@ 0x200~?
CCl~?
e asm.cmt.right=0
e scr.color=false
pd 2 @ 0x200
EOF
EXPECT=<<EOF
1
1
; hello world
0x00000200 0000 add byte [eax], al
0x00000202 0000 add byte [eax], al
EOF
RUN
NAME=cmtright
FILE=malloc://1024
CMDS=<<EOF
e asm.arch=x86
e asm.bytes=true
e asm.bits=64
CC hello
e scr.color=false
wx 90
e asm.cmt.right=1
pd 1
e asm.cmt.right=0
pd 1
EOF
EXPECT=<<EOF
0x00000000 90 nop ; hello
; hello
0x00000000 90 nop
EOF
RUN
NAME=cmtrefs
FILE=bins/elf/analysis/main
CMDS=<<EOF
aaa
e asm.cmt.refs=true
e asm.bytes=true
f+ test.flag @ 0x004003e0
CC test comment @ 0x004003e0
pd 1 @ 0x0040050f
EOF
EXPECT=<<EOF
| 0x0040050f e8ccfeffff call sym.imp.puts ; int puts(const char *s) ; (sym.imp.puts) ; (test.flag) ; (test comment)
EOF
RUN