Skip to content

Instantly share code, notes, and snippets.

@uyjulian
Last active April 17, 2025 13:19
Show Gist options
  • Save uyjulian/cd583ea8d915e322444230bec41e428e to your computer and use it in GitHub Desktop.
Save uyjulian/cd583ea8d915e322444230bec41e428e to your computer and use it in GitHub Desktop.
# PPC440x AUX instructions to dcread instructions
from idaapi import *
from idautils import *
def main():
# Loop through all the segments and scan any marked as code.
seg = ida_segment.get_first_seg()
while seg is not None:
print("Scanning %s" % ida_segment.get_segm_name(seg))
# Search the segment for AUX instructions
for i in range(seg.startEA, seg.endEA, 4):
val = ida_bytes.get_dword(i)
if ((val & 0xFF000000) == 0) and ((val & 0x00FFFFFF) != 0):
ida_bytes.patch_dword(i, ((x & 0x03fffc00) | 0x7c0003cc))
# Next segment.
seg = ida_segment.get_next_seg(seg.startEA)
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment