Library

Embed Wiretap via pkg/wiretap. Blank-import analysis and capture so built-in passes register.

package main

import (
    "context"
    "fmt"
    "os"

    _ "github.com/theworker02/wiretap/internal/analysis"
    _ "github.com/theworker02/wiretap/internal/capture"
    wt "github.com/theworker02/wiretap/pkg/wiretap"
)

func main() {
    ds, err := wt.LoadFile("examples/mystery/captures.hex")
    if err != nil {
        fmt.Fprintln(os.Stderr, err)
        os.Exit(1)
    }
    res, err := wt.Analyze(context.Background(), ds, wt.AnalyzeOptions{
        Budget: wt.BudgetNormal,
    })
    if err != nil {
        fmt.Fprintln(os.Stderr, err)
        os.Exit(1)
    }
    fmt.Println(len(res.Hypotheses), res.DatasetFingerprint)
}

Runnable example

go run ./examples/library
go run ./examples/library path/to/captures.hex

Plugins

Implement wiretap.Pass, call RegisterPass, and document enable/disable via pass config. See docs/plugins.md and examples/plugins/sample_pass.go in the repository.

Module: github.com/theworker02/wiretap · docs @v0.5.0 · Go 1.23+