Advertisement
AbsoluteGamer

hotmilk

Dec 16th, 2017
12,110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <windows.h>
  2. #include <iostream>
  3.  
  4. typedef void*   (__cdecl *fSharedApplication)();
  5. typedef void    (__thiscall *fSetAnimationInterval)(void *instance, double delay);
  6. fSharedApplication sharedApplication;
  7. fSetAnimationInterval setAnimInterval;
  8. float interval = 0; //this is changed externally
  9.  
  10. DWORD WINAPI Main_Thread(LPVOID lpParam)
  11. {
  12.     interval = 1.0f / 60;
  13.  
  14.     HMODULE hMod = LoadLibrary(L"libcocos2d.dll");
  15.     sharedApplication = (fSharedApplication)GetProcAddress(hMod, "?sharedApplication@CCApplication@cocos2d@@SAPAV12@XZ");
  16.     setAnimInterval = (fSetAnimationInterval)GetProcAddress(hMod, "?setAnimationInterval@CCApplication@cocos2d@@UAEXN@Z");
  17.  
  18.     void *application = sharedApplication();
  19.  
  20.     while (1)
  21.     {
  22.         setAnimInterval(application, interval);
  23.         Sleep(500);
  24.     }
  25. }
  26.  
  27. BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpvReserved)
  28. {
  29.     if (fdwReason == DLL_PROCESS_ATTACH)
  30.         CreateThread(0, 0x1000, &Main_Thread, 0, 0, NULL);
  31.     return TRUE;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement