diff --git a/capa/features/extractors/binexport2/__init__.py b/capa/features/extractors/binexport2/__init__.py index cfe926d8f..ccb5ab570 100644 --- a/capa/features/extractors/binexport2/__init__.py +++ b/capa/features/extractors/binexport2/__init__.py @@ -104,6 +104,7 @@ def __init__(self, be2: BinExport2): self.string_reference_index_by_source_instruction_index: Dict[int, List[int]] = defaultdict(list) self.insn_address_by_index: Dict[int, int] = {} + self.insn_index_by_address: Dict[int, int] = {} self.insn_by_address: Dict[int, BinExport2.Instruction] = {} # must index instructions first @@ -187,6 +188,7 @@ def _index_insn_addresses(self): addr = next_addr next_addr += len(insn.raw_bytes) self.insn_address_by_index[idx] = addr + self.insn_index_by_address[addr] = idx self.insn_by_address[addr] = insn @staticmethod