Skip to content

smite-nyx-sys: document Nyx FFI bindings#62

Open
psg-19 wants to merge 1 commit into
morehouse:masterfrom
psg-19:smite-nyx-sys-documentation
Open

smite-nyx-sys: document Nyx FFI bindings#62
psg-19 wants to merge 1 commit into
morehouse:masterfrom
psg-19:smite-nyx-sys-documentation

Conversation

@psg-19
Copy link
Copy Markdown
Contributor

@psg-19 psg-19 commented Apr 26, 2026

Added crate level docs for smite-nyx-sys and documented the exported Nyx agent FFI functions

@psg-19 psg-19 force-pushed the smite-nyx-sys-documentation branch from 5046186 to 1849020 Compare April 26, 2026 17:04
Comment thread smite-nyx-sys/src/lib.rs
Comment on lines +6 to +7
//! injects a new input and collects coverage. And all this without restarting the
//! target process.
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Suggested change
//! injects a new input and collects coverage. And all this without restarting the
//! target process.
//! injects a new input and collects coverage without restarting the target
//! process.

Comment thread smite-nyx-sys/src/lib.rs
Comment on lines +43 to +44
/// `data` must be large enough for the full payload; the C agent does not
/// clamp the copy to `max_size`. Pass the size returned by [`nyx_init`].
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Actually I think it does? max_size determines the size of the payload buffer, which will naturally be the largest input that can ever be returned in data.

Suggested change
/// `data` must be large enough for the full payload; the C agent does not
/// clamp the copy to `max_size`. Pass the size returned by [`nyx_init`].
/// `max_size` is the maximum number of bytes that can be written to `data`.

Comment thread smite-nyx-sys/src/lib.rs
Comment on lines +20 to +21
/// Initializes the Nyx agent and returns the maximum fuzz input size
/// (in bytes) supported by the host.
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Suggested change
/// Initializes the Nyx agent and returns the maximum fuzz input size
/// (in bytes) supported by the host.
/// Initializes the Nyx agent and returns the maximum fuzz input size
/// (in bytes) supported by the host. Also sets `__AFL_SHM_ID` to the
/// allocated shared memory ID and sets `AFL_MAP_SIZE` to the size of
/// the shared memory region.

Comment thread smite-nyx-sys/src/lib.rs
Comment on lines +49 to +52
/// Skips the current test case and resets the coverage bitmap and restores
/// the VM to the snapshot state.
/// After this call, execution resumes from the snapshot point inside
/// [`nyx_get_fuzz_input`].
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Suggested change
/// Skips the current test case and resets the coverage bitmap and restores
/// the VM to the snapshot state.
/// After this call, execution resumes from the snapshot point inside
/// [`nyx_get_fuzz_input`].
/// Skips the current test case, resets the coverage bitmap, and restores the
/// VM to the snapshot state. After this call, execution resumes from the
/// snapshot point inside [`nyx_get_fuzz_input`].

Comment thread smite-nyx-sys/src/lib.rs
Comment on lines +56 to +58
/// state.
/// After this call the execution resumes from the snapshot point inside
/// [`nyx_get_fuzz_input`].
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Suggested change
/// state.
/// After this call the execution resumes from the snapshot point inside
/// [`nyx_get_fuzz_input`].
/// state. After this call the execution resumes from the snapshot point
/// inside [`nyx_get_fuzz_input`].

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