Skip to content

Commit ea83da5

Browse files
committed
Create from_file.rs
1 parent aae9dda commit ea83da5

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
//! Load and execute payload from file
2+
//! Author: BlackTechX
3+
4+
use process_ghosting::{GhostingBuilder, init};
5+
use std::env;
6+
7+
fn main() {
8+
init();
9+
10+
println!("[*] From File Example\n");
11+
12+
// Get file path from command line or use default
13+
let args: Vec<String> = env::args().collect();
14+
let file_path = if args.len() > 1 {
15+
&args[1]
16+
} else {
17+
"payload.exe"
18+
};
19+
20+
println!("[*] Loading payload from: {}", file_path);
21+
22+
// Use from_file builder method
23+
match GhostingBuilder::from_file(file_path) {
24+
Ok(builder) => {
25+
let result = builder
26+
.x64()
27+
.with_logging()
28+
.execute();
29+
30+
match result {
31+
Ok(_) => println!("\n[+] Success!"),
32+
Err(e) => eprintln!("\n[-] Failed: {}", e),
33+
}
34+
}
35+
Err(e) => {
36+
eprintln!("[-] Failed to load file: {}", e);
37+
}
38+
}
39+
}

0 commit comments

Comments
 (0)