Add DLL proxying to readme
This commit is contained in:
parent
14e6572521
commit
c10945f2e0
22
README.md
22
README.md
@ -10,6 +10,9 @@ the script.
|
|||||||
|
|
||||||
All desktop platforms are supported (Windows, Linux, macOS).
|
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
|
## Usage
|
||||||
|
|
||||||
You're gonna have to compile the tool yourself as the frida script gets embedded
|
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()`.
|
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
|
||||||
|
```
|
||||||
|
@ -44,9 +44,6 @@ pub fn attach(pid: u32) {
|
|||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
pub fn attach_self() {
|
pub fn attach_self() {
|
||||||
println!("[*] Attaching to self");
|
println!("[*] Attaching to self");
|
||||||
// #[cfg(windows)]
|
|
||||||
// attach(std::process::id());
|
|
||||||
// #[cfg(unix)]
|
|
||||||
attach(0);
|
attach(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user