Skip to content

Commit

Permalink
Updated CLI arg description and name for the input image file
Browse files Browse the repository at this point in the history
  • Loading branch information
Will-Banksy committed Apr 13, 2024
1 parent 0b59f98 commit da2f65a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
11 changes: 6 additions & 5 deletions searchlight/src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,21 @@ use clap_verbosity_flag::InfoLevel;
pub struct Args { // TODO: Add a "quick search" option to only look for headers at the start of clusters... but still need to find footers...
#[command(flatten)]
pub verbose: clap_verbosity_flag::Verbosity<InfoLevel>,
/// Path to the input disk image file to attempt to recover data from
/// If specified, will read the target disk image file and attempt to carve files from it, using the default or specified configuration file and the default or specified cluster size
#[arg(short, long)]
pub input: Option<String>,
pub image: Option<String>,
/// The cluster size that the filesystem that is/was present in the disk image allocated files in, i.e. all valid non-embedded file headers will be found at multiples of this value.
/// Alternatively, you can specify "unaligned" or "unknown"
#[arg(short, long, default_value = "unknown")]
pub cluster_size: ClusterSizeArg,
/// The output directory to save recovered file contents in. Defaults to a timestamped directory (startup time) in the current working directory
/// The output directory to save recovered file contents in. Defaults to a timestamped directory (processing start time) in the current working directory. Has no effect when processing
/// a log
#[arg(short, long)]
pub out_dir: Option<String>,
/// Whether to simply output a log of the discovered file locations instead of carving the file data. Defaults to false. Currently unimplemented
/// Whether to simply output a log of the discovered file locations instead of carving the file data. Defaults to false. Has no effect when processing a log
#[arg(short, long)]
pub skip_carving: bool,
/// Path to the TOML config file. Defaults to looking for "Searchlight.toml" in the current working directory
/// Path to the TOML config file. Defaults to looking for "Searchlight.toml" in the current working directory. If only processing a log, searchlight makes no attempt to open a config file
#[arg(short = 'f', long)]
pub config: Option<String>,
/// If specified, will read the target log file and carve the files indicated in it. Doesn't require a config. If specified alongside input, will perform both carving operations separately
Expand Down
4 changes: 2 additions & 2 deletions searchlight/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ fn main() {

let mut searchlight = Searchlight::new();

if let Some(input) = args.input {
if let Some(image_path) = args.image {
args.config = Some(args.config.unwrap_or("Searchlight.toml".to_string()));

let config = match fs::read_to_string(args.config.as_ref().unwrap()) {
Expand All @@ -45,7 +45,7 @@ fn main() {
debug!("Config: {:?}", config);

searchlight.add_operation(CarveOperationInfo::Image {
path: input,
path: image_path,
config,
cluster_size: args.cluster_size.as_option(),
skip_carving: args.skip_carving
Expand Down

0 comments on commit da2f65a

Please sign in to comment.