MCPcopy Create free account
hub / github.com/cinit/WSAPatch / FakeRtlGetVersion

Function FakeRtlGetVersion

WsaPatch.cpp:54–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

52using FuncRtlGetVersion = NTSYSAPI NTSTATUS(*)(PRTL_OSVERSIONINFOW lpVersionInformation);
53
54NTSTATUS WINAPI FakeRtlGetVersion(PRTL_OSVERSIONINFOW lpVersionInformation) {
55 // The minimal version is 10.0.22000.120 VER_NT_WORKSTATION
56 LOGD(L"-FakeRtlGetVersion");
57 DWORD size = lpVersionInformation->dwOSVersionInfoSize;
58 memcpy(lpVersionInformation, &gOsVersionInfo, size);
59 lpVersionInformation->dwOSVersionInfoSize = size;
60 if (gIsPatchVersionNumber) {
61 lpVersionInformation->dwBuildNumber = 22000;
62 }
63 if (gIsPatchProductType && size >= sizeof(OSVERSIONINFOEXW)) {
64 ((PRTL_OSVERSIONINFOEXW) lpVersionInformation)->wProductType = VER_NT_WORKSTATION;
65 }
66 return STATUS_SUCCESS;
67}
68
69FARPROC WINAPI BadGetProcAddress(_In_ HMODULE hModule, _In_ LPCSTR lpProcName) {
70 FARPROC result;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected