about summary refs log tree commit diff stats
path: root/miasm2/ir/symbexec.py
diff options
context:
space:
mode:
authorCamille Mougey <commial@gmail.com>2017-08-09 09:12:40 +0200
committerGitHub <noreply@github.com>2017-08-09 09:12:40 +0200
commit0303602135a98e3bd91dda245f9344f06b293da9 (patch)
treef3cbbb72e57bad1a7a3c22f474f6f13e59cd03ad /miasm2/ir/symbexec.py
parentc8f218b0427ae7d42313d11bf5a94b009d4f7f25 (diff)
parentd2756cb85f4b06280fb38eb32f6322ffbd0e17ca (diff)
downloadmiasm-0303602135a98e3bd91dda245f9344f06b293da9.tar.gz
miasm-0303602135a98e3bd91dda245f9344f06b293da9.zip
Merge pull request #596 from serpilliere/fix_ctype
Fix ctype
Diffstat (limited to '')
-rw-r--r--miasm2/ir/symbexec.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/miasm2/ir/symbexec.py b/miasm2/ir/symbexec.py
index 6d6ba630..593ab49a 100644
--- a/miasm2/ir/symbexec.py
+++ b/miasm2/ir/symbexec.py
@@ -16,6 +16,18 @@ log.addHandler(console_handler)
 log.setLevel(logging.INFO)
 
 
+def get_block(ir_arch, mdis, addr):
+    """Get IRBlock at address @addr"""
+    lbl = ir_arch.get_label(addr)
+    if not lbl in ir_arch.blocks:
+        block = mdis.dis_block(lbl.offset)
+        ir_arch.add_block(block)
+    irblock = ir_arch.get_block(lbl)
+    if irblock is None:
+        raise LookupError('No block found at that address: %s' % lbl)
+    return irblock
+
+
 class SymbolMngr(object):
     """
     Store registers and memory symbolic values