diff options
| author | Fabrice Desclaux <fabrice.desclaux@cea.fr> | 2018-08-06 08:01:59 +0200 |
|---|---|---|
| committer | Fabrice Desclaux <fabrice.desclaux@cea.fr> | 2018-08-06 18:58:07 +0200 |
| commit | d4a84bb5a9c382c56a3f1b6db89d5312c2fb7310 (patch) | |
| tree | 2cfe7acf6e44f31e8d42ee0f4c4ee6804725f2e4 | |
| parent | b8d6b97b0f47a8e97f7c52ef0bd7b44a2e1fdc2b (diff) | |
| download | miasm-d4a84bb5a9c382c56a3f1b6db89d5312c2fb7310.tar.gz miasm-d4a84bb5a9c382c56a3f1b6db89d5312c2fb7310.zip | |
MEP: fix signext in disasm
| -rw-r--r-- | miasm2/arch/mep/arch.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/miasm2/arch/mep/arch.py b/miasm2/arch/mep/arch.py index 3f844c06..a4c7182a 100644 --- a/miasm2/arch/mep/arch.py +++ b/miasm2/arch/mep/arch.py @@ -939,7 +939,8 @@ class mep_target24_signed(mep_target24): mep_target24.decode(self, v) v = int(self.expr.arg) - self.expr = ExprInt(v, 24).signExtend(32) + self.expr = ExprInt(sign_ext(v, 24, 32), 32) + return True @@ -1160,7 +1161,7 @@ class mep_disp12_align2_signed(mep_disp12_align2): mep_disp12_align2.decode(self, v) v = int(self.expr.arg) - self.expr = ExprInt(v, 12).signExtend(32) + self.expr = ExprInt(sign_ext(v, 12, 32), 32) return True |