Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions analyzer/windows/modules/auxiliary/pre_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,19 @@ def __init__(self, options=None, config=None):
Auxiliary.__init__(self, options, config)
self.config = Config(cfg="analysis.conf")
self.enabled = self.config
# Go to the temp folder to look for pre_script.py
tmp_folder = os.environ["TEMP"]
matched_files = glob.glob(os.path.join(tmp_folder, "pre_script.*"))
try:
self.prescript_detection = bool(self.options.get("prescript_detection", False))
except ValueError:
log.error("Invalid option for prescript_detection specified, defaulting to False")
self.prescript_detection = False
if self.prescript_detection:
prescript_path = os.path.join(".", "prescripts")
matched_files = [os.path.join(prescript_path, "prescript_detection.py")]
else:
# Go to the temp folder to look for pre_script.py
matched_files = glob.glob(os.path.join(tmp_folder, "pre_script.*"))


# Check if the file exists and if the pre_script is enabled
if matched_files and self.enabled.pre_script:
Expand Down
Loading