depcheck

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2026 License: Apache-2.0 Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package depcheck inspects whether external tools a feature needs (Ghidra, a JDK, radare2, …) are present on the host. It never installs anything: it only reports status and the command the user could run, so a feature can gate itself and ask permission before anything is installed.

Index

Constants

This section is empty.

Variables

View Source
var Registry = map[string]Dependency{
	"java": {
		Name: "java", Purpose: "Java runtime (required by Ghidra)",
		Bins: []string{"java"},
		Envs: []string{"JAVA_HOME"},
		Install: map[string]string{
			"linux":   "sudo apt-get install -y openjdk-21-jdk   # or your distro's JDK 17+",
			"darwin":  "brew install openjdk@21",
			"windows": "winget install EclipseAdoptium.Temurin.21.JDK",
		},
	},
	"ghidra": {
		Name: "ghidra", Purpose: "reverse engineering (decompilation, analysis)",
		Bins: []string{"ghidraRun", "analyzeHeadless"},
		Envs: []string{"GHIDRA_INSTALL_DIR", "GHIDRA_HOME"},
		Paths: []string{
			"/opt/ghidra", "/usr/local/ghidra", "/usr/share/ghidra",
			filepath.Join(os.Getenv("HOME"), "ghidra"),
			filepath.Join(os.Getenv("HOME"), ".local", "ghidra"),
		},
		Install: map[string]string{
			"linux":   "download from https://github.com/NationalSecurityAgency/ghidra/releases and set GHIDRA_INSTALL_DIR",
			"darwin":  "brew install --cask ghidra   # then set GHIDRA_INSTALL_DIR",
			"windows": "download from https://github.com/NationalSecurityAgency/ghidra/releases and set GHIDRA_INSTALL_DIR",
		},
	},
	"radare2": {
		Name: "radare2", Purpose: "binary analysis (alternative to Ghidra)",
		Bins: []string{"r2", "radare2"},
		Install: map[string]string{
			"linux": "sudo apt-get install -y radare2", "darwin": "brew install radare2",
			"windows": "winget install radare.radare2",
		},
	},
	"nmap": {
		Name: "nmap", Purpose: "network/port scanning",
		Bins: []string{"nmap"},
		Install: map[string]string{
			"linux": "sudo apt-get install -y nmap", "darwin": "brew install nmap",
			"windows": "winget install Insecure.Nmap",
		},
	},
	"mitmproxy": {
		Name: "mitmproxy", Purpose: "HTTP(S) interception backend",
		Bins: []string{"mitmdump", "mitmproxy"},
		Install: map[string]string{
			"linux": "pipx install mitmproxy", "darwin": "brew install mitmproxy",
			"windows": "pipx install mitmproxy",
		},
	},
}

Registry holds the dependencies antares features may need. Extend as features are added.

Functions

This section is empty.

Types

type Dependency

type Dependency struct {
	Name    string // stable id, e.g. "ghidra"
	Purpose string // what antares feature needs it
	// Bins are executables to look for on PATH; any one present satisfies it.
	Bins []string
	// Envs are environment variables that, if set to an existing path, satisfy it.
	Envs []string
	// Paths are well-known install locations to probe.
	Paths []string
	// Install maps GOOS -> a suggested install command (a hint, never run).
	Install map[string]string
}

Dependency describes an external program a feature relies on.

type Status

type Status struct {
	Name        string `json:"name"`
	Purpose     string `json:"purpose"`
	Installed   bool   `json:"installed"`
	Found       string `json:"found,omitempty"` // path or env that satisfied it
	InstallHint string `json:"install_hint,omitempty"`
}

Status is the resolved state of a dependency on this host.

func Check

func Check(dep Dependency) Status

Check resolves one dependency's status on this host.

func CheckByName

func CheckByName(name string) (Status, bool)

CheckByName resolves a registered dependency by id.

func Require

func Require(names ...string) (ok bool, missing []Status)

Require reports whether every named dependency is present, returning the statuses of the ones that are missing so the caller can ask the user to install them.

Jump to

Keyboard shortcuts

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