diff options
| author | serpilliere <serpilliere@users.noreply.github.com> | 2020-04-13 19:23:05 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-04-13 19:23:05 +0200 |
| commit | 5b33db2100c1c3cad3be9fbe12c2e9286d007323 (patch) | |
| tree | 1e68b7589c6d744c3b1b5948b86d1dd62812d07c | |
| parent | 7b8354e34da05a6c782f639799ac448c99f4dded (diff) | |
| parent | 3a332c925b07ab679791bf3f2558cbfa1e72eb9c (diff) | |
| download | miasm-5b33db2100c1c3cad3be9fbe12c2e9286d007323.tar.gz miasm-5b33db2100c1c3cad3be9fbe12c2e9286d007323.zip | |
Merge pull request #1180 from serpilliere/updt_mips_instr
Fix mips arch tipo
| -rw-r--r-- | miasm/arch/mips32/arch.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/miasm/arch/mips32/arch.py b/miasm/arch/mips32/arch.py index d0403ba0..f1e52585 100644 --- a/miasm/arch/mips32/arch.py +++ b/miasm/arch/mips32/arch.py @@ -95,8 +95,9 @@ class instruction_mips32(cpu.instruction): def dstflow2label(self, loc_db): if self.name in ["J", 'JAL']: - expr = int(self.args[0]) - addr = (self.offset & (0xFFFFFFFF ^ ((1<< 28)-1))) + expr + expr = self.args[0] + offset = int(expr) + addr = ((self.offset & (0xFFFFFFFF ^ ((1<< 28)-1))) + offset) & int(expr.mask) loc_key = loc_db.get_or_create_offset_location(addr) self.args[0] = ExprLoc(loc_key, expr.size) return @@ -106,7 +107,7 @@ class instruction_mips32(cpu.instruction): if not isinstance(expr, ExprInt): return - addr = int(expr) + self.offset + addr = (int(expr) + self.offset) & int(expr.mask) loc_key = loc_db.get_or_create_offset_location(addr) self.args[ndx] = ExprLoc(loc_key, expr.size) |