Bug Description:
Iterating over mlil_functions breaks if there is a function skipped by analysis.
Traceback (most recent call last): File "<console>", line 1, in <module> File "C:\Users\\AppData\Local\Vector35\BinaryNinja\plugins\..\python\binaryninja\binaryview.py", line 2261, in mlil_functions yield func.mlil File "C:\Users\\AppData\Local\Vector35\BinaryNinja\plugins\..\python\binaryninja\function.py", line 885, in mlil return mediumlevelil.MediumLevelILFunction(self.arch, core.BNGetFunctionMediumLevelIL(self.handle), self) File "C:\Users\\AppData\Local\Vector35\BinaryNinja\plugins\..\python\binaryninja\mediumlevelil.py", line 2663, in __init__ _handle = core.BNCreateMediumLevelILFunction(self.arch.handle, func_handle) File "C:\Users\\AppData\Local\Vector35\BinaryNinja\plugins\..\python\binaryninja\mediumlevelil.py", line 3081, in arch return self._arch AttributeError: 'MediumLevelILFunction' object has no attribute '_arch'
Steps To Reproduce:
Set analysis.limits.maxFunctionAnalysisTime to a very low value (I used 10ms)
Load a binary
Execute list(bv.mlil_functions()) in the console
Expected Behavior:
I believe past versions returned a dummy MLIL function object in this case. That had the correct source_function attr, and that source_function object had skipped = True.
Additional
There is a path to this same bug through bv.get_callers() as well, when you try to access .mlils off a function in that iteration.
Version and Platform (required):
Bug Description: Iterating over mlil_functions breaks if there is a function skipped by analysis.
Traceback (most recent call last): File "<console>", line 1, in <module> File "C:\Users\\AppData\Local\Vector35\BinaryNinja\plugins\..\python\binaryninja\binaryview.py", line 2261, in mlil_functions yield func.mlil File "C:\Users\\AppData\Local\Vector35\BinaryNinja\plugins\..\python\binaryninja\function.py", line 885, in mlil return mediumlevelil.MediumLevelILFunction(self.arch, core.BNGetFunctionMediumLevelIL(self.handle), self) File "C:\Users\\AppData\Local\Vector35\BinaryNinja\plugins\..\python\binaryninja\mediumlevelil.py", line 2663, in __init__ _handle = core.BNCreateMediumLevelILFunction(self.arch.handle, func_handle) File "C:\Users\\AppData\Local\Vector35\BinaryNinja\plugins\..\python\binaryninja\mediumlevelil.py", line 3081, in arch return self._arch AttributeError: 'MediumLevelILFunction' object has no attribute '_arch'
Steps To Reproduce:
list(bv.mlil_functions())
in the consoleExpected Behavior: I believe past versions returned a dummy MLIL function object in this case. That had the correct source_function attr, and that source_function object had skipped = True.
Additional There is a path to this same bug through
bv.get_callers()
as well, when you try to access.mlils
off a function in that iteration.