Skip to content

Commit

Permalink
idapython: add support for SPARC and PowerPC
Browse files Browse the repository at this point in the history
  • Loading branch information
invano authored and imbillow committed Aug 20, 2020
1 parent 17392e9 commit 9c55c12
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions idb/idapython.py
Original file line number Diff line number Diff line change
Expand Up @@ -1007,6 +1007,38 @@ def _disassemble(self, ea):
capstone.CS_ARCH_MIPS,
capstone.CS_MODE_MIPS64 | capstone.CS_MODE_LITTLE_ENDIAN,
)
elif procname == "ppc":
if bitness == 32:
dis = self._load_dis(
capstone.CS_ARCH_PPC,
capstone.CS_MODE_32 | capstone.CS_MODE_BIG_ENDIAN,
)
elif bitness == 64:
dis = self._load_dis(
capstone.CS_ARCH_PPC,
capstone.CS_MODE_64 | capstone.CS_MODE_BIG_ENDIAN,
)
elif procname == "ppcl":
if bitness == 32:
dis = self._load_dis(
capstone.CS_ARCH_PPC,
capstone.CS_MODE_32 | capstone.CS_MODE_LITTLE_ENDIAN,
)
elif bitness == 64:
dis = self._load_dis(
capstone.CS_ARCH_PPC,
capstone.CS_MODE_64 | capstone.CS_MODE_LITTLE_ENDIAN,
)
elif procname == "sparcb":
if bitness == 32:
dis = self._load_dis(
capstone.CS_ARCH_SPARC, capstone.CS_MODE_BIG_ENDIAN
)
elif procname == "sparcl":
if bitness == 32:
dis = self._load_dis(
capstone.CS_ARCH_SPARC, capstone.CS_MODE_LITTLE_ENDIAN
)

if dis is None:
raise NotImplementedError(
Expand Down

0 comments on commit 9c55c12

Please sign in to comment.