matteyeux / ida-iboot-loader

IDA loader for Apple's 64 bits iBoot, SecureROM and AVPBooter
136 stars 19 forks source link

Update to accept_file error handling #5

Closed demonduck closed 2 months ago

demonduck commented 3 months ago

When looking at small shellcode dumped from memory, IDA would raise an exception text box:

image

Traceback (most recent call last):
  File "/Users/XXXXXXX/.idapro/loaders/iboot-loader.py", line 202, in accept_file
    image_type= fd.read(0x30).decode()
              ^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'decode'

When I followed the logic in a Python interpreter (in IDA and externally) the offending code would return b'' which could be decoded, but when IDA is loading the file the behavior is different. To prevent this error being provided multiple times, I've added handling for the AttributeError exception that could occur.

I'm using IDA Pro Version 8.3.230608 macOS arm64

matteyeux commented 2 months ago

Thank you for the bugfix!