MassExplosion

[3DS] GW Decrypter

Jan 23rd, 2016
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. #define _CRT_SECURE_NO_WARNINGS true
  2.  
  3. #include <cstdio>
  4. #include <memory>
  5.  
  6. void main() {
  7. //Load ROP
  8. FILE *IFile = fopen("Launcher.dat", "rb+");
  9. fseek(IFile, 0, SEEK_END);
  10. int bSize = ftell(IFile) > 0x4000 ? 0x4000 : ftell(IFile); //Limit 0x4000 bytes size
  11. fseek(IFile, 0, SEEK_SET);
  12. int *buffer = (int*)malloc(0x4000);
  13. fread(buffer, 1, bSize, IFile);
  14. fclose(IFile);
  15.  
  16. //Encrypt ROP
  17. for (int state = 0xD5828281, i = 0; i < 0x4000 / 4; i++, state += 0xD5828281)
  18. buffer[i] += state;
  19.  
  20. //Save ROP
  21. IFile = fopen("decLauncher.dat", "wb+");
  22. fseek(IFile, 0x00012000, SEEK_SET); //4.X Users
  23. fwrite(buffer, 1, 0x4000, IFile);
  24. fseek(IFile, 0x0001A000, SEEK_SET); //5.X+ Users
  25. fwrite(buffer, 1, 0x4000, IFile);
  26. fclose(IFile);
  27.  
  28. free(buffer);
  29. }
Advertisement
Add Comment
Please, Sign In to add comment