Skip to content

Windows Support for LibAFL-LibFuzzer #3130

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

novafacing
Copy link
Contributor

@novafacing novafacing commented Apr 4, 2025

Description

Support for Windows with LibAFL-LibFuzzer. This is a draft with a couple issues still persisting.

  • No maps available when running fuzzer

Checklist

  • I have run ./scripts/precommit.sh and addressed all comments


[target.'cfg(not(windows))'.features]
## Enable the `fork` feature on non-windows platforms
default = ["fork", "tui_monitor"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't think we need tui_monitor on non-win

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have to put in a few libs anyway to get this to work so I'll just revert this part of the changes and make tui_monitor work.

@novafacing
Copy link
Contributor Author

novafacing commented Apr 4, 2025

This is in MVP working state now with some updates still needed:

  • It runs for a moment then panics at mutations.rs:1164 ("Corpus may not be empty!"). Unsure why.
  • Revert changes to cargo.toml and add import libs for required libraries
  • Fix argparsing so -help=1 works (maybe separate PR)

Howto test:

.\build.ps1 dev
cd test
# Write a test.cpp
cl /c /EHsc /std:c++17 /MDd /fsanitize=fuzzer-no-link test.cpp #(if you don't have fuzzer-no-link on Windows, use /fsanitize-coverage=inline-8bit-counters /fsanitize-coverage=edge /fsanitize-coverage=trace-cmp /fsanitize-coverage=trace-div` instead).
link test.obj ..\target\debug\afl_libfuzzer_runtime.lib /OUT:fuzzer.exe

@domenukk
Copy link
Member

domenukk commented Apr 5, 2025

FWIW the fork feature should not do anything on windows

@novafacing
Copy link
Contributor Author

This seems to be 100% working now! Just need to do a style pass.

@tokatoka
Copy link
Member

tokatoka commented Apr 7, 2025

Nice 💯
Can you create a CI job?
Just like this guy
https://github.com/AFLplusplus/LibAFL/blob/main/.github/workflows/build_and_test.yml#L515

@novafacing
Copy link
Contributor Author

Ok, adding a CI workflow today or maybe tomorrow (I have actual work to do but it should be relatively quick).

@domenukk
Copy link
Member

domenukk commented Apr 9, 2025

Nice 💯 Can you create a CI job? Just like this guy https://github.com/AFLplusplus/LibAFL/blob/main/.github/workflows/build_and_test.yml#L515

Please do a justfile entry that is easy to run locally

@domenukk
Copy link
Member

domenukk commented Apr 9, 2025

We need to land #3099

@tokatoka
Copy link
Member

do you have any update?

@novafacing
Copy link
Contributor Author

novafacing commented Apr 22, 2025

Not yet, sorry :) I've been super busy with some other stuff. Still on my radar, I'll finish it up when I have a chance.

@tokatoka tokatoka added this to the LibAFL 1.0 milestone Apr 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants