From 8d2a5d2dd267f2240e14c5ebe238dd0f44a2474e Mon Sep 17 00:00:00 2001 From: Fabrice Desclaux Date: Thu, 21 Jan 2016 16:18:44 +0100 Subject: Asmbloc: fix get_range (creds: @commial) --- miasm2/core/asmbloc.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/miasm2/core/asmbloc.py b/miasm2/core/asmbloc.py index 7089e888..3517d452 100644 --- a/miasm2/core/asmbloc.py +++ b/miasm2/core/asmbloc.py @@ -166,8 +166,10 @@ class asm_bloc(object): return new_bloc def get_range(self): + """Returns the offset hull of an asm_bloc""" if len(self.lines): - return self.lines[0].offset, self.lines[-1].offset + return (self.lines[0].offset, + self.lines[-1].offset + self.lines[-1].l) else: return 0, 0 @@ -544,7 +546,7 @@ def split_bloc(mnemo, attrib, pool_bin, blocs, a, b = cb.get_range() for off in bloc_dst: - if not (off > a and off <= b): + if not (off > a and off < b): continue l = symbol_pool.getby_offset_create(off) new_b = cb.split(off, l) -- cgit 1.4.1