1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
|
#include <stdio.h> #include <windows.h> void Decrypt(UINT32 *v, UINT32 *k) { unsigned long n = 32, sum, y = v[0], z = v[1]; unsigned long delta = 0x79B99E37; sum = delta << 5; while (n-- > 0) { z += ((y << 4) + k[2]) ^ (y + sum) ^ ((y >> 5) + k[3]); y += ((z << 4) + k[0]) ^ (z + sum) ^ ((z >> 5) + k[1]); sum -= delta; } v[0] = y; v[1] = z; } int main() { UINT32 key[4] = {0x0BABEC0FE, 0x0DEADBEEF, 0x0FACEB00C, 0xDEADC0DE}; UINT32 enc[21] = {1544910156, 3520561639, 1344008563, 3410866722, 559768053, 1070243559, 2088154567, 3353185465, 2567775226, 195762899, 2383595826, 3540499186, 3844985123, 4223045420, 3185071075, 2301501006, 970811130, 2281630821, 813456992, 873229312, 0}; Decrypt(enc, key); Decrypt(enc + 2, key); Decrypt(enc + 4, key); Decrypt(enc + 6, key); Decrypt(enc + 8, key); Decrypt(enc + 10, key); Decrypt(enc + 12, key); Decrypt(enc + 14, key); Decrypt(enc + 16, key); Decrypt(enc + 18, key); Decrypt(enc + 20, key); for (int i = 0; i < 20 * 4; i++) { printf("%02x", ((char *)enc)[i]); } }
|