From 0099e75704954e5d99052232635ab8d447872fc6 Mon Sep 17 00:00:00 2001 From: Xusheng Date: Mon, 20 Oct 2025 18:40:45 +0800 Subject: [PATCH 1/2] binja: fix crash in binja feature extraction when MLIL is unavailable. Fix https://github.com/mandiant/capa/issues/2714 --- CHANGELOG.md | 2 ++ capa/features/extractors/binja/function.py | 6 ++---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5c16edf3..0de2e59e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,6 +31,8 @@ ### Bug Fixes +- binja: fix a crash during feature extraction when the MLIL is unavaiable @xusheng6 #2714 + ### capa Explorer Web ### capa Explorer IDA Pro plugin diff --git a/capa/features/extractors/binja/function.py b/capa/features/extractors/binja/function.py index 707c572e..b52c8058 100644 --- a/capa/features/extractors/binja/function.py +++ b/capa/features/extractors/binja/function.py @@ -19,7 +19,6 @@ from binaryninja import ( Function, BinaryView, SymbolType, - ILException, RegisterValueType, VariableSourceType, LowLevelILOperation, @@ -192,9 +191,8 @@ def extract_stackstring(fh: FunctionHandle): if bv is None: return - try: - mlil = func.mlil - except ILException: + mlil = func.mlil + if mlil is None: return for block in mlil.basic_blocks: From acb34e88d6cbbcb5c9c074682d56f129b186646b Mon Sep 17 00:00:00 2001 From: Mike Hunhoff Date: Mon, 20 Oct 2025 09:05:30 -0600 Subject: [PATCH 2/2] Update CHANGELOG.md Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0de2e59e..114c7000 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,7 +31,7 @@ ### Bug Fixes -- binja: fix a crash during feature extraction when the MLIL is unavaiable @xusheng6 #2714 +- binja: fix a crash during feature extraction when the MLIL is unavailable @xusheng6 #2714 ### capa Explorer Web