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

[ctypes.ArgumentError@_binaryninjacore.py:18869] ctypes.ArgumentError: argument 2: TypeError: wrong type #419

Closed
bugfinder-bot opened this issue Jun 19, 2024 · 2 comments · Fixed by #420
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 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/binary.py", line 52, in lift_binary_operation
    [self._lifter.lift(x, parent=operation) for x in operation.operands],
  File "/opt/dewolf/decompiler/frontend/binaryninja/handlers/binary.py", line 52, in <listcomp>
    [self._lifter.lift(x, parent=operation) for x in operation.operands],
  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 44, in lift_constant
    return self.lift_constant_pointer(constant)
  File "/opt/dewolf/decompiler/frontend/binaryninja/handlers/constants.py", line 60, in lift_constant_pointer
    if variable := view.get_data_var_at(pointer.constant):
  File "/opt/binaryninja/python/binaryninja/binaryview.py", line 4204, in get_data_var_at
    if not core.BNGetDataVariableAtAddress(self.handle, addr, var):
  File "/opt/binaryninja/python/binaryninja/_binaryninjacore.py", line 18869, in BNGetDataVariableAtAddress
    return _BNGetDataVariableAtAddress(view, addr, var)

Error class ctypes.ArgumentError@_binaryninjacore.py:18869 contains 237 cases.

How to reproduce?

python decompile.py 44a158e3dc804558d8f334c1eae54048a5b72d824a9bdb0ebb2bd9772abf91b9 _Z19calculateCollisionsj --debug

sample: 44a158e3dc804558d8f334c1eae54048a5b72d824a9bdb0ebb2bd9772abf91b9
case: https://bugfinder.seclab-bonn.de/case/37163/
dewolf commit: ba2a67a
Binaryninja version: 3.5.4526

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

NeoQuix commented Jun 19, 2024

/cib

@NeoQuix NeoQuix self-assigned this Jun 19, 2024
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