This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| WinRing0 Fix(ish) | |
| ================= | |
| Recently, there's been a ton of debate about how WinRing0 is the worst thing to have hit | |
| the planet. A lot of overexaggerated crap, yet the conclusion seems to be that WinRing0 | |
| is the ultimate sin because it doesn't protect its device with a DACL that disallows | |
| non-elevated processes from interacting with it. For now, until "security" becomes even | |
| more "secure", the consensus is that it is okayish for apps to mess with arbitrary | |
| memory regions (or at least, there's not much you can do about it), only when elevated tho. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Copyright 2026 Valentin Radu | |
| // License: GPLv2 | |
| // | |
| // cl /nologo winring0.c kernel32.lib ntdll.lib /O1 /GS- /Gs9999999 /GF /kernel /link /DLL /ENTRY:DllMain /NODEFAULTLIB /SUBSYSTEM:windows /NOCOFFGRPINFO /ALIGN:16 /MERGE:.rdata=.text /MERGE:.pdata=.text /OUT:WinRing0x64.dll | |
| // | |
| // cl /nologo winring0.c kernel32.lib ntdll.lib /O1 /GS- /Gs9999999 /GF /kernel /link /DLL /ENTRY:DllMain /NODEFAULTLIB /SUBSYSTEM:windows /NOCOFFGRPINFO /ALIGN:16 /MERGE:.rdata=.text /MERGE:.pdata=.text /OUT:WinRing0.dll | |
| // | |
| #define WIN32_LEAN_AND_MEAN | |
| #include <ntstatus.h> | |
| #define WIN32_NO_STATUS |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // cl /nologo truncate.c kernel32.lib shell32.lib /O1 /GS- /Gs9999999 /GF /kernel /link /ENTRY:main /NODEFAULTLIB /SUBSYSTEM:windows /NOCOFFGRPINFO /ALIGN:16 /MERGE:.rdata=.text /MERGE:.pdata=.text /OUT:truncate.exe | |
| #define WIN32_LEAN_AND_MEAN | |
| #include <Windows.h> | |
| #include <shellapi.h> | |
| #include <stdio.h> | |
| BOOL ParseUInt64W(const wchar_t* s, const wchar_t** end, ULONGLONG* out) { | |
| ULONGLONG v = 0; | |
| const wchar_t* p = s; |
OlderNewer