-
-
Save KrzaQ/2409891 to your computer and use it in GitHub Desktop.
DLL
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
// dllmain.cpp : Defines the entry point for the DLL application. | |
#define WIN32_LEAN_AND_MEAN | |
#include <windows.h> | |
HINSTANCE g_hInstance = NULL; | |
//Game.exe+113F0 - 55 - push ebp | |
// int __cdecl sub_4113F0(LPCSTR lpText) | |
int (__cdecl *CallMe )( char * szMessage) = (int (__cdecl *)(char *)) (reinterpret_cast<DWORD_PTR>(GetModuleHandleA(0)+0x113F0)); | |
void Init() | |
{ | |
CallMe("Hello Word"); | |
FreeLibraryAndExitThread(g_hInstance, 0); | |
} | |
BOOL WINAPI DllMain(HINSTANCE hDll, DWORD dwReason, LPVOID lpReserved) | |
{ | |
switch(dwReason) | |
{ | |
case DLL_PROCESS_ATTACH: | |
{ | |
DisableThreadLibraryCalls(hDll); | |
g_hInstance=hDll; | |
CreateThread(NULL, NULL, ( LPTHREAD_START_ROUTINE ) Init, NULL, NULL, NULL); | |
} | |
break; | |
} | |
return true; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment