Windows attach dll
parent
b7aa6a997b
commit
3ffa1bed7a
@ -0,0 +1,32 @@
|
||||
#include "windows.h"
|
||||
#include <cstdio>
|
||||
|
||||
void ConsoleSetup()
|
||||
{
|
||||
// With this trick we'll be able to print content to the console, and if we have luck we could get information printed by the game.
|
||||
AllocConsole();
|
||||
SetConsoleTitle("MangoHud");
|
||||
freopen("CONOUT$", "w", stdout);
|
||||
freopen("CONOUT$", "w", stderr);
|
||||
freopen("CONIN$", "r", stdin);
|
||||
}
|
||||
|
||||
int MainThread(){
|
||||
ConsoleSetup();
|
||||
return 0;
|
||||
}
|
||||
|
||||
BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD fdwReason, LPVOID)
|
||||
{
|
||||
|
||||
DisableThreadLibraryCalls(hInstance);
|
||||
|
||||
switch (fdwReason)
|
||||
{
|
||||
case DLL_PROCESS_ATTACH:
|
||||
CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)MainThread, NULL, 0, NULL);
|
||||
break;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
Loading…
Reference in New Issue