Gabz

RPG Maker Injectable Code

Oct 21st, 2014
340
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.52 KB | None | 0 0
  1. #include <Windows.h>
  2. #include <cstdio>
  3.  
  4. void MainLoop() {
  5.     void *addyres   = (void*)0x10003760;
  6.     char  command[] = "$a = 2";
  7.    
  8.     __asm {
  9.         lea eax, command
  10.         push eax
  11.         call [addyres];
  12.         pop ebx
  13.     }
  14.  
  15.     return;
  16. }
  17.  
  18.  
  19. BOOL APIENTRY DllMain(HMODULE hModule, DWORD reason, LPVOID lpReserved) {
  20.     switch(reason) {
  21.     case DLL_PROCESS_ATTACH:
  22.         DisableThreadLibraryCalls(hModule);
  23.         CreateThread(
  24.             NULL,
  25.             0,
  26.             (unsigned long(__stdcall*)(void*))MainLoop,
  27.             NULL,
  28.             0,
  29.             NULL
  30.         );
  31.     }
  32.  
  33.     return TRUE;
  34. }
Advertisement
Add Comment
Please, Sign In to add comment