Skip to content

Commit

Permalink
handle operator with no children bug
Browse files Browse the repository at this point in the history
  • Loading branch information
mr-tz committed Sep 4, 2024
1 parent 3c97edc commit a97afb7
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion capa/features/extractors/binexport2/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,14 @@ def _get_operand_expression_list(

elif expression.type == BinExport2.Expression.OPERATOR:

if len(children_tree_indexes) == 1:
if len(children_tree_indexes) == 0:
# TODO Ghidra bug?
# https://github.com/mandiant/capa/pull/2340
# 00210184 02 68 61 38 ldrb w2,[x0, x1, LSL ]
# ^^^
pass

elif len(children_tree_indexes) == 1:
# prefix operator, like "ds:"
expression_list.append(expression)
child_index = children_tree_indexes[0]
Expand Down

0 comments on commit a97afb7

Please sign in to comment.