-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathmain.rs
49 lines (41 loc) · 1.08 KB
/
main.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
use std::env;
use std::path::Path;
use std::process;
const PROG: &str = "bindsight.exe";
fn main() {
println!("blindsight - Dump LSASS memory bypassing countermeasures");
println!("Copyright (c) 2024 Marco Ivaldi <[email protected]>");
println!();
// Parse command line arguments
let args: Vec<String> = env::args().collect();
let prog = Path::new(&args[0])
.file_name()
.unwrap()
.to_str()
.unwrap_or(PROG);
let action = match args.len() {
1 => "dump",
2 => &args[1].clone(),
_ => "-",
};
if action.starts_with('-') {
usage(prog);
}
// Let's do it
match blindsight::run(action) {
Ok(()) => (),
Err(err) => {
eprintln!("[!] Error: {err}");
process::exit(1);
}
}
}
/// Print usage information and exit
fn usage(prog: &str) {
println!("Usage:");
println!(".\\{prog} [dump | file_to_unscramble.log]");
println!("\nExamples:");
println!(".\\{prog}");
println!(".\\{prog} 29ABE9Hy.log");
process::exit(1);
}