Advertisement
Guest User

Source.cpp

a guest
Feb 18th, 2015
504
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.31 KB | None | 0 0
  1. #include "Hooks.h"
  2.  
  3. //Main thread
  4. DWORD WINAPI Main(LPVOID param)
  5. {
  6.     //Call our hooks only once
  7.     //HookSwapBuffers();
  8.     HookglClear();
  9.     HookglDrawElements();
  10.     HookglBindTexture();
  11.  
  12.     while (true)
  13.     {
  14.         if (GetAsyncKeyState(VK_NUMPAD0) & 1)
  15.         {
  16.             GrabModels = !GrabModels;
  17.         }
  18.  
  19.         if (GetAsyncKeyState(VK_NUMPAD2) & 1)
  20.         {
  21.             BatchGrab = !BatchGrab;
  22.         }
  23.        
  24.         if (GetAsyncKeyState(VK_UP) & 1)
  25.         {
  26.             if (BatchGrab)
  27.             {
  28.                 ModelCountMin += 100;
  29.                 ModelCountMax += 100;
  30.             }
  31.  
  32.             else
  33.                 PrecisionModel++;
  34.         }
  35.  
  36.         if (GetAsyncKeyState(VK_DOWN) & 1)
  37.         {
  38.             if (BatchGrab)
  39.             {
  40.                 ModelCountMin -= 100;
  41.                 ModelCountMax -= 100;
  42.             }
  43.  
  44.             else
  45.                 PrecisionModel--;
  46.         }
  47.  
  48.         //Freeing the DLL
  49.         if (GetAsyncKeyState(VK_NUMPAD9) & 1)
  50.         {
  51.             HMODULE myModule = GetModuleHandleA("OpenGL Model Logger.dll");
  52.  
  53.             if (myModule)
  54.                 FreeLibraryAndExitThread(myModule, NULL);
  55.  
  56.             else
  57.                 continue;
  58.         }
  59.     }
  60.  
  61.     return NULL;
  62. }
  63.  
  64. //Our entry point
  65. BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, LPVOID reserved)
  66. {
  67.     switch (reason)
  68.     {
  69.     case DLL_PROCESS_ATTACH:
  70.         CreateThread(0, 0, Main, 0, 0, 0);
  71.         DisableThreadLibraryCalls(instance);
  72.         AllocConsole();
  73.         AttachConsole(GetProcessId(instance));
  74.         break;
  75.  
  76.     case DLL_THREAD_DETACH:
  77.         FreeConsole();
  78.         break;
  79.     }
  80.  
  81.     return TRUE;
  82. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement