Skip to content
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions crates/libafl_qemu/src/emu/hooks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,12 @@ impl<ET, I, S> Default for EmulatorHookCollection<ET, I, S> {
}

/// Hook collection,
///
/// `EmulatorHooks` provides the standard interface for registering QEMU-based
/// instrumentation in `LibAFL` from a high-level perspective.
///
/// It integrates with emulator modules to ensure hooks are registered
/// safely and at the correct time.
#[derive(Debug)]
pub struct EmulatorHooks<ET, I, S> {
qemu_hooks: QemuHooks,
Expand Down
6 changes: 6 additions & 0 deletions crates/libafl_qemu/src/qemu/hooks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -936,6 +936,12 @@ pub type CrashHookClosure<ET, I, S> = Box<dyn FnMut(Qemu, &mut EmulatorModules<E
/// The thin wrapper around QEMU hooks.
/// It is considered unsafe to use it directly.
///
/// It is recommended to use `EmulatorHooks`, which provides a safe, structured
Copy link
Member

Choose a reason for hiding this comment

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

These should be links

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed — switched to rustdoc links ([EmulatorHooks], [QemuHooks]), visible in generated docs.

/// abstraction on top of `QemuHooks` and integrates with emulator modules.
///
/// Existing emulator modules (for example, syscall injection or coverage modules) provide concrete usage
/// examples of registering hooks via `EmulatorHooks`.
///
/// There are several types of hooks in place:
///
/// • **Instruction** hooks: as the name suggests, to hook a specific
Expand Down
Loading