fkie-cad / dewolf

A research decompiler implemented as a Binary Ninja plugin.
GNU Lesser General Public License v2.1
162 stars 9 forks source link

[AttributeError@parser.py:33] AttributeError: 'NoneType' object has no attribute 'ssa_form' #291

Closed bugfinder-bot closed 2 months ago

bugfinder-bot commented 11 months ago

What happened?


  File "/opt/dewolf/decompiler/util/bugfinder/bugfinder.py", line 190, in iter_function_reports
    task_result = self.decompile(function, options)
  File "/opt/dewolf/decompile.py", line 50, in decompile
    task = self._frontend.create_task(function, task_options)
  File "/opt/dewolf/decompiler/frontend/binaryninja/frontend.py", line 143, in create_task
    raise e
  File "/opt/dewolf/decompiler/frontend/binaryninja/frontend.py", line 130, in create_task
    cfg = self._extract_cfg(function.function, options)
  File "/opt/dewolf/decompiler/frontend/binaryninja/frontend.py", line 162, in _extract_cfg
    return parser.parse(function)
  File "/opt/dewolf/decompiler/frontend/binaryninja/parser.py", line 33, in parse
    for basic_block in function.medium_level_il.ssa_form:

Error class AttributeError@parser.py:33 contains 14 cases.

How to reproduce?

python decompile.py c1d9fea2199334ac7ef38db208c10cbda10e105e9ff748d3c154f56fc455e8e8 script_lib_image_destroy --debug

sample: c1d9fea2199334ac7ef38db208c10cbda10e105e9ff748d3c154f56fc455e8e8 case: https://bugfinder.seclab-bonn.de/case/28/ dewolf commit: 84caaa95 Binaryninja version: 3.4.4271

NeoQuix commented 11 months ago

/cib

github-actions[bot] commented 11 months ago

Branch issue-291-_AttributeError_parser_py_33_AttributeError_NoneType_object_has_no_attribute_ssa_form created!

NeoQuix commented 11 months ago

Some functions will not generate a MLIL because of internal binary ninja errors. ==> Check if property MLIL is present for a given function before trying to parse it. ==> Throw ValueError at CFG creation

Also we use BinaryViewType which should only be used internally to create a binary view. ==> Exchange function to load which should be the default for version 3.5.

Another thing closely related to this kind of problem:

Again 3.4 is kinda weird with this flag, some functions are not detected properly (not in the API, but in the GUI) ==> 3.5 fixes that for the functions i tested

==> bundle changes together + block until 3.5

NeoQuix commented 11 months ago

Add changes for 3.5 as well in this issue

NeoQuix commented 11 months ago

Change of plan: 3.5 dev does not really work with internal view ==> split into original problem + 3.5 update issue