Исходник San Andreas Cheat Code

imring

чо тут
Администратор
Lampo Team
написал простую консольную программу, которая генерирует чит-коды для GTA:SA.
скрин:
1564326411005.png
код:
C++:
#include <iostream>
#include <Windows.h>

using namespace std;

UINT keyTable[] = {
    0x0, 77073096, 0x0EE0E612C, 0x990951BA, 0x76DC419, 0x706AF48F,
    0x0E963A535, 0x9E6495A3, 0x0EDB8832, 0x79DCB8A4, 0x0E0D5E91E,
    0x97D2D988, 0x9B64C2B, 0x7EB17CBD, 0x0E7B82D07, 0x90BF1D91,
    0x1DB71064, 0x6AB020F2, 0x0F3B97148, 0x84BE41DE, 0x1ADAD47D,
    0x6DDDE4EB, 0x0F4D4B551, 0x83D385C7, 0x136C9856, 0x646BA8C0,
    0x0FD62F97A, 0x8A65C9EC, 0x14015C4F, 0x63066CD9, 0x0FA0F3D63,
    0x8D080DF5, 0x3B6E20C8, 0x4C69105E, 0x0D56041E4, 0x0A2677172,
    0x3C03E4D1, 0x4B04D447, 0x0D20D85FD, 0x0A50AB56B, 0x35B5A8FA,
    0x42B2986C, 0x0DBBBC9D6, 0x0ACBCF940, 0x32D86CE3, 0x45DF5C75,
    0x0DCD60DCF, 0x0ABD13D59, 0x26D930AC, 0x51DE003A, 0x0C8D75180,
    0x0BFD06116, 0x21B4F4B5, 0x56B3C423, 0x0CFBA9599, 0x0B8BDA50F,
    0x2802B89E, 0x5F058808, 0x0C60CD9B2, 0x0B10BE924, 0x2F6F7C87,
    0x58684C11, 0x0C1611DAB, 0x0B6662D3D, 0x76DC4190, 0x1DB7106,
    0x98D220BC, 0x0EFD5102A, 0x71B18589, 0x6B6B51F, 0x9FBFE4A5,
    0x0E8B8D433, 0x7807C9A2, 0x0F00F934, 0x9609A88E, 0x0E10E9818,
    0x7F6A0DBB, 0x86D3D2D, 0x91646C97, 0x0E6635C01, 0x6B6B51F4,
    0x1C6C6162, 0x856530D8, 0x0F262004E, 0x6C0695ED, 0x1B01A57B,
    0x8208F4C1, 0x0F50FC457, 0x65B0D9C6, 0x12B7E950, 0x8BBEB8EA,
    0x0FCB9887C, 0x62DD1DDF, 0x15DA2D49, 0x8CD37CF3, 0x0FBD44C65,
    0x4DB26158, 0x3AB551CE, 0x0A3BC0074, 0x0D4BB30E2, 0x4ADFA541,
    0x3DD895D7, 0x0A4D1C46D, 0x0D3D6F4FB, 0x4369E96A, 0x346ED9FC,
    0x0AD678846, 0x0DA60B8D0, 0x44042D73, 0x33031DE5, 0x0AA0A4C5F,
    0x0DD0D7CC9, 0x5005713C, 0x270241AA, 0x0BE0B1010, 0x0C90C2086,
    0x5768B525, 0x206F85B3, 0x0B966D409, 0x0CE61E49F, 0x5EDEF90E,
    0x29D9C998, 0x0B0D09822, 0x0C7D7A8B4, 0x59B33D17, 0x2EB40D81,
    0x0B7BD5C3B, 0x0C0BA6CAD, 0x0EDB88320, 0x9ABFB3B6, 0x3B6E20C,
    0x74B1D29A, 0x0EAD54739, 0x9DD277AF, 0x4DB2615, 0x73DC1683,
    0x0E3630B12, 0x94643B84, 0x0D6D6A3E, 0x7A6A5AA8, 0x0E40ECF0B,
    0x9309FF9D, 0x0A00AE27, 0x7D079EB1, 0x0F00F9344, 0x8708A3D2,
    0x1E01F268, 0x6906C2FE, 0x0F762575D, 0x806567CB, 0x196C3671,
    0x6E6B06E7, 0x0FED41B76, 0x89D32BE0, 0x10DA7A5A, 0x67DD4ACC,
    0x0F9B9DF6F, 0x8EBEEFF9, 0x17B7BE43, 0x60B08ED5, 0x0D6D6A3E8,
    0x0A1D1937E, 0x38D8C2C4, 0x4FDFF252, 0x0D1BB67F1, 0x0A6BC5767,
    0x3FB506DD, 0x48B2364B, 0x0D80D2BDA, 0x0AF0A1B4C, 0x36034AF6,
    0x41047A60, 0x0DF60EFC3, 0x0A867DF55, 0x316E8EEF, 0x4669BE79,
    0x0CB61B38C, 0x0BC66831A, 0x256FD2A0, 0x5268E236, 0x0CC0C7795,
    0x0BB0B4703, 0x220216B9, 0x5505262F, 0x0C5BA3BBE, 0x0B2BD0B28,
    0x2BB45A92, 0x5CB36A04, 0x0C2D7FFA7, 0x0B5D0CF31, 0x2CD99E8B,
    0x5BDEAE1D, 0x9B64C2B0, 0x0EC63F226, 0x756AA39C, 0x26D930A,
    0x9C0906A9, 0x0EB0E363F, 0x72076785, 0x5005713, 0x95BF4A82,
    0x0E2B87A14, 0x7BB12BAE, 0x0CB61B38, 0x92D28E9B, 0x0E5D5BE0D,
    0x7CDCEFB7, 0x0BDBDF21, 0x86D3D2D4, 0x0F1D4E242, 0x68DDB3F8,
    0x1FDA836E, 0x81BE16CD, 0x0F6B9265B, 0x6FB077E1, 0x18B74777,
    0x88085AE6, 0x0FF0F6A70, 0x66063BCA, 0x11010B5C, 0x8F659EFF,
    0x0F862AE69, 0x616BFFD3, 0x166CCF45, 0x0A00AE278, 0x0D70DD2EE,
    0x4E048354, 0x3903B3C2, 0x0A7672661, 0x0D06016F7, 0x4969474D,
    0x3E6E77DB, 0x0AED16A4A, 0x0D9D65ADC, 0x40DF0B66, 0x37D83BF0,
    0x0A9BCAE53, 0x0DEBB9EC5, 0x47B2CF7F, 0x30B5FFE9, 0x0BDBDF21C,
    0x0CABAC28A, 0x53B39330, 0x24B4A3A6, 0x0BAD03605, 0x0CDD70693,
    0x54DE5729, 0x23D967BF, 0x0B3667A2E, 0x0C4614AB8, 0x5D681B02,
    0x2A6F2B94, 0x0B40BBE37, 0x0C30C8EA1, 0x5A05DF1B, 0x2D02EF8D,
};

UINT hashKeys[] = {
    0x0DE4B237D, 0x0B22A28D1, 0x5A783FAE, 0x0EECCEA2B, 0x42AF1E28,
    0x555FC201, 0x2A845345, 0x0E1EF01EA, 0x771B83FC, 0x5BF12848,
    0x44453A17, 0x0FCFF1D08, 0x0B69E8532, 0x8B828076, 0x0DD6ED9E9,
    0x0A290FD8C, 0x3484B5A7, 0x43DB914E, 0x0DBC0DD65, 0x0, 0x0D08A30FE,
    0x37BF1B4E, 0x0B5D40866, 0x0E63B0D99, 0x675B8945, 0x4987D5EE,
    0x2E8F84E8, 0x1A9AA3D6, 0x0E842F3BC, 0x0D5C6A4E, 0x74D4FCB1,
    0x0B01D13B8, 0x66516EBC, 0x4B137E45, 0x0, 78520E33, 0x3A577325,
    0x0D4966D59, 0x5FD1B49D, 0x0A7613F99, 0x1792D871, 0x0CBC579DF,
    0x4FEDCCFF, 0x44B34866, 0x2EF877DB, 0x2781E797, 0x2BC1A045,
    0x0B2AFE368, 0x0FA8DD45B, 0x8DED75BD, 0x1A5526BC, 0x0A48A770B,
    0x0B07D3B32, 0x80C1E54B, 0x5DAD0087, 0x7F80B950, 0x6C0FA650,
    0x0F46F2FA4, 0x70164385, 0x0, 0x885D0B50, 0x151BDCB3, 0x0ADFA640A,
    0x0E57F96CE, 0x40CF761, 0x0E1B33EB9, 0x0FEDA77F7, 0x8CA870DD,
    0x9A629401, 0x0F53EF5A5, 0x0F2AA0C1D, 0x0F36345A8, 0x8990D5E1,
    0x0B7013B1B, 0x0CAEC94EE, 0x31F0C3CC, 0x0B3B3E72A, 0x0C25CDBFF,
    0x0D5CF4EFF, 0x680416B1, 0x0CF5FDA18, 0x0F01286E9, 0x0A841CC0A,
    0x31EA09CF, 0x0E958788A, 0x2C83A7C, 0x0E49C3ED4, 0x171BA8CC,
    0x86988DAE, 0x2BDD2FA1, 0x0, 0x0
};

LPCSTR descriptionCheats[] = {
    "Пак оружий 1", "Пак оружий 2", "Пак оружий 3", "250.000$ + Здоровье + Броня",
    "Повысить уровень розыска", "Понизить уровень розыска", "Солнечная погода", "Очень солнечная погода",
    "Облачная погода", "Дождливая погода", "Туманная погода", NULL, "Быстрое время",
    "Медленное время", "Mayhem Cheat", "Все атакуют игрока", NULL, "Rhino", "Bloodring Banger",
    "Rancher Lure", "Hotring Racer A", "Hotring Racer B", "Romero", "Stretch", "Trashmaster",
    "Caddy", "Взорвать автомобили", NULL, NULL, "Суицид", NULL, NULL, "Все машины розового цвета",
    "Все машины чёрного цвета", NULL, NULL, "Толстый CJ", "Сильный CJ", "Тощий CJ", "Все прохожие одеты как Элвис",
    "Сельские жители", "Пляжная вечеринка", "Банды", "Преступный мир", "Ниндзя", "Любовь побеждает все",
    "Все машины дерьмо", "Все машины великолепны", NULL, NULL, "Hydra", "Vortex", NULL, NULL, NULL,
    "Полночь", "Сумерки", "Гроза", "Песчаная буря", "Predator", NULL, NULL, NULL, "Парашют",
    "Джетпак", "Без розыска", "Максимальный розыск", NULL, NULL, "Riot Cheat", "Funhouse Theme",
    "Адреналин", NULL, "Driveby Cheat", NULL, "Вторжение в сельскую местность", NULL, NULL, NULL,
    NULL, NULL, "Чит на выносливость", "Максимальный навык оружий", "Максимальный навык машин",
    "Hunter", "Quad", "Tanker Cheat", "Dozer", "Stuntplane", "Monster A", NULL, NULL
};

UINT GetKey(char* keys) {
    UINT result;

    BYTE start = *keys;
    for (result = -1; start; ++keys) {
        result = keyTable[(BYTE)(result ^ start)] ^ ((UINT)result >> 8);
        start = keys[1];
    }
    return result;
}

void upper(char*str) {
    int i = 0;
    char c;
    while (str[i]) {
        c = str[i];
        str[i] = toupper(c);
        i++;
    }
}

void reverse(char s[]) {
    int c, i, j;
    for (i = 0, j = strlen(s) - 1; i < j; i++, j--) {
        c = s[i];
        s[i] = s[j];
        s[j] = c;
    }
}

void push_back(char s[], int size) {
    do {
        --size;
        s[size + 2] = s[size + 1];
    } while (size >= 0);
}

void parse_chars(char*str, int cind) {
    if (cind > -1) {
        for (int l = 0x41; l <= 0x5A; l++) {
            str[cind] = l;
            UINT addr = GetKey(str);
            if (addr == NULL) continue;
            int index;
            for (index = 0; index < 92; ++index) {
                if (hashKeys[index] == addr && descriptionCheats[index]) {
                    reverse(str);
                    printf("%s (%X) - %s\n", str, addr, descriptionCheats[index]);
                    reverse(str);
                }
            }
            parse_chars(str, cind - 1);
        }
    }
}

int main()
{
    char skeys[30];
    memset(skeys, 0x0, strlen(skeys) + 1);

    setlocale(LC_ALL, "Russian");
    SetConsoleTitleA("SACC");

    cout << "Введите начало чит-кода: ";
    cin >> skeys;

    upper(skeys); reverse(skeys);
    int strl = 30 - strlen(skeys);

    for (int l = 0; l < strl; l++) {
        push_back(skeys, 0x1C);
        parse_chars(skeys, l);
       
    }

    system("pause");
    return 0;
}
 
Сверху