Skip to content

Commit 7e082e7

Browse files
authored
Update README.md (#3374)
improving a bit the doc - Adding per-requisites and setup info - Specify proper build instruction (needs to be inside x64 Native Tools for VS)
1 parent c5f91fa commit 7e082e7

File tree

1 file changed

+15
-4
lines changed
  • fuzzers/binary_only/frida_windows_gdiplus

1 file changed

+15
-4
lines changed

fuzzers/binary_only/frida_windows_gdiplus/README.md

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,25 @@
33
This is a an example how to fuzz binary-only dlls on Windows.
44
The example fuzzer will explore [gdiplus](https://learn.microsoft.com/en-us/windows/win32/gdiplus/-gdiplus-gdi-start) on Windows, using the [Frida](https://frida.re/) DBI.
55

6+
## Pre-requisites
7+
1. This example depends on the msvc linker `link.exe`, ensure that Visual Studio 2017 (or later) or Build Tools for Visual Studio were installed with the Visual C++ option.
8+
2. `libclang` must be installed for `frida-gum` to work, download the latest compatible clang release and set the envrionment path `LIBCLANG_PATH` by using setx LIBCLANG_PATH "path/to/libclang.dll_folder/"
9+
10+
611
## Build
712

8-
To build this example, run `cargo build --release` in this folder.
13+
To build this example:
14+
1. Open `x64 Native Tools Command Prompt for VS 2022 Preview` and cd into this example folder.
15+
2. run `cargo build --release` in this folder.
16+
4. Compile the harness `cl.exe /LD harness.cc /link /dll gdiplus.lib ole32.lib`
917

10-
Then compile the harness `cl.exe /LD harness.cc /link /dll gdiplus.lib ole32.lib`
18+
Note: this fuzzer is **statically linked** with C runtime. This is achieved by specifying `rustflags = ["-C", "target-feature=+crt-static"]` in `.cargo/config.toml`.
1119

12-
Note: this fuzzer is **statically linked** with C runtime. This is achieved by specifying `rustflags = ["-C", "target-feature=+crt-static"]` in `.cargo/config.toml`. The static linking is necessary to avoid Asan function hooks to hook the calls from the fuzzer itself, as such self-hooking can eventually lead to deadlocks in internal Frida mechanisms.
20+
The static linking is necessary to avoid Asan function hooks to hook the calls from the fuzzer itself, as such self-hooking can eventually lead to deadlocks in internal Frida mechanisms.
1321

1422
## Run
1523

16-
To run the example `target\release\frida_windows_gdiplus.exe -H harness.dll -i corpus -o output --libs-to-instrument gdi32.dll --libs-to-instrument gdi32full.dll --libs-to-instrument gdiplus.dll --libs-to-instrument WindowsCodecs.dll --disable-excludes`
24+
To run the example:
25+
```
26+
target\release\frida_windows_gdiplus.exe -H harness.dll -i corpus -o output --libs-to-instrument gdi32.dll --libs-to-instrument gdi32full.dll --libs-to-instrument gdiplus.dll --libs-to-instrument WindowsCodecs.dll --disable-excludes
27+
```

0 commit comments

Comments
 (0)