diff options
| author | Camille Mougey <commial@gmail.com> | 2019-03-07 14:37:07 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-03-07 14:37:07 +0100 |
| commit | 4c2320b46250a8d6f8774e1218544b72a154cd8e (patch) | |
| tree | b67e7b072439f84109bd39dad8ed7f3f135224f8 /example/ida/utils.py | |
| parent | eab809932871f91d6f4aa770fc321af9e156e0f5 (diff) | |
| parent | 26c1075723a02984da6d3bc7423c5c0c43082dc3 (diff) | |
| download | miasm-4c2320b46250a8d6f8774e1218544b72a154cd8e.tar.gz miasm-4c2320b46250a8d6f8774e1218544b72a154cd8e.zip | |
Merge pull request #990 from serpilliere/support_python2_python3
Support python2 python3
Diffstat (limited to 'example/ida/utils.py')
| -rw-r--r-- | example/ida/utils.py | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/example/ida/utils.py b/example/ida/utils.py index a64973f1..cb4ef4d8 100644 --- a/example/ida/utils.py +++ b/example/ida/utils.py @@ -1,9 +1,11 @@ +from __future__ import print_function +from builtins import map import idaapi from idc import * -from miasm2.analysis.machine import Machine -from miasm2.ir.translators import Translator -import miasm2.expression.expression as m2_expr +from miasm.analysis.machine import Machine +from miasm.ir.translators import Translator +import miasm.expression.expression as m2_expr def guess_machine(addr=None): "Return an instance of Machine corresponding to the IDA guessed processor" @@ -53,8 +55,8 @@ def guess_machine(addr=None): raise NotImplementedError('not fully functional') machine = Machine(info2machine[infos]) - from miasm2.analysis.disasm_cb import guess_funcs, guess_multi_cb - from miasm2.analysis.disasm_cb import arm_guess_subcall, arm_guess_jump_table + from miasm.analysis.disasm_cb import guess_funcs, guess_multi_cb + from miasm.analysis.disasm_cb import arm_guess_subcall, arm_guess_jump_table guess_funcs.append(arm_guess_subcall) guess_funcs.append(arm_guess_jump_table) @@ -67,7 +69,7 @@ def guess_machine(addr=None): elif processor_name == "PPC": machine = Machine("ppc32b") else: - print repr(processor_name) + print(repr(processor_name)) raise NotImplementedError('not fully functional') return machine @@ -204,7 +206,7 @@ Python Expression dest_lang = self.languages[self.GetControlValue(self.cbLanguage)] try: text = Translator.to_language(dest_lang).from_expr(self.expr) - except Exception, error: + except Exception as error: self.ShowField(self.result, False) return -1 |