mirror of
https://github.com/yuzu-emu/unicorn
synced 2024-11-24 08:58:18 +00:00
commit
07e8f2f60d
1 changed files with 27 additions and 0 deletions
27
tests/regress/mov_gs_eax.py
Executable file
27
tests/regress/mov_gs_eax.py
Executable file
|
@ -0,0 +1,27 @@
|
|||
#!/usr/bin/python
|
||||
|
||||
from unicorn import *
|
||||
from unicorn.x86_const import *
|
||||
|
||||
import regress
|
||||
|
||||
class VldrPcInsn(regress.RegressTest):
|
||||
|
||||
def runTest(self):
|
||||
uc = Uc(UC_ARCH_X86, UC_MODE_32)
|
||||
uc.mem_map(0x1000, 0x1000)
|
||||
# mov gs, eax; mov eax, 1
|
||||
code = '8ee8b801000000'.decode('hex')
|
||||
uc.mem_write(0x1000, code)
|
||||
|
||||
uc.reg_write(UC_X86_REG_EAX, 0xFFFFFFFF)
|
||||
# this should throw an error
|
||||
# the eax test is just to prove the second instruction doesn't execute
|
||||
try:
|
||||
uc.emu_start(0x1000, len(code))
|
||||
except UcError:
|
||||
return
|
||||
self.assertEqual(uc.reg_read(UC_X86_REG_EAX), 1)
|
||||
|
||||
if __name__ == '__main__':
|
||||
regress.main()
|
Loading…
Reference in a new issue