diff --git a/README.md b/README.md index 0b8a2ad..27865e2 100644 --- a/README.md +++ b/README.md @@ -19,19 +19,15 @@ toolchain must be installed. - For Linux: `config_linux.json` - For Windows: `config_win.json` -When running the executable without providing an optional memflow connector name, it will default to using the -memflow-native cross-platform OS layer to read the game's memory. However, any existing memflow connectors should work -out of the box. -Just pass the `connector` and optional `connector-args` arguments to the program. +When running the executable without providing an optional memflow connector name, it will default to using the [memflow-native](https://github.com/memflow/memflow-native) cross-platform OS layer to read the memory of the game process. If you wish to use an existing memflow connector instead, pass the `connector` and optional `connector-args` arguments to the program. -E.g. `cs2-dumper.exe -c pcileech -a device=fpga -vvv` +E.g. `./cs2-dumper -c kvm -vvv` ### Available Arguments - `-v...`: Increase logging verbosity. Can be specified multiple times. - `-c, --connector `: The name of the memflow connector to use. - `-a, --connector-args `: Additional arguments to supply to the connector. -- `-o, --os `: The name of the target operating system. - `-d, --directory `: The output directory to write the generated files to. Default: `output`. - `-i, --indent-size `: The number of spaces to use per indentation level. Default: `4`. - `-h, --help`: Print help. diff --git a/src/main.rs b/src/main.rs index ac04804..f75336f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -26,7 +26,7 @@ fn main() -> Result<()> { let start_time = Instant::now(); let matches = parse_args(); - let (conn_name, conn_args, os_name, indent_size, out_dir) = extract_args(&matches)?; + let (conn_name, conn_args, indent_size, out_dir) = extract_args(&matches)?; // Create the output directory if it doesn't exist. fs::create_dir_all(&out_dir)?; @@ -38,7 +38,7 @@ fn main() -> Result<()> { .builder() .connector(&conn_name) .args(conn_args) - .os(&os_name) + .os("win32") .build()? } else { // Fallback to the native OS layer if no connector name was provided. @@ -85,13 +85,6 @@ fn parse_args() -> ArgMatches { .short('a') .required(false), ) - .arg( - Arg::new("os") - .help("The name of the target operating system.") - .long("os") - .short('o') - .required(false), - ) .arg( Arg::new("directory") .help("The output directory to write the generated files to.") @@ -113,9 +106,7 @@ fn parse_args() -> ArgMatches { .get_matches() } -fn extract_args( - matches: &ArgMatches, -) -> Result<(Option, ConnectorArgs, String, usize, &PathBuf)> { +fn extract_args(matches: &ArgMatches) -> Result<(Option, ConnectorArgs, usize, &PathBuf)> { use std::str::FromStr; let log_level = match matches.get_count("verbose") { @@ -144,17 +135,8 @@ fn extract_args( .map(|s| ConnectorArgs::from_str(&s).expect("unable to parse connector arguments")) .unwrap_or_default(); - let os_name = matches - .get_one::("os") - .map(|s| s.to_string()) - .unwrap_or_else(|| match env::consts::OS { - "linux" => "linux".to_string(), - "windows" => "win32".to_string(), - os => panic!("unsupported os: {}", os), - }); - let indent_size = *matches.get_one::("indent-size").unwrap(); let out_dir = matches.get_one::("directory").unwrap(); - Ok((conn_name, conn_args, os_name, indent_size, out_dir)) + Ok((conn_name, conn_args, indent_size, out_dir)) }