https://github.com/MiroKaku/libwsk
The Kernel-Mode Winsock library, supporting TCP, UDP and Unix sockets (DGRAM and STREAM).
https://github.com/MiroKaku/libwsk
cpp17 driver windows winsock-kernel wsk
Last synced: 4 days ago
JSON representation
The Kernel-Mode Winsock library, supporting TCP, UDP and Unix sockets (DGRAM and STREAM).
- Host: GitHub
- URL: https://github.com/MiroKaku/libwsk
- Owner: MiroKaku
- License: mit
- Created: 2021-09-26T10:00:16.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2025-01-27T03:16:58.000Z (over 1 year ago)
- Last Synced: 2026-02-15T11:16:50.462Z (4 months ago)
- Topics: cpp17, driver, windows, winsock-kernel, wsk
- Language: C++
- Homepage:
- Size: 125 KB
- Stars: 275
- Watchers: 13
- Forks: 89
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- Awesome-Bootkits-Rootkits-Development - Github: libwsk - > It is a wrapper for the WSK (Winsock-Kernel) interface. With libwsk, kernel-mode software modules can perform network I/O operations using the same socket programming concepts and interface that are supported by user-mode Winsock2. (***Rootkits*** / ***Techniques***)
README
# [libwsk](https://github.com/mirokaku/libwsk)
[](https://github.com/MiroKaku/libwsk/actions)
[](https://github.com/MiroKaku/libwsk/blob/master/LICENSE)


[](https://www.nuget.org/packages/Musa.libwsk/)
* [简体中文](README.zh-CN.md)
## About
libwsk is a wrapper for the [WSK (Winsock-Kernel)](https://docs.microsoft.com/en-us/windows-hardware/drivers/network/introduction-to-winsock-kernel) interface. With libwsk, kernel-mode software modules can perform network I/O operations using the same socket programming concepts and interface that are supported by user-mode Winsock2.
## Build and used
### Windows 10 or higher
Right click on the project, select "Manage NuGet Packages".
Search for `Musa.libwsk`, choose the version that suits you, and then click "Install".
### Windows 7
1. First modify the settings:
```
libwsk property pages -> Driver Settings -> Target OS Version = Windows 7
libwsk Property pages -> Driver Settings -> Target Platform = Desktop
```
2. Call BuildAllTargets.cmd
## Supported progress
| BSD sockets | WSA (Windows Sockets API) | WSK (Windows Sockets Kernel) | State
| --- | --- | --- | :----:
| - | ~~WSAStartup~~ | WSKStartup | √
| - | ~~WSACleanup~~ | WSKCleanup | √
| socket | ~~WSASocket~~ | WSKSocket | √
| closesocket | ~~WSASocket~~ | WSKCloseSocket | √
| bind | - | WSKBind | √
| listen | - | WSKListen | √
| connect | ~~WSAConnect~~ | WSKConnect | √
| shutdown | ~~WSA[Recv/Send]Disconnect~~ | WSKDisconnect | √
| accept | ~~WSAAccept~~ | WSKAccept | √
| send | ~~WSASend~~ | WSKSend | √
| recv | ~~WSARecv~~ | WSKRecv | √
| sendto | ~~WSASendTo~~ | WSKSendTo | √
| recvfrom | ~~WSARecvFrom~~ | WSKRecvFrom | √
| ioctlsocket | ~~WSAIoctl~~ | WSKIoctl | √
| setsockopt | - | WSKSetSocketOpt | √
| getsockopt | - | WSKGetSocketOpt | √
| getaddrinfo | ~~GetAddrInfoEx~~ | WSKGetAddrInfo | √
| freeaddrinfo | ~~FreeAddrInfoEx~~ | WSKFreeAddrInfo | √
| getnameinfo | ~~GetNameInfo~~ | WSKGetNameInfo | √
| inet_ntoa | ~~WSAAddressToString~~ | WSKAddressToString | √
| inet_addr | ~~WSAStringToAddress~~ | WSKStringToAddress | √
| - | ~~WSACreateEvent~~ | WSKCreateEvent | √
| - | ~~WSAGetOverlappedResult~~ | WSKGetOverlappedResult | √
| ... | ... | ... | -
## Reference
* [wbenny/KSOCKET](https://github.com/wbenny/KSOCKET)
* [microsoft/docs](https://docs.microsoft.com/zh-cn/windows-hardware/drivers/network/introduction-to-winsock-kernel)