Skip to content

Commit

Permalink
wip: read negative numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
mr-tz committed Jun 3, 2024
1 parent 36cb7d9 commit f98465a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion capa/features/extractors/binexport2/insn.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,10 +178,12 @@ def extract_insn_number_features(

# handling continues below at label: has a value

elif symbol.startswith("0x"):
elif symbol.startswith(("0x", "-0x")):
# like:
# - type: SYMBOL
# symbol: "0x1000"
# - type: SYMBOL
# symbol: "-0x1"
try:
value = int(symbol, 0x10)
except ValueError:
Expand Down

0 comments on commit f98465a

Please sign in to comment.