From 756b4ccfd6cc218ac4195122fa815482d67ba085 Mon Sep 17 00:00:00 2001 From: Ryan Hileman Date: Mon, 7 Sep 2015 12:43:17 -0700 Subject: [PATCH] add test for #118 --- regress/arm_bxeq_hang.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100755 regress/arm_bxeq_hang.py diff --git a/regress/arm_bxeq_hang.py b/regress/arm_bxeq_hang.py new file mode 100755 index 00000000..0e4a6116 --- /dev/null +++ b/regress/arm_bxeq_hang.py @@ -0,0 +1,15 @@ +#!/usr/bin/python + +from unicorn import * +from unicorn.arm_const import * + +uc = Uc(UC_ARCH_ARM, UC_MODE_ARM) +uc.mem_map(0x1000, 0x1000) +uc.mem_write(0x1000, '1eff2f010000a0e1'.decode('hex')) +def hook_block(uc, addr, *args): + print 'enter block 0x%04x' % addr + +uc.reg_write(UC_ARM_REG_LR, 0x1004) +uc.hook_add(UC_HOOK_BLOCK, hook_block) +print 'block should only run once' +uc.emu_start(0x1000, 0x1004, timeout=250)