erni_hax

GateWay 3.0 Launcher Creator

Jan 18th, 2015
904
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #define _CRT_SECURE_NO_WARNINGS true
  2.  
  3. #include <cstdio>
  4. #include <memory>
  5.  
  6. void main(int argc, char *argv[]) {
  7.     if (argc < 2)
  8.         return;
  9.  
  10.     //Load ROP
  11.     FILE *IFile = fopen(argv[1], "rb+");
  12.     fseek(IFile, 0, SEEK_END);
  13.     int bSize = ftell(IFile) > 0x4000 ? 0x4000 : ftell(IFile); //Limit 0x4000 bytes size
  14.     fseek(IFile, 0, SEEK_SET);
  15.     int *buffer = (int*)malloc(0x4000);
  16.     fread(buffer, 1, bSize, IFile);
  17.     fclose(IFile);
  18.  
  19.     //Encrypt ROP
  20.     for (int state = 0xD5828281, i = 0; i < 0x4000 / 4; i++, state += 0xD5828281)
  21.         buffer[i] -= state;
  22.  
  23.     //Save ROP
  24.     IFile = fopen("Launcher.dat", "wb+");
  25.     fseek(IFile, 0x00012000, SEEK_SET); //4.X Users
  26.     fwrite(buffer, 1, 0x4000, IFile);
  27.     fseek(IFile, 0x0001A000, SEEK_SET); //5.X+ Users
  28.     fwrite(buffer, 1, 0x4000, IFile);
  29.     fclose(IFile);
  30.  
  31.     free(buffer);
  32. }
RAW Paste Data