21 Commits

Author SHA1 Message Date
suvenka 676d948235 Add process_start_key() to read ProcessStartKey from extended data
Add support for reading EVENT_HEADER_EXT_TYPE_PROCESS_START_KEY from
ETW extended data items, enabled via EVENT_ENABLE_PROPERTY_PROCESS_START_KEY.
The ProcessStartKey uniquely identifies a process instance across a boot
session (unlike PID which can be recycled).

Changes:
- Native C++: schema::process_start_key() in schema.hpp
- Managed .NET: TryGetProcessStartKey() on IEventRecordMetadata/EventRecordMetadata
- Test support: extended_data_builder::add_process_start_key()
- New example: UserTrace008_ProcessStartKey.cs

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-06 16:18:29 -08:00
Kyle Reed 924a28ed8d Update for .NET Core 8 (#267)
* Update for .NET Core 8
Clean up the netcore vcxproj files

* Update test assembly path

* Don't define a runtime lib in release builds (this is how it was before)

* Remove assemblyDebug from release builds

* Remember to actually save file after changing it
2025-11-19 16:47:22 -08:00
wwh1004 4ba137cc0a Unify. NET wrappers of callbacks and use error code checking instead of exception handling 2025-02-01 17:47:55 +08:00
Mihai PANDURU 6b3152dbe3 Correctly handle kernel addresses in an x86 stack trace (#241) 2024-08-13 14:46:28 -07:00
HydrophobicMinghao 338d486440 Add Windows ARM64 port for managed wrappers. (#234)
* Add assets for ARM64 port.

* Remove unused element.

* Add new ignore files.

* Compatible with non-SDK projects.

* Fix installation command log.

* Fix CI workflow.

* Fix platform targets.

* Fix x64 managed tests path.

* Migrate csproj to SDK style.

* Fix csproj.

* Align and fix csproj projects.
2024-06-04 08:46:15 -07:00
John U 394eb6c52a add call stack enrichment to the C# example (#204) 2022-11-19 20:37:07 -08:00
Henri-Bastien Lamontagne c31d39497a build and package krabs etw with .net 6.0 support 2022-08-01 14:41:08 -07:00
John U 79e8af192e add stack trace helpers (#26) (#191)
* add stack trace helpers (#26)

* use windows-2019 for builds

* [PR feedback] rename StackTrace method to GetStackTrace
2022-04-24 18:13:42 -07:00
Matt Swann b41b57cd42 Send schema errors to OnError callback in all cases (#175)
* Gracefully handle schema errors when applying filters

* Gracefully handle schema errors when applying filters

* Fix error message
Dispose managed error callbacks

* Improve error callback on event_filter

* Rename event callback for improved readability

* Add additional ETW trace flags described in public documentation or Microsoft open-source projects

* Remove TODO which has already been resolved through IEventRecordMetadata

* Add an interface for EventRecordError to enable unit-testing

* Address code review feedback

* Delete extraneous file

* Fix delegate name

* Resolve nits identified during self-review
2021-09-06 12:28:18 -07:00
John U 31679cf84b Rundown event support and examples (#155)
* added user-mode rundown support

* [bugfix] EVENT_TRACE_FLAG_DISK_FILE_IO enables events for the FileIo provider

* added examples for kernel rundown events (#138)

* added user-mode rundown support to C++/CLI API
2021-01-19 15:13:44 -08:00
John U fa2f89a583 added ability to set a default event callback (#147) (#151) 2020-12-23 12:52:22 -08:00
John U c526c45e5b add support for MOF providers, and update WPP example (#143) (#145)
* add support for MOF providers, and update WPP example (#143)

* updated predicate vector example doco

Co-authored-by: Matt Swann <mswann@Microsoft.com>
2020-11-19 16:30:12 -08:00
John U 84b77ed850 added a WPP trace example (#66) (#135) 2020-08-05 17:56:42 -07:00
John U 5ad82eff2a added PERFINFO_GROUPMASK typedefs and macros (#108)
* added PERFINFO_GROUPMASK macros

* added PERFINFO_GROUPMASK examples
2020-03-10 10:45:55 -07:00
John U aad6efc81f tracing Microsoft-Windows-Security-Auditing (#5) (#93)
Merge commit by: Matt Swann <3lemenopy@gmail.com>
2020-01-14 10:08:55 -08:00
Andrea Spadaccini 5b110cadf0 Cosmetic fixes (wording, formatting) (#86)
* Improve wording for ETW interface

Rename nightmare.hpp to etw.hpp to reflect its function,
and remove opinions on the ETW API in the comments.

* Add vim files to .gitignore

* Port Readme.txt to markdown and improve its formatting

* Improve .gitignore wording

* Fix typo in krabs/README.md

* Rename O365.Security.Native.ETW to Microsoft.O365.Security.Native.ETW

- change all occurrences in solution and project files;
- rename the directory containing the project;
- rename the project files.
2019-10-14 08:32:35 -07:00
Matt Swann ab944eeef1 Add support in C++/CLI for native ETW filtering (#84)
* Add support in C++/CLI for native ETW filtering

* Update nuspec

* Fix constructor comments

* Define a marshal_as template for List<T> to vector<T>

* Revert back to a helper method

* Add a generic list -> vector converter
Extract to a separate file

* CR feedback
2019-09-30 11:31:47 -07:00
Matt Swann 10661ab379 Comply with requirements for MSFT-owned nuget packages (#56)
* Disable strict compliance on tests project to work around a VS2017 compiler bug: https://developercommunity.visualstudio.com/content/problem/288560/cppunittestassert-doesnt-compile-with-permissive-i.html

* Disabling /permissive- for all build flavors

* Add ESRP delay signing key

* Add Microsoft prefix per MSFT requirements

* Sign.cmd is no longer needed

* Update assembly namespace to match nuget id

* Fix nuget file references

* Update expected public key

* Bump nuget version to 2.0.0
2018-10-02 12:14:48 -07:00
Zac Brown 12f32bfda4 Fix kernel examples. 2017-04-24 11:09:23 -07:00
Zac Brown (ODSP SECURITY) d2a053e762 Create DebugSigning and ReleaseSigning build targets for when we release to NuGet. This fixes issues with delay signing and the regular Debug/Release builds.
Signed-off-by: Zac Brown (ODSP SECURITY) <zbrown@microsoft.com>
2017-03-24 15:06:56 -07:00
Zac Brown c81c3c41f6 - Make projects for Managed and Native example code. (#3)
* - Make projects for Managed and Native example code.
- Create a 'tests' directory.
- Remove SampleCSharpKrabsExe as it is redundant with respect to the example code.

Signed-off-by: Zac Brown (ODSP SECURITY) <zbrown@microsoft.com>

* - Add note about TYPEASSERT and NDEBUG compilation flags to README.md.
- Add /W4 /WX compiler flags to NativeExample project.
- vcxproj.filters updates based on VS magic.

Signed-off-by: Zac Brown (ODSP SECURITY) <zbrown@microsoft.com>
2016-11-28 14:06:40 -08:00