Add DLL proxying to readme

This commit is contained in:
Dimitris Zervas 2023-05-27 22:12:51 +03:00
parent 14e6572521
commit c10945f2e0
No known key found for this signature in database
GPG Key ID: 5C27D7C9D1901A30
2 changed files with 22 additions and 3 deletions

View File

@ -10,6 +10,9 @@ the script.
All desktop platforms are supported (Windows, Linux, macOS).
**NOTE**: To cross-compile for Windows you can use [cargo-xwin](https://github.com/rust-cross/cargo-xwin)
with target `x86_64-pc-windows-msvc`.
## Usage
You're gonna have to compile the tool yourself as the frida script gets embedded
@ -49,3 +52,22 @@ void inject_self(); // Run the frida script in the process that called the funct
```
By default, on load the library will call `inject_self()`.
### DLL Proxying
There's also the option of generating a DLL ready for DLL Proxying use.
That means that you give the DLL `myawesome.dll` to cargo
(using the `DLL_PROXY` environment variable) and it will generate a DLL
`myawesome.dll` that can replace the original DLL. It will tell the linker
that any functions found during compilation (e.g. functions `foo` and `bar`
exported by the original `myawesome.dll`) should be redirected to `myawesome-orig.dll`
That allows you to make your script completely permanent without having to
run any extra commands.
**NOTE**: This only works on Windows (for now?).
```bash
git clone https://github.com/dzervas/frida-deepfreeze-rs
DLL_PROXY='../myawesome.dll' FRIDA_CODE='console.log("Hello world from frida-deepfreeze-rs!")' cargo xwin build --lib --target x86_64-pc-windows-msvc
```

View File

@ -44,9 +44,6 @@ pub fn attach(pid: u32) {
#[no_mangle]
pub fn attach_self() {
println!("[*] Attaching to self");
// #[cfg(windows)]
// attach(std::process::id());
// #[cfg(unix)]
attach(0);
}