Revamp Python regression tests suite (#2022)
* Fix Python regression test suite (partial) * Fix Python regression test suite * Add a test for mapping at high addresses * Add ctl tests
This commit is contained in:
@@ -2,15 +2,21 @@
|
||||
|
||||
"""https://github.com/unicorn-engine/unicorn/issues/165"""
|
||||
|
||||
import unicorn
|
||||
import regress
|
||||
|
||||
from unicorn import *
|
||||
|
||||
|
||||
def hook_mem_read_unmapped(mu, access, address, size, value, user_data):
|
||||
pass
|
||||
|
||||
mu = unicorn.Uc(unicorn.UC_ARCH_X86, unicorn.UC_MODE_32)
|
||||
class TestHook(regress.RegressTest):
|
||||
def test_excessive_hooks(self):
|
||||
mu = Uc(UC_ARCH_X86, UC_MODE_32)
|
||||
|
||||
try:
|
||||
for x in range(0, 1000):
|
||||
mu.hook_add(unicorn.UC_HOOK_MEM_READ_UNMAPPED, hook_mem_read_unmapped, None)
|
||||
except unicorn.UcError as e:
|
||||
print("ERROR: %s" % e)
|
||||
for _ in range(1337):
|
||||
mu.hook_add(UC_HOOK_MEM_READ_UNMAPPED, hook_mem_read_unmapped)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
regress.main()
|
||||
|
||||
Reference in New Issue
Block a user