Musa.Core 0.3.4

Requires NuGet 2.5 or higher.

dotnet add package Musa.Core --version 0.3.4                
NuGet\Install-Package Musa.Core -Version 0.3.4                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Musa.Core" Version="0.3.4" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Musa.Core --version 0.3.4                
#r "nuget: Musa.Core, 0.3.4"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Musa.Core as a Cake Addin
#addin nuget:?package=Musa.Core&version=0.3.4

// Install Musa.Core as a Cake Tool
#tool nuget:?package=Musa.Core&version=0.3.4                

Musa.Core

Actions Status Downloads LICENSE Visual Studio Windows Platform

Introduction

Warning

Musa.Core is in beta testing...

Musa.Core is a derivative of the underlying API implementation of Musa.Runtime (formerly ucxxrt).

Use ntdll/ntoskrnl to implement Kernel32, Advapi32 and other APIs. It includes user-mode and kernel-mode.

How to use

Right click on the project, select "Manage NuGet Packages". Search for Musa.Core, choose the version that suits you, and then click "Install".

NuGet package depends on Musa.Veil, you can directly include <Veil.h>

Or

If your project template uses Mile.Project.Windows, you can add the following code directly to your .vcxproj file:

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

Header-only mode

Add the following code to your .vcxproj file:

  <PropertyGroup>
    <MusaCoreOnlyHeader>true</MusaCoreOnlyHeader>
  </PropertyGroup>

This mode will not automatically import lib files.

Feature

  • All ZwRoutines supported by the current system can be used directly.

    NTSTATUS DriverEntry(PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPath)
    {
        UNREFERENCED_PARAMETER(DriverObject);
        UNREFERENCED_PARAMETER(RegistryPath);
    
        NTSTATUS Status;
    
        do {
            DriverObject->DriverUnload = DriverUnload;
    
            Status = MusaCoreStartup(DriverObject, RegistryPath);
            if (!NT_SUCCESS(Status)) {
                break;
            }
    
            LARGE_INTEGER SystemTime{};
            Status = ZwQuerySystemTime(&SystemTime);
            if (!NT_SUCCESS(Status)) {
                break;
            }
    
            Status = RtlSystemTimeToLocalTime(&SystemTime, &SystemTime);
            if (!NT_SUCCESS(Status)) {
                break;
            }
    
            TIME_FIELDS Time{};
            RtlTimeToTimeFields(&SystemTime, &Time);
    
            MusaLOG("Loading time is %04d/%02d/%02d %02d:%02d:%02d",
                Time.Year, Time.Month, Time.Day,
                Time.Hour, Time.Minute, Time.Second);
    
        } while (false);
    
        if (!NT_SUCCESS(Status)) {
            DriverUnload(DriverObject);
        }
    
        return Status;
    }
    
  • Support part of RtlXxxx API.

  • Support part of KernelBase API.

  • Support part of Advapi32 API.

Progress

See Project

Acknowledgements

Thanks to JetBrains for providing free licenses such as Resharper C++ for my open-source projects.

<img src="https://resources.jetbrains.com/storage/products/company/brand/logos/ReSharperCPP_icon.png" alt="ReSharper C++ logo." width=200>

Thanks & References

Product Compatible and additional computed target framework versions.
native native is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Musa.Core:

Package Downloads
Musa.Runtime

Musa.Runtime - 是以 Musa.Core 作为底层支持的微软 MSVC 运行时库。 * 它可以让内核开发者拥有和应用开发者近似的 C++ 开发体验。 Musa.Runtime - Musa.Runtime is a Microsoft MSVC runtime library based on Musa.Core. * It allows kernel developers to have a C++ development experience similar to that of application developers.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.3.4 250 8/12/2024
0.3.3 119 8/2/2024
0.3.2 160 7/25/2024
0.3.1 167 7/18/2024
0.3.0 104 7/18/2024
0.2.0 216 7/11/2024
0.1.5 92 7/11/2024

Feature: Adjusting the lock level

Feature: Lock, KeEnterGuardedRegion() -> KeEnterCriticalRegion()
Feature: CreateRemoteThreadEx takes a counted reference to the IoObject object. The I/O manager releases this reference after the created thread exits.
Update: Musa.Veil to 1.2.5
-----BEGIN PGP SIGNATURE-----

iHUEABYKAB0WIQRY41VgHnSyeUsFmP7qVn/Erg8VwgUCZrlnewAKCRDqVn/Erg8V
wsvUAP0ZzVLGi0jJS52APrvLxnuLc8id0BSnP7WTR2DT15flGAD/T+IJ567h6WrE
rF+5/MZMVGzDzoeF7wkFY+uAdRnDZQ8=
=+Uj4
-----END PGP SIGNATURE-----