about summary refs log tree commit diff stats
path: root/miasm2/core/cpu.py
diff options
context:
space:
mode:
Diffstat (limited to 'miasm2/core/cpu.py')
-rw-r--r--miasm2/core/cpu.py8
1 files changed, 5 insertions, 3 deletions
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