Documentation
¶
Index ¶
- Variables
- func ComputeBinaryHash(f *os.File) (string, error)
- func ComputeFullHash(path string) (string, error)
- func FindSymbols(symbols []elf.Symbol, target SymbolSearch, filter func(*elf.Symbol) bool) ([]*elf.Symbol, error)
- func MatchSymbol(symName string, targetSymbols []SymbolSearch) bool
- type Elf
- func (p *Elf) CalculateUprobeAddresses(ctx context.Context, symbols []elf.Symbol) []elf.Symbol
- func (e *Elf) Close() error
- func (p *Elf) ContainsAnySymbols(ctx context.Context, targetSymbols []SymbolSearch, typ ...elf.SectionType) (bool, error)
- func (p *Elf) Elf(ctx context.Context) (*elf.File, error)
- func (p *Elf) GetSections(ctx context.Context) []*elf.Section
- func (e *Elf) Hash(ctx context.Context) (string, error)
- func (p *Elf) Ldd(ctx context.Context) ([]string, error)
- func (e *Elf) Mtime() time.Time
- func (e *Elf) Path() string
- func (e *Elf) SearchString(searchStr string, strategy MatchStrategy) (string, error)
- func (p *Elf) SearchSymbols(ctx context.Context, targets []SymbolSearch, sectionTypes ...elf.SectionType) ([]elf.Symbol, error)
- type MatchStrategy
- type SymbolSearch
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func ComputeBinaryHash ¶
ComputeBinaryHash generates a cache key using xxHash (fastest non-crypto hash). It samples file content + file size.
func ComputeFullHash ¶
ComputeFullHash computes a full SHA1 hash of the file. This is slower but provides a cryptographically strong hash.
func FindSymbols ¶
func MatchSymbol ¶
func MatchSymbol(symName string, targetSymbols []SymbolSearch) bool
Types ¶
type Elf ¶
type Elf struct {
// contains filtered or unexported fields
}
func NewElf ¶
NewElf creates a new Elf instance Returns ErrNotELF if the file is not an ELF Remember to call Close() when done
func (*Elf) CalculateUprobeAddresses ¶
CalculateUprobeAddresses calculates the loaded address of a symbol (needed for uprobes)
func (*Elf) ContainsAnySymbols ¶
func (p *Elf) ContainsAnySymbols(ctx context.Context, targetSymbols []SymbolSearch, typ ...elf.SectionType) (bool, error)
func (*Elf) SearchString ¶
func (e *Elf) SearchString(searchStr string, strategy MatchStrategy) (string, error)
func (*Elf) SearchSymbols ¶
func (p *Elf) SearchSymbols(ctx context.Context, targets []SymbolSearch, sectionTypes ...elf.SectionType) ([]elf.Symbol, error)
type MatchStrategy ¶
type MatchStrategy int
enum for symbol match strategy
const ( MatchStrategyExact MatchStrategy = iota MatchStrategyPrefix MatchStrategySuffix MatchStrategyContains )
type SymbolSearch ¶
type SymbolSearch struct {
Name string
MatchStrategy
}
func (*SymbolSearch) Bytes ¶
func (s *SymbolSearch) Bytes() []byte
Click to show internal directories.
Click to hide internal directories.