From bb4011efe25c2ac1580978f2a3acf361342e54f8 Mon Sep 17 00:00:00 2001 From: Sean Heelan Date: Tue, 6 Oct 2015 12:55:09 +0700 Subject: [PATCH] Regression test for issue #165 --- tests/regress/hook_add_crash.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100755 tests/regress/hook_add_crash.py diff --git a/tests/regress/hook_add_crash.py b/tests/regress/hook_add_crash.py new file mode 100755 index 00000000..64b6f51b --- /dev/null +++ b/tests/regress/hook_add_crash.py @@ -0,0 +1,13 @@ +#!/usr/bin/env python + +"""https://github.com/unicorn-engine/unicorn/issues/165""" + +import unicorn + +def hook_mem_read_unmapped(mu, access, address, size, value, user_data): + pass + +mu = unicorn.Uc(unicorn.UC_ARCH_X86, unicorn.UC_MODE_32) + +for x in range(0, 1000): + mu.hook_add(unicorn.UC_HOOK_MEM_READ_UNMAPPED, hook_mem_read_unmapped, None)