Advertisement
Guest User

Metal Gear Solid V: The Phantom Pain

a guest
Oct 31st, 2015
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.89 KB | None | 0 0
  1. "
  2. Security:
  3. -> Custom Encryption
  4. -> MD5
  5.  -> Offset: 0
  6.  -> Calculation Start: 16
  7.  -> Calculation Length: Size - 16
  8.  
  9. Additional:
  10. The same function is used to de/encrypt the save.
  11. MD5 hash is stored at the beginning of the decrypted data.
  12.  
  13. Each data (Personal, Config, Game) has it's own encryption salt.
  14. "
  15.  
  16. public enum Salts : uint {
  17.     Config   = 0x625CCB25,
  18.     Game     = 0xF30045E5,
  19.     Personal = 0x46F8A180
  20. }
  21.  
  22. private byte[] EncData(byte[] source) {
  23.     uint next = Salts.Game;
  24.     using (var src = new MasterIO(source)) {
  25.         using (var res = new MasterIO()) {
  26.             for (int i = 0; i < source.Length >> 2; ++i) {
  27.                 next ^= (next << 13);
  28.                 next ^= (next >> 7);
  29.                 next ^= (next << 5);
  30.                 res.Writer.WriteUInt32(src.Reader.ReadUInt32() ^ next);
  31.             }
  32.             return res.Buffer;
  33.         }
  34.     }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement