Documentation ¶
Index ¶
- func AssetLD(rela elf.Rela64, imageOffset map[string]int, imageContent *[]byte, ...)
- func CalculateOffset(offsetStr string) (time.Duration, error)
- func FindVDSOEntry(program *ptrace.TracedProgram) (*mapreader.Entry, error)
- type Config
- type ConfigCreatorParas
- type FakeImage
- func (it *FakeImage) AttachToProcess(pid int, variables map[string]uint64) (err error)
- func (it *FakeImage) FindInjectedImage(program *ptrace.TracedProgram, varNum int) (*mapreader.Entry, error)
- func (it *FakeImage) InjectFakeImage(program *ptrace.TracedProgram, vdsoEntry *mapreader.Entry) (*mapreader.Entry, error)
- func (it *FakeImage) Recover(pid int, vars map[string]uint64) error
- func (it *FakeImage) SetVarUint64(program *ptrace.TracedProgram, entry *mapreader.Entry, symbol string, ...) error
- func (it *FakeImage) TryReWriteFakeImage(program *ptrace.TracedProgram) error
- type Skew
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindVDSOEntry ¶
func FindVDSOEntry(program *ptrace.TracedProgram) (*mapreader.Entry, error)
Types ¶
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
Config is the summary config of get_time_of_day and clock_get_time. Config here is only for injector of k8s pod. We divide group injector on linux process , pod injector for k8s and the base injector , so we can simply create another config struct just for linux process for watchmaker.
func (*Config) Assign ¶
func (c *Config) Assign(injectable tasks.Injectable) error
Assign assumes the input injectable is *tasks.PodHandler. We also assume the SubProcess of podHandler is *tasks.ProcessGroupHandler and the LeaderProcess of ProcessGroupHandler is *Skew.
type ConfigCreatorParas ¶
type ConfigCreatorParas struct { Config Config PodProcessMap *tasks.PodContainerNameProcessMap }
type FakeImage ¶
type FakeImage struct { // OriginFuncCode stores the raw func code like getTimeOfDay & ClockGetTime. OriginFuncCode []byte // OriginAddress stores the origin address of OriginFuncCode. OriginAddress uint64 // contains filtered or unexported fields }
FakeImage introduce the replacement of VDSO ELF entry and customizable variables. FakeImage could be constructed by LoadFakeImageFromEmbedFs(), and then used by FakeClockInjector.
func LoadFakeImageFromEmbedFs ¶
LoadFakeImageFromEmbedFs builds FakeImage from the embed filesystem. It parses the ELF file and extract the variables from the relocation section, reserves the space for them at the end of content, then calculates and saves offsets as "manually relocation"
func NewFakeImage ¶
func (*FakeImage) AttachToProcess ¶
AttachToProcess would use ptrace to replace the VDSO ELF entry with FakeImage. Each item in parameter "variables" needs a corresponding entry in FakeImage.offset.
func (*FakeImage) FindInjectedImage ¶
func (it *FakeImage) FindInjectedImage(program *ptrace.TracedProgram, varNum int) (*mapreader.Entry, error)
FindInjectedImage find injected image to avoid redundant inject.
func (*FakeImage) InjectFakeImage ¶
func (it *FakeImage) InjectFakeImage(program *ptrace.TracedProgram, vdsoEntry *mapreader.Entry) (*mapreader.Entry, error)
InjectFakeImage Usage CheckList: When error : TryReWriteFakeImage after InjectFakeImage.
func (*FakeImage) Recover ¶
Recover the injected image. If injected image not found , Recover will not return error.
func (*FakeImage) SetVarUint64 ¶
func (*FakeImage) TryReWriteFakeImage ¶
func (it *FakeImage) TryReWriteFakeImage(program *ptrace.TracedProgram) error
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package dateparse parses date-strings without knowing the format in advance, using a fast lex based approach to eliminate shotgun attempts.
|
Package dateparse parses date-strings without knowing the format in advance, using a fast lex based approach to eliminate shotgun attempts. |