mirror of
https://github.com/yuzu-emu/unicorn
synced 2024-11-24 09:08:25 +00:00
added bad_ram regress
This commit is contained in:
parent
8b4d274c34
commit
eeebcc5a44
1 changed files with 30 additions and 0 deletions
30
tests/regress/bad_ram.py
Normal file
30
tests/regress/bad_ram.py
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
#!/usr/bin/python
|
||||||
|
|
||||||
|
from unicorn import *
|
||||||
|
from unicorn.x86_const import *
|
||||||
|
|
||||||
|
import regress
|
||||||
|
|
||||||
|
|
||||||
|
class Hang(regress.RegressTest):
|
||||||
|
|
||||||
|
def runTest(self):
|
||||||
|
CODE_ADDR = 0x400000
|
||||||
|
RSP_ADDR = 0x200000
|
||||||
|
binary1 = "\xCA\x24\x5D" # retf 0x5d24
|
||||||
|
mu = Uc(UC_ARCH_X86, UC_MODE_64)
|
||||||
|
|
||||||
|
mu.mem_map(CODE_ADDR, 0x5000)
|
||||||
|
mu.mem_map(RSP_ADDR, 0x5000)
|
||||||
|
|
||||||
|
# write machine code to be emulated to memory
|
||||||
|
mu.mem_write(CODE_ADDR, binary1)
|
||||||
|
|
||||||
|
mu.reg_write(UC_X86_REG_RSP, RSP_ADDR)
|
||||||
|
|
||||||
|
# emu for maximum 1 sec.
|
||||||
|
mu.emu_start(CODE_ADDR, 0x400000 + 0x5000, 0)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
regress.main()
|
Loading…
Reference in a new issue