From 4ab5e2086babb64fdd9586535884f760b92e9738 Mon Sep 17 00:00:00 2001 From: Nguyen Anh Quynh <aquynh@gmail.com> Date: Mon, 23 May 2016 13:50:50 +0800 Subject: [PATCH] regress: add x64_issue9.py --- suite/regress/x64_issue9.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100755 suite/regress/x64_issue9.py diff --git a/suite/regress/x64_issue9.py b/suite/regress/x64_issue9.py new file mode 100755 index 0000000..b7da30f --- /dev/null +++ b/suite/regress/x64_issue9.py @@ -0,0 +1,25 @@ +#!/usr/bin/python + +# Test some x64 issues report in #9 + +# Github issue: #9 +# Author: Nguyen Anh Quynh + +from keystone import * + +import regress + +class TestX86(regress.RegressTest): + def runTest(self): + # Initialize Keystone engine + ks = Ks(KS_ARCH_X86, KS_MODE_64) + + encoding, _ = ks.asm(b"MOVSX R12D, BYTE PTR [R15+RBP*1]") + self.assertEqual(encoding, [ 0x45, 0x0F, 0xBE, 0x24, 0x2F ]) + + encoding, _ = ks.asm(b"LEA RDX, [RAX]") + self.assertEqual(encoding, [ 0x48, 0x8D, 0x10 ]) + + +if __name__ == '__main__': + regress.main() -- GitLab