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

[MissingDefinitions] ValueError: list_op [] unknown type = list_op [] unknown type is not in list #174

Open
mm4rks opened this issue Feb 3, 2023 · 2 comments
Labels
bug Something isn't working duplicate This issue or pull request already exists priority-high High priority issue

Comments

@mm4rks
Copy link
Collaborator

mm4rks commented Feb 3, 2023

What happened?

Traceback (most recent call last):
  File "/home/user/dewolf/decompile.py", line 82, in <module>
    main(Decompiler)
  File "/home/user/dewolf/decompiler/util/commandline.py", line 87, in main
    task = decompiler.decompile(function_name, options)
  File "/home/user/dewolf/decompile.py", line 56, in decompile
    pipeline.run(task)
  File "/home/user/dewolf/decompiler/pipeline/pipeline.py", line 109, in run
    raise e
  File "/home/user/dewolf/decompiler/pipeline/pipeline.py", line 102, in run
    instance.run(task)
  File "/home/user/dewolf/decompiler/pipeline/preprocessing/missing_definitions.py", line 99, in run
    self.insert_missing_definitions()
  File "/home/user/dewolf/decompiler/pipeline/preprocessing/missing_definitions.py", line 133, in insert_missing_definitions
    self._insert_definition_if_undefined(variable, previous_ssa_labels, undefined_variables)
  File "/home/user/dewolf/decompiler/pipeline/preprocessing/missing_definitions.py", line 158, in _insert_definition_if_undefined
    self._insert_definition_of_aliased(variable, previous_ssa_labels)
  File "/home/user/dewolf/decompiler/pipeline/preprocessing/missing_definitions.py", line 176, in _insert_definition_of_aliased
    position_insert_definition = self._find_position_to_insert_aliased_definition(basicblock_for_definition, memory_instruction)
  File "/home/user/dewolf/decompiler/pipeline/preprocessing/missing_definitions.py", line 202, in _find_position_to_insert_aliased_definition
    position_insert_definition = self._get_insertion_position(memory_instruction, basicblock)
  File "/home/user/dewolf/decompiler/pipeline/preprocessing/missing_definitions.py", line 218, in _get_insertion_position
    position_insert_definition = basicblock.instructions.index(memory_instruction, starting_search) + 1
ValueError: list_op [] unknown type = list_op [] unknown type is not in list

How to reproduce?

python decompile.py 7923f949e7422ac02c2dc5148950861f8102c83859f00b7d09857b95f16f7caf ___scrt_fastfail --pipeline.debug

Affected Binary Ninja Version(s)

3.3.3996 (Build ID e34a955e)

@mm4rks mm4rks added bug Something isn't working priority-high High priority issue labels Feb 3, 2023
@NeoQuix NeoQuix assigned NeoQuix and unassigned NeoQuix Feb 24, 2023
@NeoQuix
Copy link
Collaborator

NeoQuix commented Mar 2, 2023

Another binary with error in main: x.zip

@ebehner
Copy link
Collaborator

ebehner commented Apr 27, 2023

It seems that the problem occurs because variables with the same name and ssa-label have different types. This should not happen at this time. The pipeline-stage Coherence does not handle this. Here, we check only for each variable together with its SSA-label whether they have the same type. I think for aliased variables they should have the same type independent of the label.

Non-SSA-Block with variable var_33c:
coherence_non_ssa

SSA-Block with variable var_33c, we add the SSA-label here:
coherence_ssa

The problem is that var_33c#1 has type int * aliased: False, whereas var_33c#3 has type unkown type aliased: True:
image

The coherence stage sets all aliased values to true, but it only checks for the same label, whether they have the same type.
At least for aliased-variables, this should not be the case. For all other, we can discuss this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working duplicate This issue or pull request already exists priority-high High priority issue
Projects
None yet
Development

No branches or pull requests

3 participants