ZeroSystem.Core 1.2.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package ZeroSystem.Core --version 1.2.0
                    
NuGet\Install-Package ZeroSystem.Core -Version 1.2.0
                    
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="ZeroSystem.Core" Version="1.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ZeroSystem.Core" Version="1.2.0" />
                    
Directory.Packages.props
<PackageReference Include="ZeroSystem.Core" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add ZeroSystem.Core --version 1.2.0
                    
#r "nuget: ZeroSystem.Core, 1.2.0"
                    
#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.
#:package ZeroSystem.Core@1.2.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=ZeroSystem.Core&version=1.2.0
                    
Install as a Cake Addin
#tool nuget:?package=ZeroSystem.Core&version=1.2.0
                    
Install as a Cake Tool

โšก ZeroSystem: Sovereign Windows Native & Kernel Subsystem

ZeroPlatform Tier NuGet Version License: MIT Dependencies: 0 Platform: Windows Tests: 26 Passed

ZeroSystem (ZeroSystem.Core) is the sovereign Windows Native, Kernel P/Invoke, DWM Desktop, and OS Internals Subsystem of the ZeroPlatform / Zero Universe ecosystem. It provides type-safe, resource-managed wrappers around low-level Win32, NTDLL, and Kernel APIs with zero external dependencies (100% pure C# BCL).


๐Ÿ“ฆ Key Subsystem Capabilities

Component Description
NativeMethods Centralized, hardened Win32 P/Invoke declarations for Kernel32, User32, Advapi32, Ntdll, Shell32, DwmApi, RstrtMgr, ShCore, IpHlpApi, and Avrt.
StorageHardwareKernel Low-level storage IOCTLs: SSD vs HDD seek penalty detection, NVMe/SATA bus type, and disk geometry without WMI.
NetworkConnectionTracker Maps every active IPv4/IPv6 TCP connection and UDP listening endpoint to its owning Process ID (PID) via IP Helper APIs.
NtProcessKernel Ultra-fast process tree snapshot (< 2ms, 50x faster than Process.GetProcesses()), true parent PID resolution, and NtSuspendProcess / NtResumeProcess.
ThreadAffinityKernel CPU core pinning (SetThreadAffinityMask), time-critical thread priority, and Windows MMCSS multimedia scheduling (AvSetMmThreadCharacteristics).
MemoryLockKernel Locks virtual address ranges into physical RAM (VirtualLock), large memory page sizing (GetLargePageMinimum), and asynchronous memory prefetching.
StartupManager Cross-platform application autostart: Windows HKCU\...\Run & schtasks SYSTEM boot service, Linux ~/.config/autostart & systemd, macOS LaunchAgents, with Win32 console hiding.
FileLockManager Identifies processes and services locking files or folders via the Windows Restart Manager API (rstrtmgr.dll) without external tools.
SmbiosReader Sub-millisecond (< 0.1ms) zero-WMI extraction of Motherboard Serial, System UUID, and BIOS metadata via raw GetSystemFirmwareTable('RSMB').
DisplayManager Multi-monitor enumeration, work areas, per-monitor DPI scaling factors (100%, 125%, 150%, 200%), and virtual desktop bounding box.
BatteryTelemetry Battery and power telemetry (GetSystemPowerStatus): battery percentage, AC online status, charging state, estimated run-time.
AppInstanceManager Single-instance application coordinator via named system Mutex with automatic foreground window activation of existing instances.
WindowsServiceManager Native Windows Service Controller (Advapi32.dll): query service status, check existence, start and stop services without System.ServiceProcess.
HardwareTelemetry Real-time CPU usage (GetSystemTimes), RAM (GlobalMemoryStatusEx), dedicated/shared GPU memory (DXGI), drive geometry, and NICs.
DosDeviceManager High-level MS-DOS device mapping (DefineDosDevice). Mounts VSS Shadow Copies (\\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy{N}) to drive letters (Z:).
ProcessGuard System privileges escalation (SeBackupPrivilege, SeRestorePrivilege, SeProfileSingleProcessPrivilege), safe PID detection, and foreground window querying.
MemoryKernel Deep RAM optimization via undocumented NtSetSystemInformation (PurgeStandbyList = 4, SystemMemoryList = 80) and process working set trimming.
UnsafeFileStreamFactory Opens permissive non-locking file streams (FileShare.ReadWrite \| FileShare.Delete) to inspect locked files without sharing violations.
DesktopWallpaperInjector Interacts with Progman and DWM (0x052C) to spawn the behind-icon WorkerW canvas for Live Wallpapers and HUD overlays.
PowerAndDisplayWatcher Real-time monitoring of AC/Battery power state and detection of active full-screen applications.
ShellRegistryHelper Registers Windows Explorer context menu actions directly into HKCU\Software\Classes without requiring Administrator privileges.

๐Ÿš€ Quick Start

NuGet Package Installation

dotnet add package ZeroSystem.Core

Example 1: Mount VSS Shadow Copy

using ZeroSystem;

if (DosDeviceManager.TryMountDevice(@"\\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy1", out char driveLetter, out string err))
{
    Console.WriteLine($"VSS mounted at {driveLetter}:");
    // Access historical files via $"{driveLetter}:\\..."
    DosDeviceManager.TryUnmountDevice(driveLetter, null, out _);
}

Example 2: Purge Standby List (RAM Optimization)

using ZeroSystem;

if (ProcessGuard.TryEnablePrivilege(NativeMethods.SE_PROFILE_SINGLE_PROCESS_NAME))
{
    bool success = MemoryKernel.PurgeStandbyList();
    Console.WriteLine($"Standby List Purged: {success}");
}

Example 3: Detect Locking Processes (Restart Manager)

using ZeroSystem;

var lockers = FileLockManager.GetLockingProcesses(@"C:\Program Files\App\locked.dll");
foreach (var proc in lockers)
{
    Console.WriteLine($"Locked by PID {proc.ProcessId}: {proc.ProcessName} ({proc.ApplicationType})");
}

Example 4: Sub-Millisecond Hardware UUID (Zero-WMI SMBIOS)

using ZeroSystem;

string uuid = SmbiosReader.GetSystemUuid();
string boardSerial = SmbiosReader.GetMotherboardSerial();
Console.WriteLine($"Hardware Fingerprint: UUID={uuid}, Motherboard={boardSerial}");

Example 5: Single-Instance Mutex & Window Activation

using ZeroSystem;

if (!AppInstanceManager.TryAcquireSingleInstance("ZeroUniverse.ZProbe", out var appLock))
{
    Console.WriteLine("Another instance is already running. Activating existing window...");
    AppInstanceManager.BringProcessToForeground(Process.GetProcessesByName("ZProbe")[0].Id);
    return;
}

using (appLock)
{
    // Run main application loop
}

Example 6: Ultra-Fast Process Snapshot & Parent PID

using ZeroSystem;

var processes = NtProcessKernel.GetProcessListFast(); // Executes in 1-2ms (<50x faster than Process.GetProcesses())
foreach (var proc in processes)
{
    Console.WriteLine($"PID {proc.ProcessId} (Parent: {proc.ParentProcessId}) - {proc.ProcessName} [Threads: {proc.ThreadCount}]");
}

Example 7: SSD vs HDD Seek Penalty & NVMe Bus Type

using ZeroSystem;

bool isC_Ssd = StorageHardwareKernel.IsSolidStateDrive('C');
var disk0 = StorageHardwareKernel.GetPhysicalDiskInfo(0);

Console.WriteLine($"Drive C is SSD: {isC_Ssd}");
Console.WriteLine($"Disk 0: {disk0.Model}, Bus: {disk0.BusType}, Size: {disk0.TotalSizeBytes / (1024*1024*1024)} GB");

Example 8: Find Process Owning Network Port (IP Helper)

using ZeroSystem;

// Find which application is listening on port 6310 (IPP) or 9200
int? pid = NetworkConnectionTracker.FindProcessOwningTcpPort(6310);
if (pid.HasValue)
{
    Console.WriteLine($"Port 6310 is owned by PID: {pid.Value}");
}

Example 9: CPU Core Pinning & Multimedia Real-Time Priority

using ZeroSystem;

// Pin current thread to CPU Core 0 to eliminate cache thrashing
ThreadAffinityKernel.SetCurrentThreadAffinity(0);
ThreadAffinityKernel.SetCurrentThreadPriority(ThreadPriorityLevel.TimeCritical);

// Enable Windows MMCSS Pro Audio scheduling slice
using (ThreadAffinityKernel.EnableMultimediaScheduling("Pro Audio"))
{
    // Real-time vision inspection / DSP audio loop
}

๐Ÿ“„ License

Released under the permissive MIT License. Architected and developed by Phong Vรต (kzxl).

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net8.0-windows7.0 is compatible.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.4.0 113 9/29/2026
1.3.0 89 9/29/2026
1.2.0 100 9/29/2026
1.1.0 104 9/22/2026
1.0.0 106 9/22/2026