mirror of
https://github.com/winterknife/EVENSTAR
synced 2026-06-21 14:13:51 +00:00
EVENSTAR - GetCPL
Version
v1.0.0
Brief
ISA: x86Mode: Real, Protected, Compatibility, LongBitness: 16-bit, 32-bit, 64-bitCPL: 0, 3OS: WindowsLanguage: C- Sample code that demonstrates the usage of the
SMSWinstruction to fetch theMachine Status Word(bits 0 through 15 of control registerCR0) and check the processor'sCurrent Privilege Level (CPL)if the processor is running inProtectedmode
Usage
- There aren't a lot of useful bits in the
MSW - One notable exception:
PE (Protection Enable)bit (0) - This flag enables Segmentation
- The processor maintains an internal state called
CPLwhich is defined as the privilege level of the currently executing code CPLis used to determine whether certain operations are permitted or notCPLis given byCS.RPL(bits 0 and 1)
C:\pub\bld\DriverRun>GetCPL.exe
[*] GetCPL Built Jun 16 2025 18:13:39
Press any key to continue . . .
[DBG]: user-mode
Press any key to continue . . .
[DBG]: +++ GetCPL.sys Loaded +++
[DBG]: GetCPL.sys Built Jun 17 2025 07:12:51
[DBG]: GetCPL: DriverObject = FFFFC486721BDAF0
[DBG]: GetCPL: RegistryPath = \REGISTRY\MACHINE\SYSTEM\ControlSet001\Services\GetCPL
[DBG]: supervisor-mode
[DBG]: --- GetCPL.sys Unloaded ---
Tested OS Versions
Windows 11 21H2 Build 22000 Revision 675 64-bit