The Kernel-Mode Winsock library, supporting TCP, UDP and Unix sockets (DGRAM and STREAM).

Overview

libwsk

Actions Status LICENSE Windows Visual Studio

About

libwsk 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.

Build and used

IDE:Visual Studio 2019 or higher

  1. git clone https://github.com/MiroKaku/libwsk.git
  2. Open the msvc/libwsk.sln and build it.
  3. include libwsk.lib to your project. refer unittest

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

Issues
  • berkeley.cpp [BUG]

    berkeley.cpp [BUG]

    berkeley.cpp: 82: SOCKET WSKAPI accept

    return WSKSetLastError(Status), (!NT_SUCCESS(Status) ? SOCKET_ERROR : SOCKET_SUCCESS); => return WSKSetLastError(Status), Socket;

    bug 
    opened by nil-ref 2
  • unittest BugCheck 1a

    unittest BugCheck 1a

    MEMORY_MANAGEMENT (1a) # Any other values for parameter 1 must be individually examined. Arguments: Arg1: 0000000000061948, The subtype of the BugCheck. Arg2: 0000000118c05806 Arg3: 0000000000000001 Arg4: 0000000118c05806

    Debugging Details:

    KEY_VALUES_STRING: 1

    Key  : Analysis.CPU.mSec
    Value: 1749
    
    Key  : Analysis.DebugAnalysisManager
    Value: Create
    
    Key  : Analysis.Elapsed.mSec
    Value: 30083
    
    Key  : Analysis.Init.CPU.mSec
    Value: 4702
    
    Key  : Analysis.Init.Elapsed.mSec
    Value: 306851
    
    Key  : Analysis.Memory.CommitPeak.Mb
    Value: 63
    
    Key  : WER.OS.Branch
    Value: rs2_release
    
    Key  : WER.OS.Timestamp
    Value: 2017-03-17T18:34:00Z
    
    Key  : WER.OS.Version
    Value: 10.0.15063.0
    

    BUGCHECK_CODE: 1a

    BUGCHECK_P1: 61948

    BUGCHECK_P2: 118c05806

    BUGCHECK_P3: 1

    BUGCHECK_P4: 118c05806

    PROCESS_NAME: System

    STACK_TEXT:
    ffffba01731e6d08 fffff80111405322 : 0000000000061948 000000000000001a ffffba01731e6e70 fffff801112b7c60 : nt!DbgBreakPointWithStatus ffffba01731e6d10 fffff80111404bd2 : 0000000000000003 ffffba01731e6e70 fffff801114b6180 000000000000001a : nt!KiBugCheckDebugBreak+0x12 ffffba01731e6d70 fffff80111374417 : 0000000000000000 fffff8011121cfd6 0000000000000000 ffffd00900000000 : nt!KeBugCheck2+0x922 ffffba01731e7480 fffff801113b8774 : 000000000000001a 0000000000061948 0000000118c05806 0000000000000001 : nt!KeBugCheckEx+0x107 ffffba01731e74c0 fffff801113907c5 : 0000000000000000 0000000000000000 0000000000000001 0000000000000001 : nt!MiDereferenceIoPages+0xeff80 ffffba01731e7570 fffff800bedf6a06 : 0000000000000000 0000000000000000 0000000000000000 ffffd009b080c000 : nt!MmUnlockPages+0x164325 ffffba01731e7650 fffff800bedf463b : ffffd009b14586a0 ffffba01731e7760 ffffd009b080c000 0000000000000000 : unittest!WSKUnlockBuffer+0x66 [D:\test\libwsk\src\libwsk.cpp @ 163] ffffba01731e7680 fffff800bedf497d : ffffd009b1458670 ffffba0100000000 ffffba0100000000 0000000000000000 : unittest!WSKFreeContextIRP+0x3b [D:\test\libwsk\src\libwsk.cpp @ 187] ffffba01731e76b0 fffff800bedf1c07 : 0000000000000000 fffff800bedf72b0 fffff80000000000 0000000000000000 : unittest!WSKGetAddrInfo+0x30d [D:\test\libwsk\src\libwsk.cpp @ 1630] ffffba01731e7790 fffff800bedf2b7b : 0000000000000000 fffff800bedf72b0 0002001900000002 fffff800bedf0002 : unittest!UnitTest::StartWSKServer+0x197 [D:\test\libwsk\test\main.cpp @ 292] ffffba01731e78b0 fffff800bedf2e1b : ffffd009b1606590 ffffd009b080c000 ffffd009b080c000 ffffd009b1606590 : unittest!DriverEntry+0x6b [D:\test\libwsk\test\main.cpp @ 49] ffffba01731e78f0 fffff800bedf2d50 : ffffd009b080c000 ffffba01731e7a60 ffffd009b1606590 ffffd009b1606590 : unittest!FxDriverEntryWorker+0xbf [minkernel\wdf\framework\kmdf\src\dynamic\stub\stub.cpp @ 349] ffffba01731e7930 fffff8011163c606 : 0000000000000000 0000000000000000 ffffd009b1606590 0000000000000000 : unittest!FxDriverEntry+0x20 [minkernel\wdf\framework\kmdf\src\dynamic\stub\stub.cpp @ 238] ffffba01731e7960 fffff8011172df37 : fffff80111600200 0000000000000000 0000000000000000 fffff80111600380 : nt!IopLoadDriver+0x522 ffffba01731e7b40 fffff801112271c8 : 0000000000000000 ffffffff80001d78 fffff80100000000 ffffd009b0f3d040 : nt!IopLoadUnloadDriver+0x57 ffffba01731e7b80 fffff801112c1a37 : 0000000000000000 0000000000000080 ffffd009af063680 ffffd009b0f3d040 : nt!ExpWorkerThread+0xd8 ffffba01731e7c10 fffff80111379796 : ffffba0171e55180 ffffd009b0f3d040 fffff801112c19f0 0000000000000246 : nt!PspSystemThreadStartup+0x47 ffffba01731e7c60 0000000000000000 : ffffba01731e8000 ffffba01731e2000 0000000000000000 0000000000000000 : nt!KiStartSystemThread+0x16

    FAULTING_SOURCE_LINE: D:\test\libwsk\src\libwsk.cpp

    FAULTING_SOURCE_FILE: D:\test\libwsk\src\libwsk.cpp

    FAULTING_SOURCE_LINE_NUMBER: 163

    FAULTING_SOURCE_CODE:
    159: { 160: MmUnlockPages(WSKBuffer->Mdl); 161: } 162:

    163: IoFreeMdl(WSKBuffer->Mdl); 164: WSKBuffer->Mdl = nullptr; 165: } 166: } 167: } 168:

    SYMBOL_NAME: unittest!WSKUnlockBuffer+66

    MODULE_NAME: unittest

    IMAGE_NAME: unittest.sys

    STACK_COMMAND: .thread ; .cxr ; kb

    BUCKET_ID_FUNC_OFFSET: 66

    FAILURE_BUCKET_ID: 0x1a_61948_unittest!WSKUnlockBuffer

    OS_VERSION: 10.0.15063.0

    BUILDLAB_STR: rs2_release

    OSPLATFORM_TYPE: x64

    OSNAME: Windows 10

    bug 
    opened by nil-ref 2
Owner
MeeSong
[+] Modern C++ advocates and practitioners [+] Windows Kernel [+] Meow~
MeeSong
a unix inspired, non posix compliant micro kernel (more of a monolithic kernel for now though) that i am working on in my spare time

toy-kernel a unix inspired, non posix compliant micro kernel (more of a monolithic kernel for now though) that i am working on in my spare time prereq

czapek 13 Jun 14, 2022
Loads a signed kernel driver which allows you to map any driver to kernel mode without any traces of the signed / mapped driver.

CosMapper Loads a signed kernel driver (signed with leaked cert) which allows you to map any driver to kernel mode without any traces of the signed /

null 107 Jul 2, 2022
If the button pressed esp will reset and App mode will on. App mode will on then led will on, network is connected led will off.

DHT22-to-Google-sheet-Reset-Using-ESP8266-LED-Switch If button pressed esp will reset and App mode will on. App mode will on then led will on, network

Md. Harun-Or-Rashid 4 Oct 5, 2021
Library with useful output stream tools like: color and style manipulators, progress bars and terminal graphics.

Library with useful output stream tools like: color and style manipulators, progress bars and terminal graphics Table of contents Introduction Documen

Gianluca Bianco 104 May 30, 2022
Kernel mode WinDbg extension and PoCs for token privilege investigation.

PrivFu Kernel mode WinDbg extension and PoCs for testing how token privileges work. There are notable repository and articles about token privilege ab

null 277 Jun 27, 2022
x64 Windows kernel code execution via user-mode, arbitrary syscall, vulnerable IOCTLs demonstration

anycall x64 Windows kernel code execution via user-mode, arbitrary syscall, vulnerable IOCTLs demonstration Read: https://www.godeye.club/2021/05/14/0

Kento Oki 134 Jun 17, 2022
privacier - cs:go kernel mode cheat

privacier - cs:go kernel mode cheat Simple CS:GO Cheat based on IOCTL driver with pretty simple features to practice in development. Goals Using lazy_

Stepan Kuznetsov 19 Jun 24, 2022
Windows kernel-mode driver emulating well-known USB game controllers.

Windows kernel-mode driver emulating well-known USB game controllers.

Virtual Gamepad Emulation Framework 1.4k Jun 24, 2022
An ESP32 system that can perform a Directory, Upload, Download, Delete, Rename and Stream Files in SPIFFS

ESP-File-Server An ESP32 system that can perform a Directory, Upload, Download, Delete, Rename and Stream Files in SPIFFS Using an ESP32 to handle fil

G6EJD 22 Jun 24, 2022
MPEG-TS stream selector and stabilizer

tsreadex - MPEG-TSのストリーム選択と安定化のためのツール 使用法: tsreadex [-z ignored][-s seek][-l limit][-t timeout][-m mode][-x pids][-n prog_num_or_index][-a aud1][-b

null 14 Mar 13, 2022
multi-sdr-gps-sim generates a IQ data stream on-the-fly to simulate a GPS L1 baseband signal using a SDR platform like HackRF or ADLAM-Pluto.

multi-sdr-gps-sim generates a GPS L1 baseband signal IQ data stream, which is then transmitted by a software-defined radio (SDR) platform. Supported at the moment are HackRF, ADLAM-Pluto and binary IQ file output. The software interacts with the user through a curses based text user interface (TUI) in terminal.

null 57 Jun 20, 2022
WIP - Material para uma live stream que estou preparando

C para devs PHP ATENÇÃO: Este projeto ainda está em progresso. A estrutura e conteúdo aqui provavelmente ainda estão muito confusas. Eu não recomendo

Níckolas Daniel da Silva 10 Feb 24, 2022
A method from GH on how to stream a dll without touching disk, TAGS: fortnite cheat fortnite injector dll injector

dll-encryptor People who make pay hacks typically have down syndrome and are incapable of using their brains in any fashion, and yet these bath salt s

Micca 2 Nov 24, 2021
Reading ADC of NodeMCU and sending data to QT Application over UDP

QT-NodeMCU-Application Reading ADC of NodeMCU and sending data to QT Application over UDP The following program should be used to run Lua Script: http

Akif Aydogmus 1 Nov 18, 2021
A Walkie-Talkie based around the ESP32 using UDP broadcast or ESP-NOW

Overview We've made a Walkie-Talkie using the ESP32. Explanatory video Audio data is transmitted over either UDP broadcast or ESP-NOW. So the Walkie-T

atomic14 209 Jun 24, 2022
Minecraft injection client, started as a UDP-CPP port for linux

Phantom Fully C++ Minecraft injection client for linux. Mapping code is based off of UDP, and Dear ImGui is used for the window, but the cheats and st

Some Pineaple 31 Jun 17, 2022
Visualization Library is a C++ middleware for high-performance 2D and 3D graphics applications based on OpenGL 1.x-4.x supporting Windows, Linux and Mac OS X.

Visualization Library 2.2 Gallery About Visualization Library is a C++ middleware for high-performance 2D and 3D graphics applications based on the in

Michele 293 Jun 26, 2022
Cross-platform C++ input library supporting gamepads, keyboard, mouse, touch

This project is archived. It's neither maintained nor developed anymore. Gainput Gainput is the awesome C++ input library for your game: handles your

Johannes Kuhlmann 745 Jun 24, 2022
Flock is a C++ library supporting lock-free locks

Flock : A library for lock-free locks Flock is a C++ library supporting lock-free locks as described in the paper: Lock-free Locks: Revisited Naama Be

null 19 Jun 19, 2022