ptrace

package
v0.0.0-...-b60b6a8 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2022 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PtraceEvenEnum

func PtraceEvenEnum(data int) string

func SigTrapCauseInfo

func SigTrapCauseInfo(cause int) string

func SignalEnum

func SignalEnum(sigNum int) string

func StopSignalInfo

func StopSignalInfo(sig syscall.Signal) string

Types

type App

type App struct {
	Cmd       string
	Args      []string
	Dir       string
	User      string
	RunAsUser bool
	Report    report.PtMonitorReport
	ReportCh  chan *report.PtMonitorReport
	ErrorCh   chan error
	StateCh   chan AppState
	StopCh    chan struct{}
	// contains filtered or unexported fields
}

func Run

func Run(
	cmd string,
	args []string,
	dir string,
	user string,
	runAsUser bool,
	reportCh chan *report.PtMonitorReport,
	errorCh chan error,
	stateCh chan AppState,
	stopCh chan struct{},
	includeNew bool,
	origPaths map[string]interface{},
) (*App, error)

func (*App) FileActivity

func (app *App) FileActivity() map[string]*report.FSActivityInfo

func (*App) MainPID

func (a *App) MainPID() int

func (*App) PGID

func (a *App) PGID() int

func (*App) Stop

func (app *App) Stop()

type AppState

type AppState string
const (
	AppStarted AppState = "app.started"
	AppFailed  AppState = "app.failed"
	AppDone    AppState = "app.done"
	AppExited  AppState = "app.exited"
)

type StringParamPos

type StringParamPos int
const (
	SPPNo  StringParamPos = 0
	SPPOne StringParamPos = 1
	SPPTwo StringParamPos = 2
)

type SyscallProcessor

type SyscallProcessor interface {
	SyscallNumber() uint64
	SetSyscallNumber(uint64)
	SyscallType() SyscallTypeName
	SyscallName() string
	EventOnCall() bool
	OnCall(pid int, regs syscall.PtraceRegs, cstate *syscallState)
	OnReturn(pid int, regs syscall.PtraceRegs, cstate *syscallState)
	FailedCall(cstate *syscallState) bool
	FailedReturnStatus(retVal uint64) bool
}

type SyscallTypeName

type SyscallTypeName string
const (
	CheckFileType SyscallTypeName = "type.checkfile"
	OpenFileType  SyscallTypeName = "type.openfile"
	ExecType      SyscallTypeName = "type.exec"
)

Jump to

Keyboard shortcuts

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