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]:264] UnboundLocalError: local variable 'init_value' referenced before assignment #448

Closed
bugfinder-bot opened this issue Dec 11, 2024 · 2 comments · Fixed by #449
Assignees
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 88, in lift
    raise e
  File "/opt/dewolf/decompiler/frontend/binaryninja/frontend.py", line 81, 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 133, in lift_store
    self._lift_store_destination(assignment),
  File "/opt/dewolf/decompiler/frontend/binaryninja/handlers/assignments.py", line 142, in _lift_store_destination
    store_destination = self._lifter.lift(store_assignment.dest, parent=store_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 60, 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 264, in _lift_pointer_type
    init_value=init_value,

Error class [email protected]:264 contains 6102 cases.

How to reproduce?

python decompile.py f920d07c44f35ed055b47c3bc33cfb8e2331b775dace9726ffd0a546b68bc890 sub_2750 --debug

sample: f920d07c44f35ed055b47c3bc33cfb8e2331b775dace9726ffd0a546b68bc890
case: https://bugfinder.seclab-bonn.de/case/121026/
dewolf commit: 8637644
Binaryninja version: 3.5.4526

@bugfinder-bot bugfinder-bot added bug Something isn't working bugfinder labels Dec 11, 2024
@rihi rihi self-assigned this Dec 11, 2024
@rihi
Copy link
Collaborator

rihi commented Dec 11, 2024

/cib

Copy link
Contributor

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
2 participants