Created
November 28, 2025 08:06
-
-
Save rbmm/d7418d854594e2ec71d4464da4f8df07 to your computer and use it in GitHub Desktop.
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
| void TestDllReloc() | |
| { | |
| if (HMODULE hmod = GetModuleHandleW(L"kernel32.dll")) | |
| { | |
| STARTUPINFOW si = { sizeof(si) }; | |
| PROCESS_INFORMATION pi; | |
| WCHAR cmd[] = L"notepad.exe"; | |
| if (CreateProcessW(0, cmd, 0, 0, FALSE, CREATE_SUSPENDED, 0, 0, &si, &pi)) | |
| { | |
| VirtualAllocEx(pi.hProcess, hmod, 1, MEM_RESERVE, PAGE_NOACCESS); | |
| ResumeThread(pi.hThread); | |
| NtClose(pi.hThread); | |
| NtClose(pi.hProcess); | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment