* Added build files [Capstone to Zydis] * x86 Analysis [Capstone to Zydis] * Changed x86 RzIL [Capstone to Zydis] * Changed asm and arch files [Capstone to Zydis] * Compilation, build error and test fixes [Capstone to Zydis] * Test changes [Capstone to Zydis] * Remaining changes [Capstone to Zydis] * Added BE support [Capstone to Zydis] --------- Co-authored-by: tushar3q34 <tushar3q34@gmail.com>
359 lines
3.8 KiB
Text
359 lines
3.8 KiB
Text
NAME=echo ~
|
|
FILE=malloc://1024
|
|
CMDS=echo jeje~jojo
|
|
EXPECT=
|
|
RUN
|
|
|
|
NAME=echo \~
|
|
FILE=malloc://1024
|
|
CMDS=echo jeje\~jojo
|
|
EXPECT=<<EOF
|
|
jeje~jojo
|
|
EOF
|
|
RUN
|
|
|
|
# Basic grep.
|
|
NAME=px~:1[1]
|
|
FILE=malloc://1024
|
|
CMDS=<<EOF
|
|
wx 10203040
|
|
px~:1[1]
|
|
EOF
|
|
EXPECT=<<EOF
|
|
1020
|
|
EOF
|
|
RUN
|
|
|
|
NAME=px~:1[1-3]
|
|
FILE=malloc://1024
|
|
CMDS=<<EOF
|
|
wx 102030405060708090
|
|
px~:1[1-3]
|
|
EOF
|
|
EXPECT=<<EOF
|
|
1020 3040 5060
|
|
EOF
|
|
RUN
|
|
|
|
NAME=px~:1[1-]
|
|
FILE=malloc://1024
|
|
CMDS=<<EOF
|
|
wx 10203040506070809010203040506070
|
|
px~:1[1-]
|
|
EOF
|
|
EXPECT=<<EOF
|
|
1020 3040 5060 7080 9010 2030 4050 6070 . 0@P`p... 0@P`p
|
|
EOF
|
|
RUN
|
|
|
|
NAME=px~?
|
|
FILE=malloc://1024
|
|
CMDS=<<EOF
|
|
wx 10203040
|
|
b 128
|
|
px~?
|
|
EOF
|
|
EXPECT=<<EOF
|
|
9
|
|
EOF
|
|
RUN
|
|
|
|
NAME=grep begin
|
|
FILE=malloc://1024
|
|
CMDS=i~^size
|
|
EXPECT=<<EOF
|
|
size 0x400
|
|
EOF
|
|
RUN
|
|
|
|
NAME=grep neg begin
|
|
FILE=malloc://1024
|
|
CMDS=i~!^size
|
|
EXPECT=<<EOF
|
|
fd 3
|
|
file malloc://1024
|
|
humansz 1K
|
|
mode rwx
|
|
format any
|
|
iorw true
|
|
block 0x100
|
|
type
|
|
EOF
|
|
RUN
|
|
|
|
NAME=grep end
|
|
FILE=malloc://1024
|
|
CMDS=i~0x400$
|
|
EXPECT=<<EOF
|
|
size 0x400
|
|
EOF
|
|
RUN
|
|
|
|
|
|
NAME=i;$s
|
|
FILE=malloc://1024
|
|
CMDS=%v `i~size[1]`-$s;%! echo works
|
|
EXPECT=<<EOF
|
|
0x0
|
|
works
|
|
EOF
|
|
RUN
|
|
|
|
NAME=echo~[0]
|
|
FILE=malloc://1024
|
|
CMDS=echo 0x3~[0];echo 0x999~[0]
|
|
EXPECT=<<EOF
|
|
0x3
|
|
0x999
|
|
EOF
|
|
RUN
|
|
|
|
NAME=echo~[0]
|
|
FILE=malloc://1024
|
|
CMDS=<<EOF
|
|
echo hello world~[0]
|
|
echo hello world~[1]
|
|
EOF
|
|
EXPECT=<<EOF
|
|
hello
|
|
world
|
|
EOF
|
|
RUN
|
|
|
|
NAME=px~:1[3,5,0-1]
|
|
FILE=malloc://1024
|
|
CMDS=wx 102030405060708090;px~:1[3,5,0-1]
|
|
EXPECT=<<EOF
|
|
0x00000000 1020 5060 9000
|
|
EOF
|
|
RUN
|
|
|
|
NAME=px~[3,5,0-1]:1
|
|
FILE=malloc://1024
|
|
CMDS=wx 102030405060708090;px~[3,5,0-1]:1
|
|
EXPECT=<<EOF
|
|
0x00000000 1020 5060 9000
|
|
EOF
|
|
RUN
|
|
|
|
NAME=px~[3,5,0-1]:0..3
|
|
FILE=malloc://1024
|
|
CMDS=wx 102030405060708090;px~[3,5,0-1]:0..3
|
|
EXPECT=<<EOF
|
|
- offset 0 2
|
|
0x00000000 1020 5060 9000
|
|
0x00000010 0000 0000 0000
|
|
EOF
|
|
RUN
|
|
|
|
NAME=px~[3,5,0-1]:-16
|
|
FILE=malloc://1024
|
|
CMDS=wx 102030405060708090;px~[3,5,0-1]:-16
|
|
EXPECT=<<EOF
|
|
0x00000000 1020 5060 9000
|
|
EOF
|
|
RUN
|
|
|
|
NAME=range
|
|
FILE=malloc://1024
|
|
CMDS=<<EOF
|
|
i~:0
|
|
i~:1
|
|
i~:2
|
|
i~:..3
|
|
i~:1..2
|
|
i~:-2
|
|
i~:-1
|
|
echo 0\n1\n2\n3\n4~:-2
|
|
echo 0\n1\n2\n3\n4~:-2..
|
|
echo 0\n1\n2~:0..
|
|
echo 0\n1\n2~:..
|
|
EOF
|
|
EXPECT=<<EOF
|
|
fd 3
|
|
file malloc://1024
|
|
size 0x400
|
|
fd 3
|
|
file malloc://1024
|
|
size 0x400
|
|
file malloc://1024
|
|
block 0x100
|
|
type
|
|
3
|
|
3
|
|
4
|
|
0
|
|
1
|
|
2
|
|
0
|
|
1
|
|
2
|
|
EOF
|
|
RUN
|
|
|
|
NAME=multigrep
|
|
FILE=malloc://1024
|
|
CMDS=<<EOF
|
|
i~size~?
|
|
i~nosuchstring~?
|
|
i~^f~or~?
|
|
i~?&f,or
|
|
i~or~true
|
|
i~&or,true
|
|
i~or~ny[0]
|
|
i~&or,ny[0]
|
|
EOF
|
|
EXPECT=<<EOF
|
|
1
|
|
0
|
|
1
|
|
1
|
|
iorw true
|
|
iorw true
|
|
format
|
|
format
|
|
EOF
|
|
RUN
|
|
|
|
NAME=multigrep2
|
|
BROKEN=1
|
|
FILE=malloc://1024
|
|
CMDS=<<EOF
|
|
echo hello world~hello~!boing
|
|
echo hello world~hello~world
|
|
echo hello world~!boing~world
|
|
echo hello world~!boing~!pongo
|
|
EOF
|
|
EXPECT=<<EOF
|
|
hello world
|
|
hello world
|
|
hello world
|
|
hello world
|
|
EOF
|
|
RUN
|
|
|
|
NAME=colgrep
|
|
FILE==
|
|
CMDS=<<EOF
|
|
echo 0x3~[0]
|
|
echo 0x999~[0]'
|
|
EOF
|
|
EXPECT=<<EOF
|
|
0x3
|
|
0x999
|
|
EOF
|
|
RUN
|
|
|
|
NAME=colgrep
|
|
FILE==
|
|
CMDS=<<EOF
|
|
echo "hello world"~[0]
|
|
echo "hello world"~[1]
|
|
EOF
|
|
EXPECT=<<EOF
|
|
hello
|
|
world
|
|
EOF
|
|
RUN
|
|
|
|
NAME=colgrep
|
|
FILE==
|
|
CMDS=<<EOF
|
|
echo "a\na b\na b c"~[0]
|
|
echo "a\na b\na b c"~[1]
|
|
echo "a\na b\na b c"~[2]
|
|
EOF
|
|
EXPECT=<<EOF
|
|
a
|
|
a
|
|
a
|
|
b
|
|
b
|
|
c
|
|
EOF
|
|
RUN
|
|
|
|
NAME=colgrep
|
|
FILE=malloc://1024
|
|
CMDS=<<EOF
|
|
wx 10203040
|
|
px~:1[1]
|
|
EOF
|
|
EXPECT=<<EOF
|
|
1020
|
|
EOF
|
|
RUN
|
|
|
|
NAME=count grep
|
|
FILE==
|
|
CMDS=<<EOF
|
|
wx 10203040
|
|
b 128
|
|
px~?
|
|
EOF
|
|
EXPECT=<<EOF
|
|
9
|
|
EOF
|
|
RUN
|
|
|
|
NAME=escaped grep
|
|
FILE=bins/elf/crackme
|
|
CMDS=<<EOF
|
|
e asm.bytes=true
|
|
pd 40~0x004005fe
|
|
EOF
|
|
EXPECT=<<EOF
|
|
`-> 0x004005fe 4883c408 add rsp, 0x08
|
|
EOF
|
|
RUN
|
|
|
|
NAME=sort lines
|
|
FILE==
|
|
CMDS=<<EOF
|
|
echo "3\n2\n4\n1"~$
|
|
echo "3\n2\n4\n1"~$!
|
|
EOF
|
|
EXPECT=<<EOF
|
|
1
|
|
2
|
|
3
|
|
4
|
|
4
|
|
3
|
|
2
|
|
1
|
|
EOF
|
|
RUN
|
|
|
|
NAME=escaped chars
|
|
FILE==
|
|
CMDS=<<EOF
|
|
echo "Hello\x40World"~Hello\@
|
|
echo "Hello\x24World"~Hello\@
|
|
echo "Hello\n\x23World"~\#
|
|
EOF
|
|
EXPECT=<<EOF
|
|
Hello@World
|
|
#World
|
|
EOF
|
|
RUN
|
|
|
|
NAME=escaped chars 2
|
|
FILE==
|
|
BROKEN=1
|
|
CMDS=echo Hello\n\x3bWorld~\;
|
|
EXPECT=<<EOF
|
|
;World
|
|
EOF
|
|
RUN
|
|
|
|
NAME=multi-command single-line grep
|
|
FILE==
|
|
CMDS=<<EOF
|
|
echo Hello World; echo 4e2420~4e2420
|
|
EOF
|
|
EXPECT=<<EOF
|
|
Hello World
|
|
4e2420
|
|
EOF
|
|
RUN
|