Fix wrong tests (#15834)

This commit is contained in:
Anton Kochkov 2020-01-17 22:05:06 +08:00 committed by GitHub
parent a634213c35
commit 67d8eba435
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 66 additions and 32 deletions

View File

@ -6,6 +6,9 @@ EXPECT=<<EOF
0000.02: STR V_00:32 , , R_ebx:32
EOF
CMDS=<<EOF
e asm.arch=x86
e anal.arch=x86
e asm.bits=32
"aetr eax,ebx,+="
EOF
RUN
@ -17,6 +20,9 @@ EXPECT=<<EOF
V_00:32
EOF
CMDS=<<EOF
e asm.arch=x86
e anal.arch=x86
e asm.bits=32
"aetr eax,ebx,+"
EOF
RUN
@ -28,6 +34,9 @@ EXPECT=<<EOF
V_00:1
EOF
CMDS=<<EOF
e asm.arch=x86
e anal.arch=x86
e asm.bits=32
"aetr eax,ebx,=="
EOF
RUN
@ -41,6 +50,9 @@ EXPECT=<<EOF
V_02:1
EOF
CMDS=<<EOF
e asm.arch=x86
e anal.arch=x86
e asm.bits=32
"aetr eax,ebx,<="
EOF
RUN
@ -54,6 +66,9 @@ EXPECT=<<EOF
0000.03: STR V_02:32 , , R_ebx:32
EOF
CMDS=<<EOF
e asm.arch=x86
e anal.arch=x86
e asm.bits=32
"aetr ebx,!="
EOF
RUN
@ -66,8 +81,8 @@ EXPECT=<<EOF
0001.01: JCC 1:01 , , 0x800:32
EOF
CMDS=<<EOF
e asm.arch = x86
e anal.arch = x86
e asm.arch=x86
e anal.arch=x86
e asm.bits=32
"aetr zf,?{,0x800,eip,=,}"
EOF
@ -83,6 +98,8 @@ EXPECT=<<EOF
0000.04: STM V_03:32 , , R_eax:32
EOF
CMDS=<<EOF
e asm.arch=x86
e anal.arch=x86
e asm.bits=32
"aetr 0xff,eax,|=[2]"
EOF
@ -110,8 +127,8 @@ EXPECT=<<EOF
V_04:1
EOF
CMDS=<<EOF
e asm.arch = x86
e anal.arch = x86
e asm.arch=x86
e anal.arch=x86
e asm.bits=32
aetr 0,0x2147a8,rip,+,[8],==,$z,zf,=,$b64,cf,=,$p,pf,=,$s,sf,=
EOF

View File

@ -12,6 +12,8 @@ RUN
NAME=agfJ
FILE=-
CMDS=<<EXPECT
e asm.arch=x86
e asm.bits=64
s 0x42
wx 00004883f80074060000000000000000c3
af

View File

@ -310,6 +310,7 @@ mov eax, 'VMXh'
EOF
CMDS=<<EOF
wx b868584d56
e asm.arch=x86
e asm.bits=64
ahi s
pi 1

View File

@ -1,6 +1,8 @@
NAME=a8
FILE=-
CMDS=<<EOF
e asm.arch=x86
e asm.bits=64
a8 c745f400000000~type
EOF
EXPECT=<<EOF

View File

@ -21,6 +21,8 @@ RUN
NAME=axf
FILE=-
CMDS=<<EXPECT
e asm.arch=x86
e asm.bits=64
s 0
ax 0x42
ax 0x43

View File

@ -31,6 +31,8 @@ EXPECT=<<EOF
0x00000000 0000 add byte [rax], al
EOF
CMDS=<<EOF
e asm.arch=x86
e asm.bits=64
f foo
fr foo bar
f

View File

@ -65,8 +65,8 @@ EXPECT=<<EOF
EOF
CMDS=<<EOF
e asm.bits=64
e asm.arch = x86
e anal.arch = x86
e asm.arch=x86
e anal.arch=x86
wx 6833320000
e asm.imm.str=1
pd 1
@ -80,7 +80,9 @@ EXPECT=<<EOF
EOF
CMDS=<<EOF
wx 4889e5
e asm.pseudo =1
e asm.arch=x86
e asm.bits=64
e asm.pseudo=1
e asm.cmtright =0
pd 1
EOF
@ -120,6 +122,8 @@ EXPECT=<<EOF
0x00000000 90 nop
EOF
CMDS=<<EOF
e asm.arch=x86
e asm.bits=64
wx 90
e asm.lines.bb=0
b 1
@ -149,6 +153,8 @@ EXPECT=<<EOF
0x00000000 90 nop
EOF
CMDS=<<EOF
e asm.arch=x86
e asm.bits=64
e asm.lines.bb=0
pd@x:90
EOF

View File

@ -246,6 +246,7 @@ EXPECT=<<EOF
0x00000000 b804000000 4,rax,=
EOF
CMDS=<<EOF
e asm.arch=x86
e asm.bits=64
wa mov eax, 4
e asm.esil=true

View File

@ -9,7 +9,7 @@ RUN
NAME=pseudo-crash
FILE=-
CMDS=e asm.pseudo=1;wx 7299;pdj 1
CMDS=e asm.pseudo=1; e asm.arch=x86; e asm.bits=64; wx 7299; pdj 1
EXPECT=<<EOF
[{"offset":0,"esil":"cf,?{,18446744073709551515,rip,=,}","refptr":false,"fcn_addr":0,"fcn_last":0,"size":2,"opcode":"if (((unsigned) var) < 0) goto 0xffffffffffffff9b","disasm":"jb 0xffffffffffffff9b","bytes":"7299","family":"cpu","type":"cjmp","reloc":false,"type_num":2147483649,"type2_num":0,"jump":-101,"fail":2}]

View File

@ -53,6 +53,7 @@ EOF
CMDS=<<EOF
.!rabin2 -rps ../bins/elf/analysis/pie
?v sym.main
e asm.arch=x86
e asm.bits=32
pi 5 @ sym.main
EOF

View File

@ -1,42 +1,42 @@
NAME=ragg2 -p A200 -d 50:0xccccccb
NAME=ragg2 -a x86 -b 64 -p A200 -d 50:0xccccccb
FILE=-
CMDS=!ragg2 -p A200 -d 50:0xccccccb
CMDS=!ragg2 -a x86 -b 64 -p A200 -d 50:0xccccccb
EXPECT=<<RUN
4141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141cbcccc0c4141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141
RUN
NAME=ragg2 -p A200 -d 50:0xcb
NAME=ragg2 -a x86 -b 64 -p A200 -d 50:0xcb
FILE=-
CMDS=!ragg2 -p A200 -d 50:0xcb
CMDS=!ragg2 -a x86 -b 64 -p A200 -d 50:0xcb
EXPECT=<<RUN
4141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141cb0000004141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141
RUN
NAME=ragg2 -p A10 -d 50:0xcb
NAME=ragg2 -a x86 -b 64 -p A10 -d 50:0xcb
FILE=-
CMDS=!ragg2 -p A10 -d 50:0xcb
CMDS=!ragg2 -a x86 -b 64 -p A10 -d 50:0xcb
EXPECT=<<EXPECT_ERR
41414141414141414141
EXPECT_ERR=Cannot patch outside
RUN
NAME=ragg2 -p A20 -w 10:cb
NAME=ragg2 -a x86 -b 64 -p A20 -w 10:cb
FILE=-
CMDS=!ragg2 -p A20 -w 10:cb
CMDS=!ragg2 -a x86 -b 64 -p A20 -w 10:cb
EXPECT=<<RUN
41414141414141414141cb414141414141414141
RUN
NAME=ragg2 -p A20 -D 10:33
NAME=ragg2 -a x86 -b 64 -p A20 -D 10:33
FILE=-
CMDS=!ragg2 -p A20 -D 10:33
CMDS=!ragg2 -a x86 -b 64 -p A20 -D 10:33
EXPECT=<<RUN
4141414141414141414121000000000000004141
RUN
NAME=ragg2 -p n2t2a2s2
NAME=ragg2 -a x86 -b 64 -p n2t2a2s2
FILE=-
CMDS=!ragg2 -p n2t2a2s2
CMDS=!ragg2 -a x86 -b 64 -p n2t2a2s2
EXPECT=<<RUN
00004141cccc9090
RUN
@ -98,7 +98,7 @@ EXPECT=<<RUN
e90800000048656c6c6f210a00bf01000000488d35ecffffffba07000000b8010000000f05b83c0000004030ff0f05c3
RUN
NAME=ragg2 -v
NAME=ragg2 -v
FILE=-
CMDS=!ragg2 -v | grep -c build
EXPECT=<<RUN
@ -117,4 +117,4 @@ FILE=-
CMDS=!ragg2 -L | grep -c encoders
EXPECT=<<RUN
1
RUN
RUN

View File

@ -236,7 +236,7 @@ EXPECT=<<RUN
44
RUN
NAME=rasm2 -s att -ax86.as -b 64 movq %rdx, %rax
NAME=rasm2 -s att -a x86.as -b 64 movq %rdx, %rax
FILE=-
CMDS=!rasm2 -s att -a x86.as -b 64 "movq %rdx, %rax"
EXPECT=<<RUN
@ -335,14 +335,14 @@ RUN
NAME=rasm2 mov eax, [eax * 2 + 8]
FILE=-
CMDS=!rasm2 -b32 "mov eax, [eax * 2 + 8]"
CMDS=!rasm2 -a x86 -b 32 "mov eax, [eax * 2 + 8]"
EXPECT=<<RUN
8b044508000000
RUN
NAME=rasm2 -A 0x55
NAME=rasm2 -a x86 -b 64 -A 0x55
FILE=-
CMDS=!rasm2 -A 0x55
CMDS=!rasm2 -a x86 -b 64 -A 0x55
EXPECT=<<RUN
offset: 0x00000000
bytes: 55
@ -366,16 +366,16 @@ CMDS=!rasm2 -k darwin 0x90
EXPECT=<<RUN
RUN
NAME=rasm2 -E 0x55
NAME=rasm2 -a x86 -b 64 -E 0x55
FILE=-
CMDS=!rasm2 -E 0x55
CMDS=!rasm2 -a x86 -b 64 -E 0x55
EXPECT=<<RUN
rbp,8,rsp,-,=[8],8,rsp,-=
RUN
NAME=rasm2 -Aj 0x55
NAME=rasm2 -a x86 -b 64 -Aj 0x55
FILE=-
CMDS=!rasm2 -Aj 0x55
CMDS=!rasm2 -a x86 -b 64 -Aj 0x55
EXPECT='[{"opcode":0,"bytes":"55","type":"rpush","stackop":"unknown","esil":"rbp,8,rsp,-,=[8],8,rsp,-=","stackptr":8}]
'
RUN
@ -401,9 +401,9 @@ EXPECT=<<RUN
1
RUN
NAME=rasm2 -r push ebp
NAME=rasm2 -a x86 -r push ebp
FILE=-
CMDS=!rasm2 -r push ebp
CMDS=!rasm2 -a x86 -r push ebp
EXPECT=<<RUN
e asm.arch=x86
e asm.bits=64