From bfb6d4d142d643927fd1c9cac0c55a3c4d7ed021 Mon Sep 17 00:00:00 2001 From: Willi Ballenthin Date: Fri, 8 Apr 2022 18:41:09 -0600 Subject: [PATCH] dn: fix access to ctx --- capa/features/extractors/dnfile/insn.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/capa/features/extractors/dnfile/insn.py b/capa/features/extractors/dnfile/insn.py index 54361524..dc0beaef 100644 --- a/capa/features/extractors/dnfile/insn.py +++ b/capa/features/extractors/dnfile/insn.py @@ -49,7 +49,7 @@ def extract_insn_api_features(fh: FunctionHandle, bh, ih: InsnHandle) -> Iterato if insn.opcode not in (OpCodes.Call, OpCodes.Callvirt, OpCodes.Jmp, OpCodes.Calli): return - name: str = get_imports(f.ctx).get(insn.operand.value, "") + name: str = get_imports(fh.ctx).get(insn.operand.value, "") if not name: return @@ -82,7 +82,7 @@ def extract_insn_string_features(fh: FunctionHandle, bh, ih: InsnHandle) -> Iter if not isinstance(insn.operand, StringToken): return - user_string: Optional[str] = read_dotnet_user_string(f.ctx["pe"], insn.operand) + user_string: Optional[str] = read_dotnet_user_string(fh.ctx["pe"], insn.operand) if user_string is None: return