Skip to content

Commit

Permalink
Add simple loading message box.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sucklead committed Mar 7, 2021
1 parent dfab915 commit 5819fba
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion DCoTEHook/DCoTEHook.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -197,10 +197,13 @@ BOOL InjectHookDll(HANDLE process, const char* dllPath)
return true;
}

VOID CALLBACK TimerCallback(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime)
{
PostQuitMessage(0);
}

int _tmain(int argc, _TCHAR* argv[])
{

STARTUPINFOA startupInfo;
PROCESS_INFORMATION processInformation;

Expand All @@ -211,6 +214,20 @@ int _tmain(int argc, _TCHAR* argv[])
char lpModWorkingDir[MAX_PATH];
char lpBaseWorkingDir[MAX_PATH];


int timeout_seconds = 3;
SetTimer(NULL, 1, timeout_seconds * 1000, (TIMERPROC)TimerCallback);

int result = MessageBox(0, "Red Hooking CoCMainWin32.exe...\n(Hit cancel to abort)", "DCoTEHook Version 0.4 by Sucklead", MB_TOPMOST | MB_OKCANCEL);

KillTimer(NULL, 1);

// did user hit cancel?
if (result == 2)
{
return 7;
}

GetCurrentDirectory(MAX_PATH, lpModWorkingDir);

//sprintf(message, "Initial working dir is [%s]", lpModWorkingDir);
Expand Down

0 comments on commit 5819fba

Please sign in to comment.