Skip to content
Snippets Groups Projects
Commit 84705780 authored by Ingmar Steen's avatar Ingmar Steen
Browse files

This checks whether the addr passed to ks.asm() is used.

parent f35eaa04
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