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

Merge pull request #77 from mrexodia/regress_x86_ss_default

added regression test for useless SS segment override (#9)
parents 725b93d4 55064a11
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/python
# Tests if the SS segment override prefix is not explicitly produced when unnecessary
# Github issue: #9
# 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"MOV EAX,DWORD PTR SS:[ESP+8]")
encoding2, _ = ks.asm(b"MOV EAX,DWORD PTR SS:[EBP+8]")
# Assert the result
self.assertEqual(encoding1, [ 0x8B, 0x44, 0x24, 0x08 ])
self.assertEqual(encoding2, [ 0x8B, 0x45, 0x08 ])
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