Skip to content
Open
Show file tree
Hide file tree
Changes from 2 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` is the supported interface for registering QEMU-based
Copy link
Member

Choose a reason for hiding this comment

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

'supported' is not the right word, we support low level hooks as well.
it's more like the standard way to use hooks from a high level perspective.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point, I’ve updated the wording to describe EmulatorHooks as the 'standard' interface to use hooks from a high level perspective.
Thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Are there any changes to improve ?

/// instrumentation in `LibAFL`.
///
/// 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