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

[UnicodeDecodeError@_binaryninjacore.py:36] UnicodeDecodeError: 'utf-8' codec can't decode byte 0x85 in position 0: invalid start byte #431

Open
bugfinder-bot opened this issue Aug 14, 2024 · 2 comments
Labels
bug Something isn't working bugfinder upstream

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 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/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 43, in lift_constant
    if addr_in_section(constant.function.view, constant.constant):
  File "/opt/dewolf/decompiler/frontend/binaryninja/handlers/globals.py", line 346, in addr_in_section
    for _, section in view.sections.items():
  File "/opt/binaryninja/python/binaryninja/binaryview.py", line 2854, in sections
    result[core.BNSectionGetName(section_list[i])] = Section(section_handle)
  File "/opt/binaryninja/python/binaryninja/_binaryninjacore.py", line 44478, in BNSectionGetName
    string = str(pyNativeStr(ctypes.cast(result, ctypes.c_char_p).value))
  File "/opt/binaryninja/python/binaryninja/_binaryninjacore.py", line 36, in pyNativeStr
    return arg.decode('utf8')

Error class UnicodeDecodeError@_binaryninjacore.py:36 contains 1284 cases.

How to reproduce?

python decompile.py 2d101cb5e071b57f48d93ad4cf1caa07199693d8073802209e6bf6e5a9188eb9 Uzma_index_iter_init --debug

sample: 2d101cb5e071b57f48d93ad4cf1caa07199693d8073802209e6bf6e5a9188eb9
case: https://bugfinder.seclab-bonn.de/case/61955/
dewolf commit: ad2f8a3
Binaryninja version: 3.5.4526

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

NeoQuix commented Aug 14, 2024

Upstream: Vector35/binaryninja-api#5847

@NeoQuix NeoQuix added blocked Is blocked by another issue upstream labels Aug 14, 2024
@NeoQuix
Copy link
Collaborator

NeoQuix commented Oct 22, 2024

Fixed in BNinja 4.2.6073-dev

@NeoQuix NeoQuix removed the blocked Is blocked by another issue label Oct 22, 2024
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 upstream
Projects
None yet
Development

No branches or pull requests

2 participants