exec

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package goexec provides the utilities to analyse the executable code

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindLibMaps

func FindLibMaps(pid int32) ([]*procfs.ProcMap, error)

func LibPath

func LibPath(name string, maps []*procfs.ProcMap) *procfs.ProcMap

Types

type FileInfo

type FileInfo struct {
	CmdExePath     string
	ProExeLinkPath string
	ELF            *elf.File
	Pid            int32
	Ppid           int32
}

func FindExecELF

func FindExecELF(ctx context.Context, finder ProcessFinder) ([]FileInfo, error)

findExecELF operation blocks until the executable is available. TODO: check that all the existing instances of the excutable are instrumented, even when it is offloaded from memory

func (*FileInfo) ExecutableName

func (fi *FileInfo) ExecutableName() string

type ProcessFinder

type ProcessFinder func() ([]*process.Process, bool)

ProcessFinder allows finding a process given multiple criteria

func OwnedPort

func OwnedPort(port int) ProcessFinder

OwnedPort allows finding a Process that owns the passed port

func ProcessNamed

func ProcessNamed(pathSuffix string) ProcessFinder

ProcessNamed allows finding a Process whose name path contains the passed string TODO: use regular expression

type ProcessReader

type ProcessReader interface {
	io.ReaderAt
	io.Closer
}

Jump to

Keyboard shortcuts

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