-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#include <Windows.h> | ||
|
||
DWORD64 NO_LOGO = 0x140DEBF2B; | ||
const char NEW_BYTES[] = { 0x75 }; | ||
|
||
DWORD WINAPI run_thread(LPVOID param) { | ||
Sleep(10000); | ||
|
||
auto addr = reinterpret_cast<void *>(NO_LOGO); | ||
const auto size = 1; | ||
DWORD old; | ||
VirtualProtect(addr, size, PAGE_EXECUTE_READWRITE, &old); | ||
memcpy(addr, NEW_BYTES, size); | ||
VirtualProtect(addr, size, old, &old); | ||
|
||
return 0; | ||
} | ||
|
||
extern "C" { | ||
int __declspec(dllexport) __stdcall postAttach() { | ||
DWORD tmp; | ||
CreateThread(NULL, 0, run_thread, NULL, 0, &tmp); | ||
return 0; | ||
} | ||
} | ||
|
||
BOOL APIENTRY DllMain( | ||
HMODULE hModule, | ||
DWORD ul_reason_for_call, | ||
LPVOID lpReserved | ||
) { | ||
return TRUE; | ||
} | ||
|