https://github.com/utoni/mingw-w64-ksocket
Windows Kernel <-> User mode socket communication made for "Mingw64 Driver Plus Plus".
https://github.com/utoni/mingw-w64-ksocket
kernel-driver kernelmode mingw-w64 mingw-w64-dpp socket-io tcp-socket usermode
Last synced: 10 months ago
JSON representation
Windows Kernel <-> User mode socket communication made for "Mingw64 Driver Plus Plus".
- Host: GitHub
- URL: https://github.com/utoni/mingw-w64-ksocket
- Owner: utoni
- Created: 2022-09-01T12:50:05.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2023-09-15T12:21:05.000Z (over 2 years ago)
- Last Synced: 2025-04-14T11:06:26.492Z (about 1 year ago)
- Topics: kernel-driver, kernelmode, mingw-w64, mingw-w64-dpp, socket-io, tcp-socket, usermode
- Language: C
- Homepage:
- Size: 678 KB
- Stars: 9
- Watchers: 2
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Mingw64 Kernel Sockets
Requires [mingw-w64-dpp](https://github.com/utoni/mingw-w64-dpp) and Windows 10. Windows 11 may or may not work, not tested yet.
Did you ever ask yourself the question: how-the-hell can I open a socket in kernel mode with a Mingw-w64 compiled driver?
Well, this is the solution. `mingw-w64-ksocket` simplifies the use of stream/datagram client/server sockets.
The API is similiar to the BSD socket API.
Greetings to [KSOCKET](https://github.com/wbenny/KSOCKET) for this sweet approach.
Compatible with C and C++ drivers.
# HowTo
Build it:
```shell
make DPP_ROOT="[path-to-mingw-w64-dpp-template-dir]" all
```
To install & (self-)sign the driver:
```shell
make DPP_ROOT="[path-to-mingw-w64-dpp-template-dir]" DESTDIR="[path-to-install-dir]" install
```
The directory `[path-to-install-dir]` should now contain three new files:
* `driver.bat` / `driver-protobuf-c.bat` / `driver-protobuf-c-tcp.bat`: setup the driver service, start it, stop it when it's done and delete it
* `driver.sys`: example driver that uses kernel sockets (used together with `userspace_client.exe`)
* `userspace_client.exe`: example userspace application which communicates with the driver via TCP
* `driver-protobuf-c.sys`: example driver that make use of protobuf-c (local, no TCP/IP)
* `driver-protobuf-c-tcp.sys`: example driver that make use of protobuf-c via TCP/IP (used together with `userspace_client_protobuf.exe`)
* `userspace_client_protobuf.exe`: example userspace application which leverages protocol buffers to communicate with the driver via TCP
Start `*.bat` as `Administrator`.
If everything works fine, there should be a text displayed in `userspace_client.exe` / `userspace_client_protobuf.exe` console window, received from the driver.
For more debug output, it is recommended to use a debugger or log viewer like `dbgview`.