mirror of
https://github.com/a2x/cs2-dumper.git
synced 2025-11-05 20:50:03 +08:00
Refactor and move Linux code to separate branch
This commit is contained in:
15
src/main.rs
15
src/main.rs
@@ -1,8 +1,6 @@
|
||||
#![feature(lazy_cell)]
|
||||
|
||||
use std::env;
|
||||
use std::path::PathBuf;
|
||||
use std::time::Instant;
|
||||
use std::{env, fs};
|
||||
|
||||
use clap::*;
|
||||
|
||||
@@ -12,15 +10,15 @@ use memflow::prelude::v1::*;
|
||||
|
||||
use simplelog::{ColorChoice, TermLogger};
|
||||
|
||||
use config::CONFIG;
|
||||
use error::Result;
|
||||
use output::Results;
|
||||
|
||||
mod analysis;
|
||||
mod config;
|
||||
mod error;
|
||||
mod output;
|
||||
mod source_engine;
|
||||
mod source2;
|
||||
|
||||
const PROCESS_NAME: &str = "cs2.exe";
|
||||
|
||||
fn main() -> Result<()> {
|
||||
let start_time = Instant::now();
|
||||
@@ -28,9 +26,6 @@ fn main() -> Result<()> {
|
||||
let matches = parse_args();
|
||||
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)?;
|
||||
|
||||
let os = if let Some(conn_name) = conn_name {
|
||||
let inventory = Inventory::scan();
|
||||
|
||||
@@ -45,7 +40,7 @@ fn main() -> Result<()> {
|
||||
memflow_native::create_os(&Default::default(), Default::default())?
|
||||
};
|
||||
|
||||
let mut process = os.into_process_by_name(&CONFIG.executable)?;
|
||||
let mut process = os.into_process_by_name(PROCESS_NAME)?;
|
||||
|
||||
let buttons = analysis::buttons(&mut process)?;
|
||||
let interfaces = analysis::interfaces(&mut process)?;
|
||||
|
||||
Reference in New Issue
Block a user