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