rizin/test/db/cmd/comments
Giovanni 2f97762b09
librz/core: Remove rizin command output (#5540)
* Remove RIZIN command output for the old projects

* Fix cmeta.c

* Fix ik command

* Revert back pc*

* fix formatting cmd_descs_generate.py

* Fix rz_cons_pal_list_as_css

* Fill all info about colors for ec commands.

* Fix all tests
2025-11-28 23:41:47 +08:00

147 lines
2 KiB
Text

NAME=add comment
FILE=malloc://1024
CMDS=<<EOF
CC hello @ 0x123
C~?
C~[0]
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
0x00000008 CCu "hello"
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