fkie-cad / dewolf

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

[ValueError@switch_variable_detection.py:117] ValueError: No switch variable candidate found. #279

Closed bugfinder-bot closed 1 year ago

bugfinder-bot commented 1 year 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 51, in decompile
    pipeline.run(task)
  File "/opt/dewolf/decompiler/pipeline/pipeline.py", line 109, in run
    raise e
  File "/opt/dewolf/decompiler/pipeline/pipeline.py", line 102, in run
    instance.run(task)
  File "/opt/dewolf/decompiler/pipeline/preprocessing/switch_variable_detection.py", line 91, in run
    self._handle_switch_block(switch_block)
  File "/opt/dewolf/decompiler/pipeline/preprocessing/switch_variable_detection.py", line 106, in _handle_switch_block
    switch_expression = self.find_switch_expression(switch_instruction)
  File "/opt/dewolf/decompiler/pipeline/preprocessing/switch_variable_detection.py", line 117, in find_switch_expression
    raise ValueError("No switch variable candidate found.")

Error class ValueError@switch_variable_detection.py:117 contains 47 cases.

How to reproduce?

python decompile.py 146c6f32f783030acc14eca78d340b6c5bb57733ff1c032c1ed78b96d0148c21 sub_8960 --debug

sample: 146c6f32f783030acc14eca78d340b6c5bb57733ff1c032c1ed78b96d0148c21 case: https://bugfinder.seclab-bonn.de/case/1799/ dewolf commit: 1c34ffef Binaryninja version: 3.4.4271

mm4rks commented 1 year ago

CFG before backward-slice-switch-variable-detection stage:

test_cfg

mm4rks commented 1 year ago

/cib

github-actions[bot] commented 1 year ago

Branch issue-279-_ValueError_switch_variable_detection_py_117_ValueError_No_switch_variable_candidate_found created!