MCPcopy Create free account
hub / github.com/rabbitstack/fibratus / ProcessEvent

Method ProcessEvent

internal/etw/processors/mem_windows.go:50–77  ·  view source on GitHub ↗
(e *event.Event)

Source from the content-addressed store, hash-verified

48}
49
50func (m memProcessor) ProcessEvent(e *event.Event) (*event.Event, bool, error) {
51 if e.Category == event.Mem {
52 pid := e.Params.MustGetPid()
53 if e.IsVirtualAlloc() {
54 // retrieve info about the range of pages and enrich the event
55 // with allocation protection options and the type of pages in
56 // the allocated region. If the region is mapped, we try to find
57 // the backing file name
58 addr := e.Params.MustGetUint64(params.MemBaseAddress)
59 region := m.regionProber.Query(pid, addr)
60 if region != nil {
61 if region.IsMapped() {
62 e.AppendParam(params.FilePath, params.DOSPath, region.GetMappedFile())
63 }
64 e.AppendEnum(params.MemPageType, region.Type, MemPageTypes)
65 e.AppendFlags(params.MemProtect, region.Protect, event.MemProtectionFlags)
66 e.AppendParam(params.MemProtectMask, params.AnsiString, region.ProtectMask())
67 }
68 }
69 proc := m.psnap.FindAndPut(pid)
70 if proc != nil {
71 e.AppendParam(params.Exe, params.Path, proc.Exe)
72 e.AppendParam(params.ProcessName, params.AnsiString, proc.Name)
73 }
74 return e, false, nil
75 }
76 return e, true, nil
77}

Callers

nothing calls this directly

Calls 11

MustGetPidMethod · 0.80
IsVirtualAllocMethod · 0.80
MustGetUint64Method · 0.80
QueryMethod · 0.80
IsMappedMethod · 0.80
AppendParamMethod · 0.80
GetMappedFileMethod · 0.80
AppendEnumMethod · 0.80
AppendFlagsMethod · 0.80
FindAndPutMethod · 0.65
ProtectMaskMethod · 0.45

Tested by

no test coverage detected