Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 15 additions & 8 deletions uEmu.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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"
Expand Down