Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert DLL Plugin Architecture To Driver Architecture #21

Open
tarterp opened this issue Nov 15, 2023 · 2 comments
Open

Convert DLL Plugin Architecture To Driver Architecture #21

tarterp opened this issue Nov 15, 2023 · 2 comments
Assignees

Comments

@tarterp
Copy link

tarterp commented Nov 15, 2023

Converting to a Driver Plugin brings a simpler architecture:

  1. Drivers are loaded and unloaded using ZwLoadDriver and ZwUnloadDriver
  2. No manual mapping required which makes symbolic debugging easier
  3. Still use export functions, this requires custom GetProcAddress
  4. Simpler interfaces from kernel to plugin
  5. No more programming as a user dll, but run in kernel.

Architecture Decisions

  1. Keep exports, other ideas that were investigate: Driver Callbacks, Calling Drivers
  2. Minimize Plugin API functions
  3. ZwLoadDriver and ZwUnloadDriver require a Registry path. Since STrace is a single plugin architecture the plugin will always be Registry\Machine\System\CurrentControlSet\Services\StracePlugin, with a binary path of \\systemroot\\system32\drivers\StracePlugin.sys. It will be the responsibility of the CLI to rename the plugin chosen as done prior and copy it to StracePlugin.sys. When debugging the symbols will remain the original binary to help distinguish. Possibly add an IOCTL that returns the plugin name.
@stevemk14ebr
Copy link
Collaborator

Encountered an unexpected issue importing some c++ headers like type_traits. @tarterp had the idea of making a static lib that wraps up this C++ code and link that to the driver. This seems to be suitable for us.

@stevemk14ebr
Copy link
Collaborator

This is a known issue it seems microsoft/STL#4208

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants