Skip to content

BlackOfWorld/DrunkenMan

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DrunkenMan

logo

Prerequisites

Before compiling the project, ensure that you have the following prerequisites installed:

  • Windows operating system
  • x64 architecture
  • C++17 compatible compiler
  • Windows Driver Kit (WDK) for the "driver" target
  • xmake: A cross-platform build utility

Compilation Instructions

To compile the project, follow these steps:

  1. Clone the project repository to your local machine.

  2. Open a command prompt or terminal and navigate to the project directory.

  3. Make sure you have xmake installed on your system. If not, you can install it by following the instructions provided here.

  4. Run the following command to compile the project:

    xmake
    

    This command will read the xmake.lua file and build the project according to the specified configurations.

  5. After the compilation process completes successfully, the compiled binaries will be located in the build/Binaries directory. The exact path depends on the selected build mode (debug or release).

Targets

  1. driver: Represents a driver component. It compiles C files from the dependencies/driver directory and C++ files and resource files from the current directory. It sets the necessary defines and includes, links with ntoskrnl, and applies specific compiler and linker flags for kernel mode development.

  2. gatekeeper: Represents a binary component. It compiles C++ files from the current directory, sets the necessary defines and includes, links with ntdll, and applies specific compiler and linker flags.

  3. testdrv: Represents a driver component for testing purposes. It compiles C++ files from the current directory, sets the necessary defines and includes, links with ntoskrnl, and applies specific compiler and linker flags for kernel mode development.

Build Modes

  • debug: This mode sets the _DEBUG define, disables optimizations (-O0), and generates debug symbols (-g).

  • release: This mode sets the _RELEASE define, enables optimizations (-O2), and generates a release build without debug symbols.

  • releasedbg: This mode sets both _RELEASE and _RELEASEDBG defines. It disables optimizations (-O0) and generates debug symbols (-g).

Compiler and Linker Flags

This project includes various compiler and linker flags to customize the build process. Here are some notable flags:

  • Compiler flags:

    • -Wno-macro-redefined, -Wno-unused-value: Suppress specific warning messages.
    • -MTd, -MT: Specify the runtime library for the debug or release mode, respectively.
    • -fno-stack-protector, -fno-stack-check, -fno-rtti: Disable stack protector, stack checks, and RTTI (Run-Time Type Information).
  • Linker flags:

    • -Wl: Pass additional arguments to the linker.
    • /emittoolversioninfo:no, /emitpogophaseinfo: Control the emission of tool version information and pogophase information.

Useful things

%localappdata%\Microsoft\WIndowsApps\WinDbgX.exe -k <connect command >

Guest:

bcdedit /dbgsettings NET HOSTIP:1.2.3.4 PORT:55555
bcdedit /debug on

KDNET ignores HOSTIP and PORT variable under virt env in favor of VMBus

xmake check clang.tidy -f 'src/*.c:src/**.cpp'

About

just another abandoned WIP driver

Resources

License

Stars

Watchers

Forks