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

regress: add x86_bigimm.py

parent 39558910
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/python
# Test for oversize immediate
# Github issue: #9
# Author: Nguyen Anh Quynh
from keystone import *
import regress
CODE1 = b"MOV EAX, DWORD PTR [0xFFFFFFFFF]"
CODE2 = b"MOV EAX, DWORD PTR [0xFFFFFFFF]"
class TestX86(regress.RegressTest):
def runTest(self):
# Initialize Keystone engine
ks = Ks(KS_ARCH_X86, KS_MODE_32)
try:
encoding, count = ks.asm(CODE2)
except KsError as e:
if e.errno == KS_ERR_ASM_INVALIDOPERAND:
print("Got error KS_ERR_ASM_INVALIDOPERAND as expected")
else:
self.assertFalse(1, "ERROR: %s" % e)
encoding, count = ks.asm(CODE2)
self.assertEqual(encoding, [ 0xA1, 0xFF, 0xFF, 0xFF, 0xFF ])
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