Advertisement
fastman92

GTA V ApplyFXTloader

Sep 15th, 2015
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.44 KB | None | 0 0
  1.     // Applies FXT loader
  2.     void ApplyFXTloader()
  3.     {
  4.         uintptr_t pReplayOutOfMemory = (uintptr_t)g_mScanner.FindString("REPLAY_OUT_OF_MEMORY");
  5.  
  6.         uintptr_t pCallToGetText = (uintptr_t)g_mScanner.FindWithFunction(
  7.             [](tMemoryScanControl& control, void* pCustomData)
  8.             {
  9.                 uintptr_t pReplayOutOfMemory = (uintptr_t)pCustomData;
  10.  
  11.                 const unsigned __int8* ptr = control.ptr;
  12.  
  13.                 if (ptr[0] == 0x48 && ptr[1] == 0x8D && ptr[2] == 0x15
  14.                     && ptr[7] == 0x48 && ptr[8] == 0x8D
  15.                     && ptr[14] == 0xE8
  16.                     )
  17.                 {
  18.                     uintptr_t RDX_target = (uintptr_t)ptr + 7 + *(DWORD*)(ptr + 3);
  19.                    
  20.                     return RDX_target == pReplayOutOfMemory;
  21.                 }
  22.  
  23.                 return false;
  24.             },
  25.  
  26.             7 + 7 + 5,
  27.  
  28.             (void*)pReplayOutOfMemory
  29.             );
  30.  
  31.         pCallToGetText += 15;   // call argument.
  32.  
  33.         uintptr_t pGetText = *(DWORD*)pCallToGetText + pCallToGetText + 4;     
  34.  
  35.         MH_CreateHook((void*)pGetText, &DetourCText__GetText, &fpCText__GetText);
  36.         MH_EnableHook((void*)pGetText);
  37.  
  38.         // printf_MessageBox("replay: 0x%llX", pGetText);
  39.  
  40.         /////////////////////////////
  41.  
  42.         CLimitAdjusterForGame* pLimitAdjusterForGame = (CLimitAdjusterForGame*)pLimitAdjuster;
  43.  
  44.         pLimitAdjusterForGame->m_FXTloader.SetMaxKeyLength(8);
  45.         pLimitAdjusterForGame->m_FXTloader.LoadFXTfiles("FXT");
  46.  
  47.         CGenericLogStorage::SaveTextLn("FXT loader is enabled.");
  48.         CGenericLogStorage::WriteLineSeparator();
  49.  
  50.         // pLimitAdjuster->TerminateProcess();
  51.         //  FXTloader::LoadFXTfiles("GTA5_FXT");
  52.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement