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

Merge pull request #79 from mrexodia/regress_issue10

added test for issue #10 (push word 0xd)
parents ce27af97 b9942f9c
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/python
# Test 'push word 0xd'
# Github issue: #10
# Author: Duncan (mrexodia)
from keystone import *
import regress
class TestX86(regress.RegressTest):
def runTest(self):
# Initialize Keystone engine
ks = Ks(KS_ARCH_X86, KS_MODE_32)
# Assemble to get back insn encoding & statement count
encoding1, _ = ks.asm(b"push 0xd")
encoding2, _ = ks.asm(b"push word 0xd")
# Assert the result
self.assertEqual(encoding1, [ 0x6a, 0x0d ])
self.assertEqual(encoding2, [ 0x66, 0x6a, 0x0d ])
if __name__ == '__main__':
regress.main()
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