Refactor and move Linux code to separate branch

This commit is contained in:
a2x
2024-04-03 02:59:30 +11:00
parent 86dc0fa8f6
commit 3a935f5d73
229 changed files with 705 additions and 121739 deletions

View File

@@ -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)?;