From 598f3609bdd47e57e72b3dee1bf53bbe1ecf62d4 Mon Sep 17 00:00:00 2001 From: Fabrice Desclaux Date: Wed, 11 Feb 2015 12:25:39 +0100 Subject: CPU: update api to handle IOError during disasm --- miasm2/core/cpu.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'miasm2/core/cpu.py') diff --git a/miasm2/core/cpu.py b/miasm2/core/cpu.py index d5464305..3fbe1e22 100644 --- a/miasm2/core/cpu.py +++ b/miasm2/core/cpu.py @@ -1044,10 +1044,12 @@ class cls_mn(object): # print 'len', fname, l if l is not None: # print fname, hex(bs_l), l - if bs_l * 8 - offset_b < l: - continue # print hex(offset_b) - v = cls.getbits(bs, attrib, offset_b, l) + try: + v = cls.getbits(bs, attrib, offset_b, l) + except IOError: + # Raised if offset is out of bound + continue # print 'TEST', bval, fname, offset_b, cpt, (l, fmask, fbits), # hex(v), hex(v & fmask), hex(fbits), v & fmask == fbits offset_b += l -- cgit 1.4.1