fastman92

IPLsectionLimits::SetInstLimitPerFile

Feb 8th, 2015
238
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     // IPL: inst per file
  2.     void IPLsectionLimits::SetInstLimitPerFile(int iInstPerFile)
  3.     {
  4.         //CPatch::EnableDebugMode();
  5.  
  6.         if (CPatch::IsDebugModeActive())
  7.             iInstPerFile = 4096;
  8.         else if (iInstPerFile > 4096)
  9.             IPLentriesOfFile = new void*[iInstPerFile];
  10.  
  11.         IPLentriesPerFileLimit = iInstPerFile;
  12.  
  13.         // Patch addresses
  14.         CPatch::PatchPointer(0x5B51F0 + 3, IPLentriesOfFile);       // mov     eax, ds:__iplInst[edx*4]
  15.         CPatch::PatchPointer(0x5B51FF + 3, IPLentriesOfFile);       // mov     ecx, ds:__iplInst[ecx*4]
  16.         CPatch::PatchPointer(0x5B524B + 1, IPLentriesOfFile);       // push    offset __iplInst
  17.         CPatch::PatchPointer(0x5B5258 + 3, IPLentriesOfFile);       // mov     esi, ds:__iplInst[ebx*4]
  18.         CPatch::PatchPointer(0x5B531C + 1, IPLentriesOfFile);       // push    offset __iplInst
  19.         CPatch::PatchPointer(0x5B5340 + 3, IPLentriesOfFile);       // mov     edx, ds:__iplInst[esi*4]
  20.         CPatch::PatchPointer(0x5B8938 + 3, IPLentriesOfFile);       // mov     ds:__iplInst[ecx*4], eax
  21.         CPatch::PatchPointer(0x5B8A50 + 1, IPLentriesOfFile);       // mov     ecx, offset __iplInst
  22.         CPatch::PatchPointer(0x5B8A50 + 1, IPLentriesOfFile);       // mov     ecx, offset __iplInst
  23.         CPatch::PatchPointer(0x5B8A6F + 3, IPLentriesOfFile);       // lea     eax, __iplInst[edx*4]
  24.  
  25.         CPatch::DisableDebugMode();
  26.  
  27.         CGenericLogStorage::SaveFormattedTextLn("Modified limit of IPL: inst per file to: %d", iInstPerFile);
  28.         CGenericLogStorage::WriteLineSeparator();
  29.     }
RAW Paste Data