diff options
| author | Camille Mougey <commial@gmail.com> | 2015-01-26 17:03:00 +0100 |
|---|---|---|
| committer | Camille Mougey <commial@gmail.com> | 2015-01-26 17:03:00 +0100 |
| commit | 9ce67b459cc8946c81181ab22030786450b8b0c5 (patch) | |
| tree | af11ee8fbaff14fce0e7ece814b867bb7db0af9d /miasm2/arch/mips32/arch.py | |
| parent | b87f775c1a6a5c78c62beee925eaba6dc337577e (diff) | |
| parent | 49300708f13622595c3cc147a03b6c7848da195d (diff) | |
| download | miasm-9ce67b459cc8946c81181ab22030786450b8b0c5.tar.gz miasm-9ce67b459cc8946c81181ab22030786450b8b0c5.zip | |
Merge pull request #48 from serpilliere/arm_fix_flow
Arm: fix execflow code
Diffstat (limited to '')
| -rw-r--r-- | miasm2/arch/mips32/arch.py | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/miasm2/arch/mips32/arch.py b/miasm2/arch/mips32/arch.py index b3bbc3ff..ac22f7c9 100644 --- a/miasm2/arch/mips32/arch.py +++ b/miasm2/arch/mips32/arch.py @@ -50,10 +50,9 @@ deref = deref_off | deref_nooff class additional_info: def __init__(self): self.except_on_instr = False -br_flt = ['BC1F'] -br_0 = ['B', 'JR', 'BAL', 'JAL', 'JALR'] -br_1 = ['BGEZ', 'BLTZ', 'BGTZ', 'BLEZ', 'BC1T', 'BC1F'] + br_flt +br_0 = ['B', 'J', 'JR', 'BAL', 'JAL', 'JALR'] +br_1 = ['BGEZ', 'BLTZ', 'BGTZ', 'BLEZ', 'BC1T', 'BC1F'] br_2 = ['BEQ', 'BEQL', 'BNE'] @@ -78,9 +77,7 @@ class instruction_mips32(instruction): def dstflow(self): if self.name == 'BREAK': return False - if self.name.startswith('B'): - return True - if self.name in ['JAL', 'JALR', 'JR', 'J']: + if self.name in br_0 + br_1 + br_2: return True return False @@ -116,19 +113,15 @@ class instruction_mips32(instruction): def breakflow(self): if self.name == 'BREAK': return False - if self.name.startswith('B') or self.name in ['JR', 'J', 'JAL', 'JALR']: + if self.name in br_0 + br_1 + br_2: return True return False def is_subcall(self): - if self.name in ['JAL', 'JALR']: + if self.name in ['JAL', 'JALR', 'BAL']: return True return False - if self.name == 'BLX': - return True - return self.additional_info.lnk - def getdstflow(self, symbol_pool): if self.name in br_0: return [self.args[0]] |