microsoft / krabsetw

KrabsETW provides a modern C++ wrapper and a .NET wrapper around the low-level ETW trace consumption functions.
Other
589 stars 149 forks source link

Incorrect EventRecordMetadata->Opcode Size #69

Closed FuzzySecurity closed 5 years ago

FuzzySecurity commented 5 years ago

Maybe I'm confused but EventRecordMetadata specifies that the Opcode type is byte: https://github.com/Microsoft/krabsetw/blob/master/O365.Security.Native.ETW/EventRecordMetadata.hpp#L43

However Opcode should be a UInt32 (I think). Consider the Kernel trace example here: https://github.com/Microsoft/krabsetw/blob/master/examples/ManagedExamples/KernelTrace001.cs#L39

Opcode=0x1 -> EVENT_TRACE_FLAG_PROCESS

Looking at the other options on MSDN shows most of them actually don't fit into into a UInt8. https://docs.microsoft.com/en-gb/windows/desktop/ETW/msnt-systemtrace

swannman commented 5 years ago

Thanks for reaching out! Here's what I see:

Based on this, the existing API appears to be correct. Let me know if I missed something!

Cheers, Matt