| #include <windows.h> |
| #include <nt.h> |
| |
| unsigned long int _stdcall RtlGetVersion(RTL_OSVERSIONINFO *VersionInformation){ |
| PROCESS_BASIC_INFORMATION pbi; |
| NtQueryInformationProcess((void *)-1, ProcessBasicInformation, &pbi, sizeof(pbi), NULL); |
| PEB *peb = pbi.PebBaseAddress; |
| VersionInformation->dwMajorVersion = peb->OSMajorVersion; |
| VersionInformation->dwMinorVersion = peb->OSMinorVersion; |
| VersionInformation->dwBuildNumber = peb->OSBuildNumber; |
| VersionInformation->dwPlatformId = peb->OSPlatformId; |
| return 0; |
| } |