Simple Native Rust Reflective PE loader library
This project can execute RunPE into memory using the following methods:
```rust use rspe::{reflectiveloader, utils::checkdotnet};
// Main function fn main() -> Result<(), String> { // Read the file to load into a buffer #[cfg(targetarch = "x8664")] let data = includebytes!(r#".\puttyx64.exe"#).tovec(); #[cfg(targetarch = "x86")] let data = includebytes!(r#".\puttyx86.exe"#).to_vec();
// Load the file based on the target architecture
// Check if the file is a .NET assembly
if !check_dotnet(data.clone()) {
// If it is not, use the reflective loader to load the file
unsafe {
reflective_loader(data.clone());
// Using Threads (useful to bind 2nd exe to execute at the same time):
// Currently not in use, but can be used to load the pe file in a separate thread
// let handle = std::thread::spawn(move || {
// pe::loader::reflective_loader(data.clone());
// });
// let _ = handle.join();
};
} else {
panic!("This is a .NET PE file. Only native PE image are supported! Please provide a native PE image.")
}
Ok(())
} ```
Special thanks to the following individuals and projects for their contributions to this project:
This project is licensed under the MIT License - see the LICENSE file for details.