Documentation
¶
Overview ¶
Package toolchain manages the Go compiler for building standalone exploits. Auto-downloads Go if not available on the system.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RenderToFile ¶
RenderToFile renders a template to a file.
func Scaffold ¶
func Scaffold(opts ScaffoldOpts) (string, func(), error)
Scaffold creates a temp directory with main.go and go.mod for a standalone build. Returns the dir path and a cleanup function.
Types ¶
type BuildOpts ¶
type BuildOpts struct {
Dir string // source directory (contains main.go + go.mod)
Output string // output binary path
OS string // GOOS (empty = native)
Arch string // GOARCH (empty = native)
}
BuildOpts configures a compilation.
type ScaffoldOpts ¶ added in v0.1.3
type ScaffoldOpts struct {
ImportPath string // Go import path of the module package
ModuleName string // Full module name for sdk.Get() lookup
Proto string // Protocol to import: "http" or "tcp"
ModRoot string // Local repo root (empty = fetch from proxy)
Version string // Module version tag (used when ModRoot is empty)
NeedsXML bool // Import pkg/xmlutil for XPath support
NeedsFaker bool // Import pkg/fake for realistic fake data
NeedsHTTPServer bool // Import pkg/httpsrv for exploit HTTP server
}
ScaffoldOpts configures standalone scaffold generation.
func (ScaffoldOpts) TemplateData ¶ added in v0.5.0
func (o ScaffoldOpts) TemplateData() map[string]string
TemplateData returns the template variables for standalone_main.go.tpl.
Click to show internal directories.
Click to hide internal directories.