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

Merge branch 'regress_x86_address' of https://github.com/mrexodia/beta into...

Merge branch 'regress_x86_address' of https://github.com/mrexodia/beta into mrexodia-regress_x86_address
parents 07123318 73f82641
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/python
# Test if addr == 0 and addr != 0 produces the same results on a NOP.
# Github issue: #9
# Author: Duncan (mrexodia)
from keystone import *
import regress
class TestX86Intel(regress.RegressTest):
def runTest(self):
# Initialize Keystone engine
ks = Ks(KS_ARCH_X86, KS_MODE_32)
# Assemble with zero addr
encoding1, count1 = ks.asm("nop", 0)
# Assemble with non-zero addr
encoding2, count2 = ks.asm("nop", 0x9123FFE1)
# Assert the result
self.assertEqual(encoding1, [ 0x90 ])
self.assertEqual(count1, 1)
self.assertEqual(encoding1, encoding2)
self.assertEqual(count1, count2)
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