To open a new Executable, use: OpenExecutable("/bin/bash") The returned value can then be used to open Uprobe(s).
(path string)
| 106 | // |
| 107 | // The returned value can then be used to open Uprobe(s). |
| 108 | func OpenExecutable(path string) (*Executable, error) { |
| 109 | if path == "" { |
| 110 | return nil, fmt.Errorf("path cannot be empty") |
| 111 | } |
| 112 | |
| 113 | if _, err := os.Stat(path); err != nil { |
| 114 | return nil, fmt.Errorf("stat executable: %w", err) |
| 115 | } |
| 116 | |
| 117 | return &Executable{ |
| 118 | path: path, |
| 119 | cachedSymbols: make(map[string]symbol), |
| 120 | }, nil |
| 121 | } |
| 122 | |
| 123 | func (ex *Executable) load(f *internal.SafeELFFile) error { |
| 124 | syms, err := f.Symbols() |
no outgoing calls
searching dependent graphs…