Skip to content

BinExport assertion fail for register (unexpected child expression) #2528

@mr-tz

Description

@mr-tz

sample available on request

$ python scripts/inspect-binexport2.py tests/data/binexport2/sample.BinExport -d                                                                                                                                                                                             ─╯
DEBUG    inspect-binexport2: perf: loading BinExport2: 0.10s                                                                                                                                                                                                                                                               inspect-binexport2.py:31
DEBUG    inspect-binexport2: perf: indexing BinExport2: 1.56s                                                                                                                                                                                                                                                              inspect-binexport2.py:31
Traceback (most recent call last):
  File "capa/scripts/inspect-binexport2.py", line 461, in <module>
    sys.exit(main())
             ^^^^^^
  File "capa/scripts/inspect-binexport2.py", line 369, in main
    operands.append(render_operand(be2, operand, index=operand_index))
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "capa/scripts/inspect-binexport2.py", line 210, in render_operand
    _render_expression_tree(be2, operand, tree, 0, o)
  File "capa/scripts/inspect-binexport2.py", line 162, in _render_expression_tree
    raise NotImplementedError(len(children_tree_indexes))
NotImplementedError: 0

when passing that exception:

Traceback (most recent call last):
  File "capa/scripts/inspect-binexport2.py", line 462, in <module>
    sys.exit(main())
             ^^^^^^
  File "capa/scripts/inspect-binexport2.py", line 370, in main
    operands.append(render_operand(be2, operand, index=operand_index))
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "capa/scripts/inspect-binexport2.py", line 211, in render_operand
    _render_expression_tree(be2, operand, tree, 0, o)
  File "capa/scripts/inspect-binexport2.py", line 84, in _render_expression_tree
    assert len(children_tree_indexes) == 0
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError

on first triage I see a register with symbol z3 and child expression .

likely an issue in the BinExport plugin, which could be handled more gracefully here

Metadata

Metadata

Labels

binexportrelated to BinExport supportbugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions