From dd207fb238ed687e127dd86c6614d69976b66d45 Mon Sep 17 00:00:00 2001 From: Xusheng Date: Tue, 11 Apr 2023 11:23:39 +0800 Subject: [PATCH] Check if caller.llil is None before accessing its properties --- CHANGELOG.md | 3 +++ capa/features/extractors/binja/function.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9737725a..b07df4c2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,9 @@ ### Bug Fixes +- extractor: avoid Binary Ninja exception when analyzing certain files #1441 @xusheng6 + + ### capa explorer IDA Pro plugin ### Development diff --git a/capa/features/extractors/binja/function.py b/capa/features/extractors/binja/function.py index 1ac21330..96c58eea 100644 --- a/capa/features/extractors/binja/function.py +++ b/capa/features/extractors/binja/function.py @@ -25,7 +25,7 @@ def extract_function_calls_to(fh: FunctionHandle): # Everything that is a code reference to the current function is considered a caller, which actually includes # many other references that are NOT a caller. For example, an instruction `push function_start` will also be # considered a caller to the function - if caller.llil.operation in [ + if caller.llil is not None and caller.llil.operation in [ LowLevelILOperation.LLIL_CALL, LowLevelILOperation.LLIL_CALL_STACK_ADJUST, LowLevelILOperation.LLIL_JUMP,