Musa.Core

June 6, 2026 · View on GitHub

Actions Status Downloads LICENSE Visual Studio Windows Platform

Overview

Warning

Musa.Core is in beta.

Musa.Core is a derivative of the low-level API implementation from Musa.Runtime (formerly ucxxrt). It reimplements Kernel32, Advapi32, and other Win32 APIs on top of ntoskrnl in kernel mode.

Architecture

graph TD
    A[Kernel Driver] --> B[MusaCoreStartup]
    B --> C[Musa.Core StaticLibrary]
    C --> D[Musa.CoreLite]
    D --> E[Musa.Veil]
    E --> F[ntoskrnl.exe]
    C --> G[Kernel32 Thunks]
    C --> H[Advapi32 Thunks]
    C --> I[Ntdll Thunks]
    G --> F
    H --> F
    I --> F

Quick Start

NuGet Install

<ItemGroup>
  <PackageReference Include="Musa.Core">
    <Version>0.7.0</Version>
  </PackageReference>
</ItemGroup>

The NuGet package depends on Musa.CoreLite. You can directly include <Veil.h> to access underlying APIs.

DriverEntry Example

NTSTATUS DriverEntry(PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPath)
{
    NTSTATUS Status = MusaCoreStartup(DriverObject, RegistryPath, FALSE);
    if (!NT_SUCCESS(Status)) return Status;

    // Kernel32/Advapi32 APIs now available
    WCHAR Dir[MAX_PATH];
    DWORD Len = GetCurrentDirectoryW(MAX_PATH, Dir);

    return Status;
}

Build Requirements

DependencyMinimum Version
Visual Studio 202217.10+
Windows Driver Kit (WDK)Matching SDK build
Mile.Project.Configurations1.0.1917

Building from Source

.\BuildAllTargets.cmd

Build artifacts are output to the Publish/ directory.

Implemented Modules

ModuleStatus
Zw Routines✅ All available
Rtl Series API✅ Partial
KernelBase API✅ Partial
Kernel32 Thunks (Phase 1-6)✅ Implemented
Advapi32 API🚧 In Progress

Key Features

  • Kernel-mode only — exclusively supports KernelMode toolset projects; enforced at consumer build time
  • NuGet integration — auto-configures header and library paths, injects /INTEGRITYCHECK linker flag
  • Debug loggingMusaLOG macro outputs DbgPrintEx in Debug builds, no-op in Release

Documentation

License

MIT License

References