Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- nt CheckSn(const char* input)
- {
- //Encrypted key for RC4;
- int k[24] = {
- -2028,
- -1927,
- -1978,
- 2014,
- 1964,
- 2047,
- -2011,
- 2019,
- 1988,
- -2022,
- 2020,
- -2020,
- -2021,
- 1991,
- 1992,
- -1968,
- -2025,
- 2012,
- -1964,
- -1964,
- 1944,
- -2012,
- 1990,
- 1993,
- };
- char kbuff[24];
- for (int i = 0; i < sizeof(kbuff); i++)
- {
- kbuff[i] = (char)0x7c9 ^ k[i];
- }
- char* kDec = rc4.Decrypt(kbuff, input);
- //Genrate RSA seed
- int seed = 0; //RSA seed
- for (int i = 0; i < 24; i++)
- {
- seed ^= (int)kDec[i] << 8;
- }
- //Encrypted flag
- unsigned __int64 flEnc[38] = {
- 1366097814,
- 2120983132,
- 11313650,
- 11313650,
- 1147720706,
- 1381141506,
- 534044772,
- 2120983132,
- 11313650,
- 1000603513,
- 1147720706,
- 2141013828,
- 2120983132,
- 1381141506,
- 166339272,
- 397371820,
- 1381141506,
- 2141013828,
- 1424449630,
- 1381141506,
- 336182013,
- 1303618044,
- 584361135,
- 1381141506,
- 534044772,
- 1147720706,
- 336182013,
- 11313650,
- 1273651409,
- 1381141506,
- 1828599282,
- 1273651409,
- 1273651409,
- 1424449630,
- 303606192,
- 1732470655,
- 1925038450,
- };
- //RSA
- RSA_PARAM r;
- r = RsaGetParam(seed);
- char decoded[38];
- for (int i = 0; i < sizeof(decoded); i++)
- {
- decoded[i] = (char)(PowMod(flEnc[i], r.d, r.n));
- }
- char* flDec = (char*)decoded;
- if (Crc32(flDec, 38, 0x7c9) == -622969371)
- {
- strcpy(flagCorrect, flDec);
- return 1;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement