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 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176
| #include <iostream> #include <windows.h> #include <algorithm> #include "aes.h"
static inline uint32_t f_inside(uint32_t z, uint32_t y, uint32_t sum, int p, const uint32_t* k) { uint32_t e = (sum >> 2) & 0xFFu; uint32_t t1 = ((z >> 3) ^ (y << 6)); uint32_t t2 = ((y >> 4) ^ (z * 32u)); uint32_t t3 = ((sum ^ y) + ((k[((p ^ e) & 3)] ^ z))); return (t1 + t2) ^ t3; }
static inline uint32_t g_last(uint32_t z, uint32_t y0, uint32_t sum, int p, const uint32_t* k) { uint32_t e = (sum >> 2) & 0xFFu; uint32_t t1 = ((z >> 4) ^ (y0 * 8u)); uint32_t t2 = ((y0 >> 6) ^ (z * 4u)); uint32_t t3 = ((sum ^ y0) + ((k[((p ^ e) & 3)] ^ z))); return (t1 + t2) ^ t3; }
static void dec_round(uint32_t* v_new, uint32_t sum, const uint32_t* k) { const int n = 8; uint32_t v_old[8];
v_old[7] = v_new[7] - g_last(v_new[6], v_new[0], sum, n - 1, k);
for (int p = n - 2; p >= 1; --p) { v_old[p] = v_new[p] - f_inside(v_new[p - 1], v_old[p + 1], sum, p, k); }
v_old[0] = v_new[0] - f_inside(v_old[7], v_old[1], sum, 0, k);
std::memcpy(v_new, v_old, sizeof(v_old)); }
void decrypt(uint8_t* input) { const unsigned char key_bytes[16] = { 0xA4, 0x60, 0x78, 0x7B, 0x02, 0x54, 0xEB, 0x54, 0x35, 0x9E, 0x7F, 0xFF, 0x27, 0xCA, 0x47, 0xBF, }; uint32_t k[4]; std::memcpy(k, key_bytes, 16); const uint32_t Delta = 0x3CD46429; uint32_t v[8]; std::memcpy(v, input, 32); uint32_t rounds = 46; uint32_t sum = Delta * rounds; for (uint32_t r = 0; r < rounds; ++r) { dec_round(v, sum, k); sum -= Delta; } memcpy(input, v, 32); }
unsigned char aes_key[176] = { 0xCF, 0x95, 0x5E, 0x20, 0x94, 0x15, 0x34, 0x64, 0x9A, 0x54, 0x53, 0xE9, 0x2F, 0x51, 0x33, 0x41, 0x2D, 0x48, 0x7C, 0xF5, 0x37, 0xAB, 0x09, 0x32, 0xB5, 0xFF, 0x4B, 0x7B, 0x53, 0xD5, 0x0F, 0x47, 0xBF, 0xFA, 0x79, 0x81, 0x11, 0x2A, 0x0E, 0x76, 0x94, 0xBA, 0xA8, 0xA1, 0xF8, 0xED, 0xF4, 0xDC, 0x4F, 0x85, 0x9C, 0x47, 0xCB, 0xF5, 0x52, 0x26, 0xEB, 0xE9, 0x5F, 0xF0, 0x62, 0x80, 0x75, 0x85, 0x0E, 0x2F, 0x02, 0x74, 0xB8, 0x5B, 0x0A, 0x4A, 0x6A, 0x56, 0xAA, 0x57, 0x01, 0xDA, 0xFB, 0x5A, 0x18, 0x7D, 0x49, 0x65, 0x14, 0xC4, 0x68, 0xE5, 0xCF, 0x52, 0x58, 0x56, 0xD9, 0x11, 0x74, 0x81, 0x4A, 0x2E, 0xA5, 0x54, 0xCB, 0x5D, 0xB9, 0x36, 0x80, 0xE1, 0x3C, 0x0C, 0x2B, 0x1E, 0x09, 0xB1, 0x8A, 0x0B, 0xA2, 0x65, 0x28, 0xCA, 0x63, 0x6A, 0x15, 0x65, 0xEB, 0xCC, 0xC7, 0x6F, 0x5C, 0xAF, 0x19, 0x43, 0x65, 0x8B, 0x26, 0x31, 0xC0, 0x3C, 0x66, 0x8A, 0x65, 0x1E, 0x34, 0xBC, 0x27, 0x36, 0x1E, 0x01, 0xC7, 0xC8, 0x07, 0x06, 0xE0, 0x9E, 0x2C, 0x91, 0xB0, 0x10, 0x03, 0xA5, 0xF2, 0xC4, 0x1A, 0xEC, 0xFB, 0x19, 0xA3, 0x5D, 0x63, 0xF0, 0xF1, 0x99, 0x7A, 0x1C, 0x5E, 0x87, 0x11, 0x1B };
int main() { uint8_t input[]{ 18, 104, 119, 159, 83, 111, 185, 223, 152, 168, 8, 71, 28, 98, 187, 134, 159, 126, 60, 1, 116, 184, 130, 175, 199, 219, 240, 235, 229, 20, 87, 30 };
std::reverse(input, input + 32);
uint8_t xorkey28[]{ 0x4D,0x00,0x00,0x65,0x88,0x59,0x48,0x48,0x00,0x00,0x4B,0x9B,0x66,0x00,0xCC,0xD2,0x1B,0x00,0xBD,0x00,0x61,0x00,0x00,0x63,0x00,0x00,0x94,0x00,0x39,0x3C,0x00,0xCB }; for (int i = 0; i < 32; i++) { input[i] ^= xorkey28[i]; }
uint8_t xorkey26[]{ 0xed,0xed,0x00,0x34,0x83,0x7e,0xef,0x15,0x1d,0x83,0xab,0x98,0xc8,0x74,0xdf,0x34,0x0f,0x36,0xd2,0x7b,0xe3,0xcd,0xc4,0xb6,0x37,0x4e,0x98,0x6c,0xc4,0x0e,0x01,0x5c }; decrypt(input); for (int i = 0; i < 32; i++) input[i] ^= xorkey26[i];
uint8_t xorkey25[]{ 0xc5,0x22,0x4e,0x80,0xbe,0x4e,0xe0,0xe2,0x9e,0x2c,0xc5,0x9c,0xcd,0x42,0x7f,0x65,0xb4,0xd4,0xaa,0xb4,0x15,0xe5,0x00,0xf8,0x55,0x5e,0xa2,0xf8,0x44,0x5c,0x20,0xa7 }; decrypt(input); for (int i = 0; i < 32; i++) input[i] ^= xorkey25[i];
uint8_t xorkey24[]{ 0xa2,0x00,0xef,0xd2,0x56,0x00,0x14,0x00,0x49,0x59,0x35,0xd4,0x82,0x00,0xbf,0x1b,0x27,0xaa,0xd8,0x84,0x86,0x8a,0x00,0xf5,0x1c,0x00,0x00,0x2d,0xbf,0x00,0x8f,0xfc }; decrypt(input); for (int i = 0; i < 32; i++) input[i] ^= xorkey24[i];
uint8_t xorkey23[]{ 0x16,0x00,0x2f,0x00,0x04,0xd5,0x5b,0x00,0x00,0x58,0xd0,0xb0,0xd1,0x00,0x1d,0x39,0xb9,0xa2,0x8d,0x00,0xc5,0x00,0x00,0x70,0x93,0x95,0x00,0x55,0x6b,0x00,0x00,0x00 }; decrypt(input); for (int i = 0; i < 32; i++) input[i] ^= xorkey23[i];
uint8_t xorkey22[]{ 0x07,0x9f,0x6e,0x23,0x1e,0x88,0x00,0x00,0xe2,0x99,0x49,0x3f,0x34,0x5e,0x85,0xc9,0xb5,0x06,0x8c,0x4c,0x13,0x4e,0x2f,0x00,0xe1,0xdb,0x47,0xfa,0xba,0x91,0x4c,0xe7 }; decrypt(input); for (int i = 0; i < 32; i++) input[i] ^= xorkey22[i];
uint8_t xorkey21[]{ 0x5f,0x68,0xf7,0x00,0x1e,0xba,0x00,0x83,0x00,0xad,0x54,0xd0,0x91,0x00,0x79,0xb5,0xd8,0x96,0xed,0x67,0x99,0x6a,0xe0,0x6c,0xad,0xdb,0x5a,0x90,0xea,0xa4,0x6d,0xab }; decrypt(input); for (int i = 0; i < 32; i++) input[i] ^= xorkey21[i];
uint8_t xorkey20[]{ 0xae,0x30,0x50,0x8e,0x8e,0x9e,0x35,0x41,0x7b,0x96,0x56,0x1e,0xe7,0xcc,0xa3,0xf7,0x10,0x59,0xa5,0x62,0xb5,0x57,0xea,0xbc,0x34,0xb7,0xd6,0x0e,0x3a,0x27,0x18,0xb3 }; decrypt(input); for (int i = 0; i < 32; i++) input[i] ^= xorkey20[i];
uint8_t xorkey19[]{ 0xaa,0xce,0x0d,0xe0,0xd2,0xfb,0xd2,0x12,0xb1,0x11,0xad,0x65,0x0c,0x45,0xf2,0xe0,0x4a,0x1a,0xed,0x47,0x14,0x44,0x59,0xe9,0x61,0xfa,0x09,0xaf,0xa5,0xb0,0x15,0x15 }; decrypt(input); for (int i = 0; i < 32; i++) input[i] ^= xorkey19[i];
uint8_t xorkey18[]{ 0x2a,0x1a,0x00,0x18,0x8a,0x00,0x36,0x00,0x3d,0x86,0x16,0x9e,0x00,0x00,0x48,0x00,0x92,0xa3,0x00,0x00,0x00,0xb9,0x6b,0x1f,0x41,0xa9,0x00,0xb9,0xa9,0x2b,0x00,0x00 }; aes_decrypt_128(aes_key, input, input); aes_decrypt_128(aes_key, input + 16, input + 16); for (int i = 0; i < 32; i++) input[i] ^= xorkey18[i];
uint8_t xorkey17[]{ 0xd3,0xe6,0xcb,0x3a,0x00,0x8b,0x25,0x00,0x75,0xb7,0x24,0x12,0x4b,0xc4,0xbe,0x4e,0x4e,0x7e,0xb7,0xeb,0x02,0xeb,0x2b,0x23,0xac,0x1c,0xf9,0x9f,0x7d,0xbf,0xf9,0xf0 }; aes_decrypt_128(aes_key, input, input); aes_decrypt_128(aes_key, input + 16, input + 16); for (int i = 0; i < 32; i++) input[i] ^= xorkey17[i];
uint8_t xorkey16[]{ 0xe9,0x11,0xf0,0x24,0xa1,0x34,0x3a,0xb1,0x1d,0x27,0xda,0xd0,0xe7,0x1f,0x5b,0xbc,0x08,0xde,0xf5,0xab,0x1b,0xca,0x83,0xd7,0xf9,0x52,0xe5,0x3c,0xa0,0xc9,0x0a,0x1a }; decrypt(input); for (int i = 0; i < 32; i++) input[i] ^= xorkey16[i];
uint8_t xorkey15[]{ 0x00,0xd1,0x57,0x00,0x2b,0xf1,0x5e,0xea,0xa4,0x79,0x00,0x2c,0xd8,0x88,0x7c,0x00,0x5a,0x1d,0x00,0xfe,0x00,0xf1,0xbf,0x05,0x55,0xe6,0x82,0x00,0x11,0x00,0xe1,0x00 }; aes_decrypt_128(aes_key, input, input); aes_decrypt_128(aes_key, input + 16, input + 16); for (int i = 0; i < 32; i++) input[i] ^= xorkey15[i];
uint8_t xorkey14[]{ 0x75,0x9a,0x74,0x00,0x7a,0x69,0xae,0xed,0x00,0x00,0x00,0x00,0x3a,0x00,0x24,0xaf,0xa3,0x33,0x00,0x00,0x00,0x01,0x44,0x21,0x00,0xdc,0x23,0x00,0x27,0x0e,0x61,0x8a }; decrypt(input); for (int i = 0; i < 32; i++) input[i] ^= xorkey14[i];
uint8_t xorkey13[]{ 0x27,0xa1,0xed,0xb3,0x45,0xd5,0x5a,0x87,0x6c,0x0d,0x35,0x76,0x29,0x18,0xb1,0x9c,0x5c,0xe2,0x59,0x08,0xe7,0xe6,0x55,0xce,0x7c,0x6f,0x3c,0x5d,0xee,0xa0,0x73,0x11 }; aes_decrypt_128(aes_key, input, input); aes_decrypt_128(aes_key, input + 16, input + 16); for (int i = 0; i < 32; i++) input[i] ^= xorkey13[i];
uint8_t xorkey12[]{ 0x00,0x40,0x7f,0xc6,0xd5,0x79,0xa4,0xfb,0xfe,0xa6,0x00,0x32,0xb9,0x6e,0x4f,0xf1,0x62,0xa3,0x00,0x47,0x37,0x4d,0xfd,0x00,0xbe,0x55,0xe2,0x00,0xbe,0x3f,0x00,0xb2 }; decrypt(input); for (int i = 0; i < 32; i++) input[i] ^= xorkey12[i];
uint8_t xorkey11[]{ 0x68,0xf3,0x4a,0xc2,0x00,0x2b,0x8d,0x39,0x64,0x00,0x75,0x00,0xe6,0x32,0xc2,0xb4,0xc4,0x00,0x57,0x3c,0x87,0x00,0x75,0x00,0x94,0x68,0x1c,0x12,0x07,0x00,0xdb,0x09 }; aes_decrypt_128(aes_key, input, input); aes_decrypt_128(aes_key, input + 16, input + 16); for (int i = 0; i < 32; i++) input[i] ^= xorkey11[i];
uint8_t xorkey10[]{ 0x1b,0x2f,0x4f,0x5e,0x44,0x18,0x2f,0xe1,0x5b,0x36,0x3f,0x32,0xf6,0xf0,0x6b,0xf9,0x97,0xc9,0x58,0x61,0x0f,0xf4,0xa9,0xb4,0xb0,0xa3,0x15,0x72,0xa4,0xe9,0x58,0x39 }; aes_decrypt_128(aes_key, input, input); aes_decrypt_128(aes_key, input + 16, input + 16); for (int i = 0; i < 32; i++) input[i] ^= xorkey10[i];
uint8_t xorkey9[]{ 0xb6,0x79,0xcd,0x35,0xa6,0x21,0x21,0x0c,0x88,0x61,0xe7,0xe5,0x6d,0xc9,0x55,0x49,0xa4,0x54,0x85,0x43,0x98,0x8e,0x68,0x3f,0xdd,0x57,0xa5,0xf1,0xbd,0xc8,0x81,0x85 }; decrypt(input); for (int i = 0; i < 32; i++) input[i] ^= xorkey9[i];
uint8_t xorkey8[]{ 0x0c,0x1d,0x7d,0xd2,0xef,0x8e,0xb5,0x48,0x3b,0x00,0xfe,0xfa,0xf9,0x54,0xc6,0x45,0xed,0x67,0x00,0x12,0x3f,0x9e,0x96,0x48,0x2f,0x9f,0x91,0x0f,0x86,0x6d,0x40,0xc6 }; decrypt(input); for (int i = 0; i < 32; i++) input[i] ^= xorkey8[i];
uint8_t xorkey7[]{ 0xdd,0xf6,0x83,0x62,0x12,0x66,0x7d,0xca,0x2e,0xca,0x13,0x93,0xa7,0x3e,0x55,0xab,0x23,0x7f,0xe2,0x92,0xe6,0x78,0xb7,0xbb,0x3d,0xe9,0x7f,0x44,0x35,0x6e,0x89,0xc2 }; aes_decrypt_128(aes_key, input, input); aes_decrypt_128(aes_key, input + 16, input + 16); for (int i = 0; i < 32; i++) input[i] ^= xorkey7[i];
uint8_t xorkey6[]{ 0xa0,0x90,0xf8,0x5f,0x29,0x1c,0x5b,0xb8,0x7c,0xad,0x04,0x6b,0xe7,0xfa,0xba,0x82,0xe7,0x48,0x38,0xb0,0x1f,0xce,0xe7,0xc8,0x8d,0x1d,0xfb,0x21,0x8c,0x5d,0x87,0xa6 }; decrypt(input); for (int i = 0; i < 32; i++) input[i] ^= xorkey6[i];
uint8_t xorkey5[]{ 0x35,0xfb,0x03,0x2b,0x9e,0x9c,0x1a,0x27,0x6f,0x5a,0x5d,0x24,0x0b,0x26,0xac,0x83,0x67,0x60,0xaf,0x19,0x00,0xf8,0x00,0xe0,0xf2,0xc0,0xa7,0xde,0x22,0xa9,0x53,0xa1 }; aes_decrypt_128(aes_key, input, input); aes_decrypt_128(aes_key, input + 16, input + 16); for (int i = 0; i < 32; i++) input[i] ^= xorkey5[i];
uint8_t xorkey4[]{ 0x00,0x8c,0xcd,0x2e,0x90,0xb8,0x00,0x8a,0x62,0xd3,0x00,0xbf,0xcd,0x32,0x43,0xfe,0xed,0xb6,0xb2,0xcc,0xf1,0xc3,0x00,0x5c,0xa2,0xa0,0x00,0xa5,0x2d,0xc4,0x3e,0x64 }; decrypt(input); for (int i = 0; i < 32; i++) input[i] ^= xorkey4[i];
uint8_t xorkey3[]{ 0xe9,0x81,0x88,0xfc,0x58,0xd1,0x1b,0xe9,0x21,0x24,0x64,0x04,0x29,0x6f,0x27,0xaf,0x7d,0x4a,0xad,0xd6,0x81,0x11,0xfa,0x00,0xe5,0x6e,0x00,0xc8,0xa5,0x7c,0x82,0xf2 }; decrypt(input); for (int i = 0; i < 32; i++) input[i] ^= xorkey3[i];
uint8_t xorkey2[]{ 0x00,0x00,0xb0,0xcf,0x4c,0xed,0x0e,0xc1,0x60,0x00,0xf2,0xf8,0x00,0x3a,0x35,0xf2,0x00,0x00,0x61,0xdc,0xa1,0x48,0xe8,0xde,0x00,0x53,0x00,0xf8,0x00,0x90,0xa3,0x4d }; decrypt(input); for (int i = 0; i < 32; i++) input[i] ^= xorkey2[i];
uint8_t xorkey1[]{ 0x0c,0xa2,0xd9,0xf7,0x95,0x66,0xa9,0x0b,0x35,0xe9,0x20,0x09,0x08,0xda,0x39,0xff,0x9f,0x73,0xc8,0xa7,0x07,0x97,0x55,0xd9,0x9c,0xb3,0x76,0x88,0x7d,0x33,0xa7,0x0c }; decrypt(input); for (int i = 0; i < 32; i++) input[i] ^= xorkey1[i];
std::reverse(input, input + 32);
printf("%.32s\n", input);
return 0; }
|