mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2024-12-23 01:15:37 +00:00
Merge pull request #15 from zardus/regress/memmap_weirdness
added memmap regression scripts
This commit is contained in:
commit
ee9e2d6a12
8
regress/memmap_assert.py
Executable file
8
regress/memmap_assert.py
Executable file
|
@ -0,0 +1,8 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
import unicorn
|
||||
|
||||
u = unicorn.Uc(unicorn.UC_ARCH_X86, unicorn.UC_MODE_32)
|
||||
u.mem_map(0x2000, 0)
|
||||
u.mem_map(0x4000, 1)
|
||||
print "I am never reached"
|
25
regress/memmap_segfault.py
Executable file
25
regress/memmap_segfault.py
Executable file
|
@ -0,0 +1,25 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
import unicorn
|
||||
|
||||
u = unicorn.Uc(unicorn.UC_ARCH_X86, unicorn.UC_MODE_32)
|
||||
u.mem_map(0x2000, 0x1000)
|
||||
u.mem_read(0x2000, 1)
|
||||
|
||||
for i in range(20):
|
||||
try:
|
||||
u = unicorn.Uc(unicorn.UC_ARCH_X86, unicorn.UC_MODE_32)
|
||||
u.mem_map(i*0x1000, 5)
|
||||
u.mem_read(i*0x1000, 1)
|
||||
print hex(i*0x1000) + " succeeeded"
|
||||
except unicorn.UcError:
|
||||
print hex(i*0x1000) + " failed"
|
||||
|
||||
for i in range(20):
|
||||
try:
|
||||
u = unicorn.Uc(unicorn.UC_ARCH_X86, unicorn.UC_MODE_32)
|
||||
u.mem_map(i*0x1000, 5)
|
||||
u.mem_read(i*0x1000, 1)
|
||||
print hex(i*0x1000) + " succeeeded"
|
||||
except unicorn.UcError:
|
||||
print hex(i*0x1000) + " failed"
|
12
regress/memmap_weirdness.py
Executable file
12
regress/memmap_weirdness.py
Executable file
|
@ -0,0 +1,12 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
import unicorn
|
||||
|
||||
for i in range(20):
|
||||
#try:
|
||||
u = unicorn.Uc(unicorn.UC_ARCH_X86, unicorn.UC_MODE_32)
|
||||
u.mem_map(i*0x1000, 5)
|
||||
u.mem_read(i*0x1000+6, 1)
|
||||
print hex(i*0x1000) + " succeeeded"
|
||||
#except unicorn.UcError as e:
|
||||
# print hex(i*0x1000) + " failed:",e
|
Loading…
Reference in a new issue