Advertisement
Guest User

Untitled

a guest
Jul 20th, 2017
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.78 KB | None | 0 0
  1. int main() {
  2.     process = OpenProcess(PROCESS_ALL_ACCESS, 0, GetProcessInfoByName(TEXT("BlackOps3.exe")).th32ProcessID);
  3.     MODULEENTRY32 exe = GetModuleInfoByName(GetProcessId(process), L"BlackOps3.exe");
  4.  
  5.     for (;;) {
  6.         MEMORY_BASIC_INFORMATION mi = { 0 };
  7.         mi.BaseAddress = exe.modBaseAddr;
  8.  
  9.         for (long long i = 0;; i += mi.RegionSize) {
  10.             VirtualQueryEx(process, (void *)i, &mi, sizeof(mi));
  11.             if (i == (long long)mi.BaseAddress + mi.RegionSize) {
  12.                 break;
  13.             }
  14.  
  15.             if (mi.BaseAddress == 0 || mi.RegionSize < 1503000000 || !(mi.Protect & PAGE_READWRITE) || !(mi.State & (MEM_COMMIT | MEM_RESERVE))) {
  16.                 continue;
  17.             }
  18.  
  19.             char *buffer = (char *)malloc(mi.RegionSize);
  20.             if (buffer) {
  21.                 ReadProcessMemory(process, mi.BaseAddress, buffer, mi.RegionSize, NULL);
  22.                 int start = 0, end = 0;
  23.                 for (int i = (int)mi.RegionSize - sizeof(DWORD), c = 0; i > 0; --i) {
  24.                     if (*(DWORD *)&buffer[i] == 4294967295 && ++c == 2) {
  25.                         start = i + 44;
  26.                         end = start + ReadInt(process, exe.modBaseAddr + 0xE0A07F0) * 64;
  27.                            
  28.                         break;
  29.                     }
  30.                 }
  31.  
  32.                 if (start && end) {
  33.                     system("cls");
  34.                     printf("start: 0x%llx\n", (long long)mi.BaseAddress + start);
  35.                     printf("end: 0x%llx\n", (long long)mi.BaseAddress + end);
  36.  
  37.                     int light_count = 0;
  38.                     for (int i = 0; i < ReadInt(process, exe.modBaseAddr + 0xE0A07F0); ++i) {
  39.                         void *light = (void *)((long long)mi.BaseAddress + start + i * 64);
  40.                         printf("light %d: 0x%llx\n", ++light_count, (long long)light);
  41.  
  42.                         WriteInt(process, light, 0);
  43.                         WriteFloat(process, (void *)((long long)light + 4), 100);
  44.                         WriteFloat(process, (void *)((long long)light + 8), (i + 1) * 0.1f);
  45.                     }
  46.  
  47.                     free(buffer);
  48.                     goto next;
  49.                 }
  50.  
  51.                 free(buffer);
  52.             }
  53.         }
  54. next:
  55.         Sleep(1);
  56.     }
  57.  
  58.     return 0;
  59. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement