Due to changes in the latest Binja version, we have crash when decompiling custom non-library functions in Windows binaries.
We test, if function name is in symbols. The test always returns True, but the list of symbols returned is empty. Thus we get the following error:
Traceback (most recent call last):
File "decompile.py", line 80, in <module>
main(Decompiler)
File "/home/mry/.binaryninja/plugins/dewolf/decompiler/util/commandline.py", line 65, in main
task = decompiler.decompile(function_name, options)
File "decompile.py", line 54, in decompile
task = self._frontend.create_task(function, task_options)
File "/home/mry/.binaryninja/plugins/dewolf/decompiler/frontend/binaryninja/frontend.py", line 55, in create_task
function = self._find_function(function)
File "/home/mry/.binaryninja/plugins/dewolf/decompiler/frontend/binaryninja/frontend.py", line 75, in _find_function
address = self._get_address(function)
File "/home/mry/.binaryninja/plugins/dewolf/decompiler/frontend/binaryninja/frontend.py", line 100, in _get_address
return sym[0].address
IndexError: list index out of range
Instead of checking if name in symbols:
if text in self._bv.symbols:
sym = self._bv.symbols[text]
we should check now if the list of symbols is empty:
What happened?
Due to changes in the latest Binja version, we have crash when decompiling custom non-library functions in Windows binaries. We test, if function name is in symbols. The test always returns
True
, but the list of symbols returned is empty. Thus we get the following error:Instead of checking if name in symbols:
we should check now if the list of symbols is empty:
How to reproduce?
python decompile.py tests/samples/others/test.exe 0x401865
Affected Binary Ninja Version(s)
3.1.3469