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

[[email protected]:141] TypeError: Type violation: 'unknown type' #442

Open
bugfinder-bot opened this issue Oct 22, 2024 · 3 comments · May be fixed by #443
Open

[[email protected]:141] TypeError: Type violation: 'unknown type' #442

bugfinder-bot opened this issue Oct 22, 2024 · 3 comments · May be fixed by #443
Labels
bug Something isn't working bugfinder

Comments

@bugfinder-bot
Copy link
Collaborator

What happened?

  File "/opt/dewolf/decompiler/util/bugfinder/bugfinder.py", line 201, in iter_function_reports
    task, code = self.decompile(function, task_options=options)
  File "/opt/dewolf/decompile.py", line 80, in decompile
    result = self.decompile_all([function_id], task_options)
  File "/opt/dewolf/decompile.py", line 64, in decompile_all
    self._frontend.lift(task)
  File "/opt/dewolf/decompiler/frontend/binaryninja/frontend.py", line 83, in lift
    raise e
  File "/opt/dewolf/decompiler/frontend/binaryninja/frontend.py", line 76, in lift
    task.cfg = parser.parse(function)
  File "/opt/dewolf/decompiler/frontend/binaryninja/parser.py", line 49, 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 148, in _lift_instructions
    if lifted_instruction := self._lifter.lift(instruction):
  File "/opt/dewolf/decompiler/frontend/binaryninja/lifter.py", line 33, in lift
    if pseudo_expression := handler(expression, **kwargs):
  File "/opt/dewolf/decompiler/frontend/binaryninja/handlers/assignments.py", line 56, in lift_assignment
    self._lifter.lift(assignment.src, parent=assignment),
  File "/opt/dewolf/decompiler/frontend/binaryninja/lifter.py", line 33, in lift
    if pseudo_expression := handler(expression, **kwargs):
  File "/opt/dewolf/decompiler/frontend/binaryninja/handlers/constants.py", line 61, in lift_constant_pointer
    res = self._lifter.lift(variable, view=view, parent=pointer)
  File "/opt/dewolf/decompiler/frontend/binaryninja/lifter.py", line 33, in lift
    if pseudo_expression := handler(expression, **kwargs):
  File "/opt/dewolf/decompiler/frontend/binaryninja/handlers/globals.py", line 182, in lift_global_variable
    return self._lift_datavariable_by_type[type(variable.type)](variable, parent, callers=callers)
  File "/opt/dewolf/decompiler/frontend/binaryninja/handlers/globals.py", line 254, in _lift_pointer_type
    return self._build_global_variable(
  File "/opt/dewolf/decompiler/frontend/binaryninja/handlers/globals.py", line 141, in _build_global_variable
    raise TypeError(f"Type violation: '{init_value}'")

Error class [email protected]:141 contains 92 cases.

How to reproduce?

python decompile.py 152ca60d8f08a435af165efbc31760dd2bd59c7b2eef8c6f0a71b9297a848d7d sub_402e6c --debug

sample: 152ca60d8f08a435af165efbc31760dd2bd59c7b2eef8c6f0a71b9297a848d7d
case: https://bugfinder.seclab-bonn.de/case/86154/
dewolf commit: e18c9d3
Binaryninja version: 3.5.4526

@bugfinder-bot bugfinder-bot added bug Something isn't working bugfinder labels Oct 22, 2024
@NeoQuix
Copy link
Collaborator

NeoQuix commented Oct 22, 2024

/cib

Copy link
Contributor

@NeoQuix
Copy link
Collaborator

NeoQuix commented Oct 22, 2024

The PR does not cover all error cases as the trace is utilized to catch all errors in global variable lifting.
However it should fix the problem of stdout/stderr lifting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working bugfinder
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants