dff

package module
v0.1.12 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 27, 2026 License: MIT Imports: 12 Imported by: 0

README

dff

A simple DFF (differential fuzzing framework).

System configuration

This fuzzer framework only supports Linux and macOS, not Windows. This is because it uses Unix Domain Sockets and Shared Memory segments for interprocess communication.

There are two limits whcih must be increased to support 100 MiB segements.

  • shmmax -- the max shared memory segment size.
  • shmall -- total shared memory size in pages.
Linux
sudo sysctl -w kernel.shmmax=104857600
sudo sysctl -w kernel.shmall=256000
macOS
sudo sysctl -w kern.sysv.shmmax=104857600
sudo sysctl -w kern.sysv.shmall=256000

Usage

Go

See the examples.

Rust

See the examples.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// Name is the identifier sent to the server.
	Name string
	// Process is the callback function used to process fuzzing inputs.
	Process ProcessFunc
	// contains filtered or unexported fields
}

Client encapsulates the client-side behavior for connecting to the fuzzing server.

func NewClient

func NewClient(name string, process ProcessFunc) *Client

NewClient creates a new Client with the given name and processing function.

func (*Client) Close

func (c *Client) Close()

Close cleans up all resources held by the client.

func (*Client) Connect

func (c *Client) Connect() error

Connect establishes a connection to the fuzzing server, sends the client name, attaches to the shared memory segments, and reads the fuzzing method from the server.

func (*Client) Run

func (c *Client) Run() error

Run enters the client fuzzing loop. It waits for the server to send input sizes, extracts the corresponding slices from shared memory, processes the input via the provided Process callback, writes the result to the output shared memory, and sends back the size of the result.

type ProcessFunc

type ProcessFunc func(method string, inputs [][]byte) ([]byte, error)

ProcessFunc defines the signature for functions that process fuzzing inputs. Users of the package must supply their own function.

type Server

type Server struct {
	// Method is the name of the fuzzing method that will be sent to clients.
	Method string
	// InputProvider is a function that returns a slice of fuzzing inputs.
	InputProvider func() [][]byte
	// contains filtered or unexported fields
}

Server encapsulates the state of the fuzzing server.

func NewServer

func NewServer(method string, inputProvider func() [][]byte) *Server

NewServer returns a new Server instance with the given method name and input provider.

func (*Server) Shutdown

func (s *Server) Shutdown()

Shutdown signals the server to stop. It is safe to call from another goroutine.

func (*Server) Start

func (s *Server) Start() error

Start launches the fuzzing server. It sets up shared memory, a Unix domain socket for client registrations, and runs the main fuzzing loop. This call blocks until Shutdown is called or an interrupt signal is received.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL