diff --git a/uEmu.py b/uEmu.py index 3afd922..7686430 100644 --- a/uEmu.py +++ b/uEmu.py @@ -144,28 +144,35 @@ def inf_is_be(): else: return cvar.inf.mf + @staticmethod + def inf_is_64bit(): + if IDA_SDK_VERSION >= 830: + return inf_is_64bit() + else: + return True if ph.flag & PR_USE64 else False + @staticmethod def get_arch(): - if ph.id == PLFM_386 and ph.flag & PR_USE64: + if ph.id == PLFM_386 and UEMU_HELPERS.inf_is_64bit(): return "x64" - elif ph.id == PLFM_386 and ph.flag & PR_USE32: + elif ph.id == PLFM_386: return "x86" - elif ph.id == PLFM_ARM and ph.flag & PR_USE64: + elif ph.id == PLFM_ARM and UEMU_HELPERS.inf_is_64bit(): if UEMU_HELPERS.inf_is_be(): return "arm64be" else: return "arm64le" - elif ph.id == PLFM_ARM and ph.flag & PR_USE32: + elif ph.id == PLFM_ARM: if UEMU_HELPERS.inf_is_be(): return "armbe" else: return "armle" - elif ph.id == PLFM_MIPS and ph.flag & PR_USE64: + elif ph.id == PLFM_MIPS and UEMU_HELPERS.inf_is_64bit(): if UEMU_HELPERS.inf_is_be(): return "mips64be" else: return "mips64le" - elif ph.id == PLFM_MIPS and ph.flag & PR_USE32: + elif ph.id == PLFM_MIPS: if UEMU_HELPERS.inf_is_be(): return "mipsbe" else: @@ -488,7 +495,7 @@ def get_register_ext_format(arch): @staticmethod def is_thumb_ea(ea): def handler(): - if ph.id == PLFM_ARM and not ph.flag & PR_USE64: + if ph.id == PLFM_ARM and not UEMU_HELPERS.inf_is_64bit(): if IDA_SDK_VERSION >= 700: t = get_sreg(ea, "T") # get T flag else: @@ -664,7 +671,7 @@ def SetContent(self, address, context): if self.extended: value_format = UEMU_HELPERS.get_register_ext_format(arch) else: - if ph.flag & PR_USE64: + if UEMU_HELPERS.inf_is_64bit(): value_format = "0x%.16X" else: value_format = "0x%.8X"