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

Merge pull request #44 from iksteen/regress-x86-label-addr

This checks whether the addr passed to ks.asm() is used.
parents 9375d34e 84705780
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/python
# Ingmar Steen, 2016
# This is to test whether labels are offset by the addr provided to ks.asm.
# Github issue: #32
# Author: Ingmar Steen
from keystone import *
import regress
class TestX86LeaLabel(regress.RegressTest):
def runTest(self):
# Initialize Keystone engine
ks = Ks(KS_ARCH_X86, KS_MODE_32)
encoding, count = ks.asm(b"lea eax, [__data]\n__data:", 0x480000)
self.assertEqual(encoding, [ 0x8d, 0x05, 0x06, 0x00, 0x48, 0x00 ])
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