goexec

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package goexec provides the utilities to analyse the executable code

Package goexec helps analyzing Go executables

Index

Constants

View Source
const GoOffsetsTableSize = 30

Variables

This section is empty.

Functions

This section is empty.

Types

type FieldOffsets

type FieldOffsets map[GoOffset]any

type FuncOffsets

type FuncOffsets struct {
	Start   uint64
	Returns []uint64
}

type GoOffset added in v1.9.0

type GoOffset uint32

this const table must match what's in go_offsets.h

const (
	// go common
	ConnFdPos GoOffset = iota + 1 // start at 1, must match what's in go_offsets.h
	FdLaddrPos
	FdRaddrPos
	TCPAddrPortPtrPos
	TCPAddrIPPtrPos
	// http
	URLPtrPos
	PathPtrPos
	MethodPtrPos
	StatusCodePtrPos
	ContentLengthPtrPos
	ReqHeaderPtrPos
	IoWriterBufPtrPos
	IoWriterNPos
	CcNextStreamIDPos
	FramerWPos
	PcConnPos
	PcTLSPos
	NetConnPos
	CcTconnPos
	ScConnPos
	CRwcPos
	CTlsPos
	// grpc
	GrpcStreamStPtrPos
	GrpcStreamMethodPtrPos
	GrpcStatusSPos
	GrpcStatusCodePtrPos
	GrpcStreamCtxPtrPos
	ValueContextValPtrPos
	GrpcStConnPos
	GrpcTConnPos
	GrpcTSchemePos
	HTTP2ClientNextIDPos
	GrpcTransportBufWriterBufPos
	GrpcTransportBufWriterOffsetPos
	// redis
	RedisConnBwPos
	// kafka go
	KafkaGoWriterTopicPos
	KafkaGoProtocolConnPos
	KafkaGoReaderTopicPos
	// kafka sarama
	SaramaBrokerCorrIDPos
	SaramaResponseCorrIDPos
	SaramaBrokerConnPos
	SaramaBufconnConnPos
)

type Offsets

type Offsets struct {
	// Funcs key: function name
	Funcs map[string]FuncOffsets
	Field FieldOffsets
}

func InspectOffsets

func InspectOffsets(execElf *exec.FileInfo, funcs []string) (*Offsets, error)

InspectOffsets gets the memory addresses/offsets of the instrumenting function, as well as the required parameters fields to be read from the eBPF code

Jump to

Keyboard shortcuts

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