Skip to content

Commit 6f4953a

Browse files
committed
fix(analysisinfo): detect auto-selected package from Windows analyzer logs
The Windows analyzer logs the package selection as: INFO: analysis package selected: "pkg" but get_package() only searched for the Linux format: INFO: Automatically selected analysis package "pkg" This caused the package field to remain empty in reports for Windows analyses where no package was explicitly specified. Now searches for both log formats using len(marker) instead of a hardcoded offset.
1 parent 9e4ade7 commit 6f4953a

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

modules/processing/analysisinfo.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,15 @@ def get_package(self):
6868
raise CuckooProcessingError(f"Error opening {self.log_path}: {e}") from e
6969
else:
7070
with suppress(Exception):
71-
idx = analysis_log.index('INFO: Automatically selected analysis package "')
72-
package = analysis_log[idx + 47 :].split('"', 1)[0]
71+
# Try both Windows and Linux analyzer log formats
72+
for marker in (
73+
'INFO: analysis package selected: "',
74+
'INFO: Automatically selected analysis package "',
75+
):
76+
if marker in analysis_log:
77+
idx = analysis_log.index(marker)
78+
package = analysis_log[idx + len(marker) :].split('"', 1)[0]
79+
break
7380
return package
7481

7582
def run(self):

0 commit comments

Comments
 (0)