Skip to content

Add Intel PT support on Windows - #3845

Merged
domenukk merged 17 commits into
AFLplusplus:mainfrom
Marcondiro:pt_windows
Aug 7, 2026
Merged

Add Intel PT support on Windows#3845
domenukk merged 17 commits into
AFLplusplus:mainfrom
Marcondiro:pt_windows

Conversation

@Marcondiro

Copy link
Copy Markdown
Contributor

Description

Support Intel PT based coverage collection through Windows' ipt.sys driver

Checklist

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

Comment thread fuzzers/binary_only/intel_pt_baby_fuzzer/src/main.rs Outdated
@Marcondiro
Marcondiro marked this pull request as ready for review July 7, 2026 14:04
@Marcondiro Marcondiro changed the title [WIP] Add Intel PT support on Windows Add Intel PT support on Windows Jul 7, 2026
@Marcondiro
Marcondiro marked this pull request as draft July 9, 2026 15:50
@Marcondiro
Marcondiro force-pushed the pt_windows branch 2 times, most recently from c8eb4e5 to a88305d Compare July 30, 2026 12:39
@domenukk

domenukk commented Aug 6, 2026

Copy link
Copy Markdown
Member

@Marcondiro I want to release 0.16 soon, do you think this should / could be part of the release or needs more time?

@Marcondiro

Copy link
Copy Markdown
Contributor Author

Hi, I will mark this as ready tomorrow. I think it could go in 0.16

@domenukk

domenukk commented Aug 7, 2026

Copy link
Copy Markdown
Member

Wide downgrade is in #3873

Comment thread crates/libafl_intelpt/src/linux.rs Outdated
/// use libafl_intelpt::{IntelPTBuilder, PAGE_SIZE};
/// let builder = IntelPTBuilder::default()
/// .pid(None)
/// // 0 means "Current process" ONLY on Linux!

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

should we just make this NonZero?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Option rather

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

On Windows .pid(0) should trace the Idle process, so changing this to NonZero on Linux would result in a different API between Linux and Win, not ideal imho.

It was Option<Pid> before but I thought that there was no need for the Option since instead of .pid(None), it is enough to just not specify .pid at all and it will default to the current process as pid(None) was doing

Moving that bit of documentation to fn pid() definition and removing .pid(0) from the default.

No strong opinion anyway, maybe adding a current_pid() method alongside pid() can make it more explicit and ergonomic?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

ah so it's just a behavior diff in linux vs windows? In that case makes sense

/// Not calling this function will default to the current process.
///
/// Calling this with `pid: 0` means "Current process" ONLY on Linux!
/// Prefer not setting the pid at all if you want a cross-platform "Current process".

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Maybe By default, this will trace the current process. Set a pid to instead trace another process, instead or similar

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

sounds better thanks

@domenukk

domenukk commented Aug 7, 2026

Copy link
Copy Markdown
Member

Looks good now I think.

@Marcondiro
Marcondiro marked this pull request as ready for review August 7, 2026 18:31
@domenukk
domenukk merged commit a7bb138 into AFLplusplus:main Aug 7, 2026
120 checks passed
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.

2 participants