Advertisement
Guest User

LEGO Games v2

a guest
Oct 31st, 2015
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.44 KB | None | 0 0
  1. "
  2. Security:
  3. -> Custom Checksum
  4.   -> Offset: 12
  5.   -> Calculation Start: 16
  6.   -> Calculation Length: Size - 16
  7.  
  8. Additional:
  9. LEGO Hobbit and newer use the same checksum, but store it at 16 and the calculation start is 20.
  10. "
  11.  
  12. private int CalculateChecksum(byte[] data, int offset, int size) {
  13.     int sum = -1;
  14.  
  15.     for (int i = 0; i < size; ++i) {
  16.         sum *= 0x1000193;
  17.         sum ^= data[offset++];
  18.     }
  19.  
  20.     return ~sum;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement