Skip to content
Snippets Groups Projects
Commit c2693704 authored by Nguyen Anh Quynh's avatar Nguyen Anh Quynh
Browse files

Merge pull request #163 from practicalswift/add-roundtrip-tests

Add round-trip test cases
parents 54685282 dc1eb591
No related branches found
No related tags found
No related merge requests found
......@@ -13,34 +13,50 @@ roundtrip_tests = [
("x64", "cmovns rdi, qword ptr [r15d + esi*4 - 1]"),
("x64", "cmp qword ptr [r9d - 0x1f6968e2], rbx"),
("x64", "cmpsq qword ptr gs:[rsi], qword ptr [rdi]"),
("x64", "dec qword ptr [r15d]"),
("x64", "div qword ptr cs:[r14d - 0x7c]"),
("x64", "imul r14, qword ptr [r10d - 0x42bcfafd], 0x71"),
("x64", "lock xchg qword ptr [r8d + 0x24], rsi"),
("x64", "lodsq rax, qword ptr es:[rsi]"),
("x64", "mov r10, qword ptr cs:[r10d - 0x77]"),
("x64", "movabs rax, qword ptr fs:[0x21bd3b669c88595f]"),
("x64", "movsq qword ptr [rdi], qword ptr fs:[rsi]"),
("x64", "movsxd r11, dword ptr cs:[eax - 0x206b31ee]"),
("x64", "or rax, 0xffffffffd8751dd5"),
("x64", "push 0xe269eeca"),
("x64", "rcl qword ptr ss:[r10d + 0x23], -3"),
("x64", "rep lodsq rax, qword ptr es:[rsi]"),
("x64", "repe scasq rax, qword ptr [edi]"),
("x64", "repne cmpsq qword ptr ss:[rsi], qword ptr [rdi]"),
("x64", "rol qword ptr [r14d + 0x76], 0x5c"),
("x64", "ror qword ptr [ebp + 0x67217b00], -0x69"),
("x64", "sar qword ptr [esi + 0x29], 0xf"),
("x64", "sbb qword ptr [eax - 0x49], r8"),
("x64", "scasq rax, qword ptr [edi]"),
("x64", "shl qword ptr [eax], cl"),
("x64", "shr qword ptr [esi + 0x6a], 5"),
("x64", "stosq qword ptr [edi], rax"),
("x64", "sub rcx, qword ptr [eax + 0x38]"),
("x64", "test edi, ebx"),
("x64", "vaddpd zmm21 {k1} {z}, zmm11, zmmword ptr [rdx + 0x1bc0]"),
("x64", "vcvtsd2si edi, qword ptr [rbp + 0x18]"),
("x64", "vcvtss2si r9d, dword ptr [rdx - 0x64]"),
("x64", "vmaxpd zmm27 {k3}, zmm9, zmmword ptr [r15 - 0xc00]"),
("x64", "vmaxps zmm0 {k2} {z}, zmm8, zmmword ptr [r9 - 0x1b40]"),
("x64", "vminps zmm2 {k6} {z}, zmm18, dword ptr [r14 - 0x1e4]{1to16}"),
("x64", "vpandnq zmm19 {k7} {z}, zmm28, zmmword ptr [rax + xmm5*2 + 0xb00]"),
("x64", "vpermi2pd zmm30 {k2} {z}, zmm19, zmmword ptr [rcx + 0x200]"),
("x64", "vpermi2ps zmm3 {k3} {z}, zmm28, zmmword ptr [r8 + 0xcc0]"),
("x64", "vpmaxsd zmm31 {k5}, zmm8, zmmword ptr [r8 - 0x780]"),
("x64", "vpmaxsq zmm16 {k7}, zmm2, qword ptr [rsi - 0x228]{1to8}"),
("x64", "vpminsd zmm4 {k1} {z}, zmm25, zmmword ptr [r8 + 0x1d80]"),
("x64", "vpminuq zmm21 {k2}, zmm15, zmmword ptr [r10 - 0x1300]"),
("x64", "vpord zmm15 {k2} {z}, zmm8, zmmword ptr [rdi + r11*4 + 0xc40]"),
("x64", "vporq zmm29 {k5} {z}, zmm2, zmmword ptr fs:[r11 - 0x1c40]"),
("x64", "vpsllq zmm21 {k2}, zmm28, xmmword ptr [rcx - 0x2b0]"),
("x64", "vpsravd zmm27, zmm24, zmmword ptr [r10 + 0x5c0]"),
("x64", "vpsrlq zmm17 {k7}, zmmword ptr [r9 - 0x1680], 0x73"),
("x64", "vpxord zmm12 {k5} {z}, zmm8, zmmword ptr [rbp + 0x740]"),
("x64", "vpxorq zmm21 {k2}, zmm1, zmmword ptr [rbx - 0x1180]"),
("x64", "xchg rax, rax"),
("x64", "xor qword ptr [esi + 0x1df54066], 0x6c"),
......@@ -55,6 +71,8 @@ arch_modes = {
def assemble(arch_mode, s):
if not s:
return b""
ks = Ks(arch_modes[arch_mode]["keystone_arch"],
arch_modes[arch_mode]["keystone_mode"])
try:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment