diff options
| author | Fabrice Desclaux <fabrice.desclaux@cea.fr> | 2015-02-11 12:25:39 +0100 |
|---|---|---|
| committer | Fabrice Desclaux <fabrice.desclaux@cea.fr> | 2015-02-11 13:27:14 +0100 |
| commit | 598f3609bdd47e57e72b3dee1bf53bbe1ecf62d4 (patch) | |
| tree | 0b80692487eec201062002d338261819a248bef1 /miasm2/core/cpu.py | |
| parent | 74cc70d786c73dcf7369349976761276f6940a58 (diff) | |
| download | miasm-598f3609bdd47e57e72b3dee1bf53bbe1ecf62d4.tar.gz miasm-598f3609bdd47e57e72b3dee1bf53bbe1ecf62d4.zip | |
CPU: update api to handle IOError during disasm
Diffstat (limited to 'miasm2/core/cpu.py')
| -rw-r--r-- | miasm2/core/cpu.py | 8 |
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 |