Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Switch variable detection] No switch variable candidate found #217

Open
NeoQuix opened this issue Apr 6, 2023 · 5 comments · May be fixed by #339
Open

[Switch variable detection] No switch variable candidate found #217

NeoQuix opened this issue Apr 6, 2023 · 5 comments · May be fixed by #339
Assignees
Labels
bug Something isn't working priority-high High priority issue

Comments

@NeoQuix
Copy link
Collaborator

NeoQuix commented Apr 6, 2023

What happened?

Error in bin/esentutl.exe in 0x140002c20
[pipeline.py:107 run()] ERROR - Failed to decompile ?ErrPrintField@@YAJQEBUESEUTIL_SPACE_DUMP_CTX@@QEBU_BTREE_STATS@@QEBU_BTREE_POST_COMPUTED_SPACE_STATS@@K@Z, error during stage backward-slice-switch-variable-detection: No switch variable candidate found.
Traceback (most recent call last):
  File "/home/neoquix/Git-Repos/DeWolf/decompile.py", line 76, in <module>
    main(Decompiler)
  File "/home/neoquix/Git-Repos/DeWolf/decompiler/util/commandline.py", line 80, in main
    task = decompiler.decompile(function_name, options)
  File "/home/neoquix/Git-Repos/DeWolf/decompile.py", line 51, in decompile
    pipeline.run(task)
  File "/home/neoquix/Git-Repos/DeWolf/decompiler/pipeline/pipeline.py", line 109, in run
    raise e
  File "/home/neoquix/Git-Repos/DeWolf/decompiler/pipeline/pipeline.py", line 102, in run
    instance.run(task)
  File "/home/neoquix/Git-Repos/DeWolf/decompiler/pipeline/preprocessing/switch_variable_detection.py", line 91, in run
    self._handle_switch_block(switch_block)
  File "/home/neoquix/Git-Repos/DeWolf/decompiler/pipeline/preprocessing/switch_variable_detection.py", line 106, in _handle_switch_block
    switch_expression = self.find_switch_expression(switch_instruction)
  File "/home/neoquix/Git-Repos/DeWolf/decompiler/pipeline/preprocessing/switch_variable_detection.py", line 117, in find_switch_expression
    raise ValueError("No switch variable candidate found.")
ValueError: No switch variable candidate found.

How to reproduce?

Decompile esentutl at 0x140002c20

Affected Binary Ninja Version(s)

3.3.3996

@NeoQuix NeoQuix added bug Something isn't working priority-high High priority issue labels Apr 6, 2023
@NeoQuix
Copy link
Collaborator Author

NeoQuix commented Apr 13, 2023

Maybe fixed with #113, blocked until.

@NeoQuix NeoQuix added the blocked Is blocked by another issue label Apr 13, 2023
@ebehner ebehner removed the blocked Is blocked by another issue label Jul 26, 2023
@ebehner
Copy link
Collaborator

ebehner commented Jul 26, 2023

could be related to #284

@mm4rks
Copy link
Collaborator

mm4rks commented Sep 17, 2023

Backward slice of switch variable ends in undefined variable (arg_28#0). We could assume that only globals and function arguments are not not defined in the current cfg and allow switching on undef variables...

@mm4rks
Copy link
Collaborator

mm4rks commented Sep 17, 2023

/cib

@github-actions
Copy link
Contributor

github-actions bot pushed a commit that referenced this issue Sep 17, 2023
@mm4rks mm4rks self-assigned this Sep 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working priority-high High priority issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants