
* sort memebers * Building bolts * fixing python, feature flags * Cleanup bolts Cargo.toml * Fix tests * cleanup libafl * removed duplicate examples * Info text * reenable agpl CI * fix impl_serdeany * new fmt * Moved bolts * fix some builds * fix * fix more fixes * serdeany * no_std * Dependency cleanup * Fix docs * Docker * add python bolts bindings * no_std test fix * merge fail * typo fix * add bolts dependency to fuzzers * tiny fixes * merge fun * clippy * link no longer exists * make sure python gets rebuilt * fix pybind * doc fix * remove bolts ref * LibAFL bolts * More info * deprecation notice for launcher * fix python * cargo fmt * fix concolic * fix * clippy * fix libafl_cc * fix tutorial, clippy * fix concolic fuzzer * fix push_stage_harness fuzzer * prelude * fix testcase post-merge * mute clippy
LibFuzzer Example for Windows with ASAN
This folder contains an example fuzzer for Windows which also uses ASAN.
We are initializing LibAFL to be compatible with ASAN.
Setup
We are currently using Clang on Windows. Make sure to install Clang through the Visual Studio installer.
We recommend using Powershell and enabling the Visual Studio environment using this script:
Push-Location "C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Auxiliary\Build\"
& "C:\\Windows\System32\cmd.exe" /c "vcvars64.bat & set" |
ForEach-Object {
if ($_ -match "=") {
$v = $_.split("=", 2); set-item -force -path "ENV:\$($v[0])" -value "$($v[1])"
}
}
Pop-Location
Write-Host "`nVisual Studio 2022 Command Prompt variables set." -ForegroundColor Yellow
After that clang should be available in the PATH.
Build
To build the fuzzer and link against the harness.cpp
in this example run:
cargo make fuzzer
Running
.\libfuzzer_windows_asan.exe
Note on MSVC
The MSVC compiler (cl.exe
) will work in the future. Currently, it is blocked because of a bug with coverage.
Note on ASAN
Using ASAN on Windows with MSVC is not trivial as of 2022. Depending on the harness and fuzzing target, the required compilation flags differ. Most notably, the usage of /MT
and /MD
for the CRT is important. All compilation artifacts should use the same config for the CRT (either all /MT
or all /MD
). Rust uses as of 2022 /MD
as default. So compile everything with /MD
.
Depending on the linking mode different ASAN libraries get linked. Definitely read this blog post by Microsoft.