feat: Add -f flag for single file analysis#2
Merged
Neo23x0 merged 1 commit intoNeo23x0:mainfrom Feb 8, 2026
Merged
Conversation
…ecommendation - Add -f flag to analyze a single file without creating temp directories manually - When using -f, automatically create temp dir, copy file, and clean up after - Add recommendation message when using -f about server mode for multiple samples - Update help text to show -m and -f as alternatives (not required together) - Improve error messages to mention both -m and -f options This addresses usability feedback where users struggled with: 1. Understanding that -m expects a directory, not a file 2. Knowing when to use CLI vs server mode for efficiency Example usage: ./yargen -f malware.exe -a Author -o rule.yar The recommendation message advises users to start the server when analyzing multiple samples to avoid repeated database initialization.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a
-fflag for analyzing single malware samples without manual temp directory setup.Problem
Users often want to analyze a single file but
-mexpects a directory, forcing manual temp directory creation.Solution
The
-fflag:Also prints a recommendation message about using server mode for multiple samples.
Changes
-f stringflag for single file pathprintSingleFileRecommendation()function-mOR-fdefer os.RemoveAll(tempDir)