Need a unique gift idea?
A Pastebin account makes a great Christmas gift
SHARE
TWEET

hotmilk

AbsoluteGamer Dec 16th, 2017 (edited) 8,498 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
 
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top