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

[Lifter] AttributeError: 'NoneType' object has no attribute 'get_string_after_name' #301

Closed NeoQuix closed 10 months ago

NeoQuix 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 34, in parse
    index_to_BasicBlock[basic_block.index] = BasicBlock(basic_block.index, instructions=list(self._lift_instructions(basic_block)))
  File "/opt/dewolf/decompiler/frontend/binaryninja/parser.py", line 77, in _lift_instructions
    if lifted_instruction := self._lifter.lift(instruction):
  File "/opt/dewolf/decompiler/frontend/binaryninja/lifter.py", line 28, in lift
    if pseudo_expression := handler(expression, **kwargs):
  File "/opt/dewolf/decompiler/frontend/binaryninja/handlers/calls.py", line 43, in lift_call
    meta_data={"param_names": self._lift_call_parameter_names(call), "is_tailcall": isinstance(call, Tailcall)},
  File "/opt/dewolf/decompiler/frontend/binaryninja/handlers/calls.py", line 77, in _lift_call_parameter_names
    clean_type_string_of_parameters = instruction.dest.expr_type.get_string_after_name().strip("()")

Problem: Call a variable, e.g.:

...
arg1();
...

How to reproduce?

93a871bef5d6cc4cc4104d8a1ad6b3e47d1ed1dac604d6410680c2841eb35a52.zip in sub_29d0

Affected Binary Ninja Version(s)

-

NeoQuix commented 11 months ago

/cib

github-actions[bot] commented 11 months ago

Branch issue-301-_Lifter_AttributeError_NoneType_object_has_no_attribute_get_string_after_name created!