1
0
mirror of https://github.com/valinet/ExplorerPatcher.git synced 2024-11-27 17:00:59 +01:00

Introduced a bit more delay at startup, also terminate the app

after the injection is done.
This commit is contained in:
Valentin Radu 2021-08-12 05:21:21 +03:00
parent 51e6d6b953
commit 0ab00b83ea

View File

@ -13,12 +13,20 @@ processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")
#define APP_NAME TEXT("Windows Explorer") #define APP_NAME TEXT("Windows Explorer")
#define NOP 0x90 #define NOP 0x90
#define PATCH_OFFSET 0x8cb33 #define PATCH_OFFSET 0x8cb33
#define DELAY 5000
HANDLE hProcess = NULL; HANDLE hProcess = NULL;
HMODULE hMod = NULL; HMODULE hMod = NULL;
LPVOID hInjection = NULL; LPVOID hInjection = NULL;
HWND hWnd = NULL; HWND hWnd = NULL;
DWORD KillAfter(INT64 timeout)
{
Sleep(timeout);
TerminateProcess(GetCurrentProcess(), 0);
return 0;
}
LRESULT CALLBACK WindowProc( LRESULT CALLBACK WindowProc(
HWND hWnd, HWND hWnd,
UINT uMsg, UINT uMsg,
@ -302,7 +310,15 @@ int WINAPI wWinMain(
szLibPath, szLibPath,
L"\\ExplorerPatcherLibrary.dll" L"\\ExplorerPatcherLibrary.dll"
); );
Sleep(2000); Sleep(DELAY);
CreateThread(
0,
0,
KillAfter,
5000,
0,
0
);
return VnInjectAndMonitorProcess( return VnInjectAndMonitorProcess(
szLibPath, szLibPath,
MAX_PATH, MAX_PATH,