From f98465abc644b1c81bcdbcb7e94e73c3d56285a8 Mon Sep 17 00:00:00 2001 From: mr-tz Date: Mon, 3 Jun 2024 13:50:23 +0000 Subject: [PATCH] wip: read negative numbers --- capa/features/extractors/binexport2/insn.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/capa/features/extractors/binexport2/insn.py b/capa/features/extractors/binexport2/insn.py index 59aeb3d27..1a907eb7b 100644 --- a/capa/features/extractors/binexport2/insn.py +++ b/capa/features/extractors/binexport2/insn.py @@ -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: