Skip to content

Instantly share code, notes, and snippets.

@insi2304
Created February 21, 2025 10:16
Show Gist options
  • Save insi2304/6ead814aa4d18375c85f3ec93979ffaa to your computer and use it in GitHub Desktop.
Save insi2304/6ead814aa4d18375c85f3ec93979ffaa to your computer and use it in GitHub Desktop.
Winafl fuzzing
mkdir build64
cd build64
cmake -G"Visual Studio 17 2022" -A x64 .. -DDynamoRIO_DIR=C:\fuzz\DynamoRIO\cmake -DUSE_COLOR=1
cmake --build . --config Release
C:\fuzz\DynamoRIO\bin64\drrun.exe -c winafl.dll -debug -target_module gdiplus.exe -target_offset 0x16e0 -fuzz_iterations 10 -nargs 2 -- gdiplus.exe input.bmp
-nargs 2 -- test_gdiplus.exe input.bmp
C:\fuzz\DynamoRIO\bin64\drrun.exe -c winafl.dll -debug -target_module gdiplus.exe -target_offset 0x1070 -fuzz_iterations 10 -nargs 2 -- C:\fuzz\winafl\build64\bin\Release\gdiplus.exe C:\fuzz\winafl\build64\bin\Release\in\not_kitty.jpg
afl-fuzz.exe -i D:\fuzz\in -o D:\fuzz\out -t 20000+ -D D:\tools\DynamoRIO\bin64 -- -coverage_module gdiplus.dll -target_module gdiplus.exe -target_offset 0x1070 -nargs 2 -fuzz_iterations 5000 -- D:\tools\winafl\build64\bin\Release\gdiplus.exe @@
afl-fuzz.exe -i C:\fuzz\in -o C:\fuzz\out -t 20000 -D C:\tools\DynamoRIO\bin64 -- -coverage_module gdiplus.dll -target_module gdiplus.exe -target_offset 0x1070 -nargs 2 -fuzz_iterations 10000 -covtype edge -- C:\tools\winafl\build64\bin\Release\gdiplus.exe @@
//@echo off
REM Check if the input directory is provided as a command line parameter
if "%~1"=="" (
echo Usage: %~nx0 "path\to\input\directory"
exit /b 1
)
REM Set the input directory from the first command line argument
set "inputDir=%~1"
REM Check if the directory exists
if not exist "%inputDir%" (
echo The directory "%inputDir%" does not exist.
exit /b 1
)
REM Loop through all files in the specified directory
for %%F in ("%inputDir%\*") do (
REM Run your executable with each file as an argument and additional arguments
D:\tools\DynamoRIO\bin64\drrun.exe -t drcov -logdir D:\fuzz\coverage -- D:\Tools\winafl\build64\bin\Release\gdiplus.exe "%%~F"
)
//
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment