You've already forked gtasa-cheatcode-finder
510 lines
17 KiB
HTML
510 lines
17 KiB
HTML
<!DOCTYPE html>
|
|
<html><head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<title>GTA SA cheat code finder</title>
|
|
<style type="text/css">
|
|
#results span { border:1px solid black; padding:2px; margin:3px; display:inline-block; font-family:monospace; font-size:large }
|
|
#chars { font-family:monospace; font-size:large }
|
|
.keys { background-color:#eeeeee }
|
|
</style>
|
|
<link rel="stylesheet" href="GTA%20SA%20cheat%20code%20finder_files/awesomplete.css">
|
|
</head>
|
|
<body>
|
|
<a href="https://tuxxor.siedziba.pl/">< Back to home page</a>
|
|
<h1>Cheat code finder</h1>
|
|
<p>Intended cheat names and descriptions taken from <a href="http://gtag.gtagaming.com/sanandreas/cheats/">gtagaming.com</a>.</p>
|
|
<form id="params" method="GET">
|
|
Find codes for cheat: <div class="awesomplete"><input name="c" id="cheatcode" style="width:400px" autocomplete="off" aria-autocomplete="list" value="DULLDULLDAY"><ul hidden=""></ul><span class="visually-hidden" role="status" aria-live="assertive" aria-relevant="additions"></span></div><input type="submit" id="go" value="Go"><br>
|
|
Using keys: <input name="k" type="text" value="0123456789 ABCDEFGHIJKLMNOPQRSTUVWXYZ" size="50" id="chars" pattern=".{2,}" required="" title="2 characters minimum"><br>
|
|
<p>Keys <span class="keys">0-9,A-Z</span> and <span class="keys">space</span> should always work. Additional keys like <span class="keys">[]\;',./-=ü+öä</span> may work. Key <span class="keys">ß</span> will most likely not work, due to differences in uppercase conversion between the browser and the game.</p>
|
|
Stop every: <input name="n" type="number" id="stopevery" value="100" size="4" required="" min="1"> results
|
|
</form>
|
|
<div id="status">Searching for CRC32 value: 0x88E47C03<br>Current postfix: GYQ3</div>
|
|
<button id="stop" disabled="disabled">Stop</button> <button id="continue">Continue</button><br><br>
|
|
<div id="canonical">Cheat index number: 8<br>Intended cheat code: DullDullDay<br>Cheat effect: Overcast weather<br><br></div>
|
|
<div id="results"><div id="resultcnt1"></div><div id="result1"></div><div id="resultcnt2"></div><div id="result2"></div><div id="resultcnt3"></div><div id="result3"></div><div id="resultcnt4"></div><div id="result4"></div><div id="resultcnt5"></div><div id="result5"></div><div id="resultcnt6"></div><div id="result6"></div><div id="resultcnt7">Length 7 results: 16</div><div id="result7"><span>HD72LW1</span> <span>GLM5I63</span> <span>ZEVAID3</span> <span>E0APCN4</span> <span>C3Z1KN9</span> <span>UGFXKY␣</span> <span>R␣VTX5C</span> <span>4␣2H8EE</span> <span>3PAAXUE</span> <span>RCWUE1G</span> <span>1BVHA5G</span> <span>5SZ␣PUH</span> <span>3403L1Q</span> <span>6VT35AS</span> <span>3W12Q5U</span> <span>06NS␣EZ</span> </div><div id="resultcnt8">Length 8 results: 84+</div><div id="result8"><span>G03ITU10</span> <span>H8INQ430</span> <span>GS2HIQ50</span> <span>132YRJD0</span> <span>R23DVND0</span> <span>6CAP2ZD0</span> <span>HFAT80E0</span> <span>UOZ␣8BE0</span> <span>NEZ500H0</span> <span>SLAA0BH0</span> <span>85IRQ7J0</span> <span>AM␣25QJ0</span> <span>8VHSL3N0</span> <span>FSHWFYO0</span> <span>1ZYFH2Q0</span> <span>3HNOQRS0</span> <span>PIORUVS0</span> <span>R8YZQ2U0</span> <span>19XGU6U0</span> <span>GIK␣41W0</span> <span>9AQI0GW0</span> <span>VWP2DX01</span> <span>DV1AAK21</span> <span>58JCSD51</span> <span>QI8W7P51</span> <span>2H9J3T51</span> <span>␣IX96G71</span> <span>4F8F5H91</span> <span>36KOUX91</span> <span>VP␣AM8␣1</span> <span>261PZPC1</span> <span>I2TU4ND1</span> <span>QT1LCPG1</span> <span>2U0QGTG1</span> <span>BE9V3WL1</span> <span>MMCQ66N1</span> <span>W91AXHO1</span> <span>PIBH8XO1</span> <span>DARD27Q1</span> <span>YHI02EQ1</span> <span>0MMFYHT1</span> <span>SAV6SPU1</span> <span>LZZKJBW1</span> <span>F0DL6SW1</span> <span>XX␣YGQX1</span> <span>9K6MZ5Z1</span> <span>E7UR7P02</span> <span>3GF5VW22</span> <span>R7Q␣V742</span> <span>O3P9XY52</span> <span>GFCZ3462</span> <span>9NY37B62</span> <span>I0KXPY82</span> <span>RS␣RBS␣2</span> <span>ZRQ5GFD2</span> <span>34TB1OE2</span> <span>HS0FBUF2</span> <span>AXQ␣O4I2</span> <span>␣KG4RPK2</span> <span>8C9A6VM2</span> <span>7KCF37O2</span> <span>H7A4V1R2</span> <span>XG6OWFV2</span> <span>LHV0TIX2</span> <span>Y9DJ1JZ2</span> <span>S␣E␣GM13</span> <span>L6S0PC23</span> <span>KF␣90S23</span> <span>I7614743</span> <span>LUR1MG63</span> <span>XZ2NNH83</span> <span>6LD0XQ93</span> <span>␣8XYXF␣3</span> <span>ISGC␣S␣3</span> <span>KV3OJOA3</span> <span>01WK9UB3</span> <span>K52NWKE3</span> <span>SSWW␣UF3</span> <span>B3IET6K3</span> <span>MX2CLSM3</span> <span>BPHDI2O3</span> <span>U3M75QO3</span> <span>5TC8IEP3</span> <span>5YYUGYQ3</span> </div></div>
|
|
|
|
<script type="text/javascript" src="GTA%20SA%20cheat%20code%20finder_files/awesomplete.min.js"></script>
|
|
<script type="text/javascript">
|
|
(function(){
|
|
// http://stackoverflow.com/questions/5448545/how-to-retrieve-get-parameters-from-javascript
|
|
function findGetParameter(parameterName) {
|
|
var result = null,
|
|
tmp = [];
|
|
location.search
|
|
.substr(1)
|
|
.split("&")
|
|
.forEach(function (item) {
|
|
tmp = item.split("=");
|
|
if (tmp[0] === parameterName) result = decodeURIComponent(tmp[1].replace(/\+/g, ' ')); // https://stackoverflow.com/a/20247435
|
|
});
|
|
return result;
|
|
}
|
|
|
|
// http://stackoverflow.com/questions/18638900/javascript-crc32
|
|
|
|
var crcTable = [];
|
|
var crcRevTable = [];
|
|
|
|
var makeCRCTable = function(){
|
|
var poly = 0xEDB88320;
|
|
for(var n =0; n < 256; n++){
|
|
var c = n;
|
|
var c_rev = n << 24;
|
|
for(var k =0; k < 8; k++){
|
|
c = ((c&1) ? (poly ^ (c >>> 1)) : (c >>> 1));
|
|
c_rev = (c_rev & 0x80000000) ? (((c_rev ^ poly) << 1) | 1) : (c_rev << 1);
|
|
}
|
|
crcTable[n] = c;
|
|
crcRevTable[n] = c_rev;
|
|
}
|
|
}
|
|
|
|
makeCRCTable();
|
|
|
|
var crc32 = function(str) {
|
|
var crc = 0 ^ (-1);
|
|
|
|
for (var i = 0; i < str.length; i++ ) {
|
|
crc = (crc >>> 8) ^ crcTable[(crc ^ str.charCodeAt(i)) & 0xFF];
|
|
}
|
|
|
|
return (crc ^ (-1)) >>> 0;
|
|
};
|
|
|
|
var crc32fix = function(crc, target_crc) {
|
|
var buf = [];
|
|
crc ^= -1;
|
|
var fix = target_crc ^ (-1);
|
|
for (var i = 3; i >= 0; i--)
|
|
fix = (fix << 8) ^ crcRevTable[fix >>> 24] ^ ((crc >>> i*8) & 0xFF);
|
|
var ret = [];
|
|
for (var i = 0; i < 4; i++)
|
|
ret[i] = (fix >>> i * 8) & 0xFF;
|
|
return ret;
|
|
}
|
|
|
|
var cheats = [
|
|
'ThugsArmoury',
|
|
'ProfessionalsKit',
|
|
'NuttersToys',
|
|
'INeedSomeHelp',
|
|
'TurnUpTheHeat',
|
|
'TurnDownTheHeat',
|
|
'PleasantlyWarm',
|
|
'TooDamnHot',
|
|
'DullDullDay',
|
|
'StayInAndWatchTV',
|
|
'CantSeeWhereImGoing',
|
|
'TimeJustFliesBy',
|
|
'SpeedItUp',
|
|
'SlowItDown',
|
|
'RoughNeighbourhood',
|
|
'StopPickingOnMe',
|
|
'SurroundedByNutters',
|
|
'TimeToKickAss',
|
|
'OldSpeedDemon',
|
|
'JQNTDMH',
|
|
'NotForPublicRoads',
|
|
'JustTryAndStopMe',
|
|
'WheresTheFuneral',
|
|
'CelebrityStatus',
|
|
'TrueGrime',
|
|
'18Holes',
|
|
'AllCarsGoBoom',
|
|
'WheelsOnlyPlease',
|
|
'StickLikeGlue',
|
|
'GoodbyeCruelWorld',
|
|
'DontTryAndStopMe',
|
|
'AllDriversAreCriminals',
|
|
'PinkIsTheNewCool',
|
|
'SoLongAsItsBlack',
|
|
null,
|
|
'FlyingFish',
|
|
'WhoAteAllThePies',
|
|
'BuffMeUp',
|
|
'LeanAndMean',
|
|
'BlueSuedeShoes',
|
|
'AttackOfTheVillagePeople',
|
|
'LifesABeach',
|
|
'OnlyHomiesAllowed',
|
|
'BetterStayIndoors',
|
|
'NinjaTown',
|
|
'LoveConquersAll',
|
|
'EveryoneIsPoor',
|
|
'EveryoneIsRich',
|
|
'ChittyChittyBangBang',
|
|
'CJPhoneHome',
|
|
'JumpJet',
|
|
'IWantToHover',
|
|
'TouchMyCarYouDie',
|
|
'SpeedFreak',
|
|
'BubbleCars',
|
|
'NightProwler',
|
|
'DontBringOnTheNight',
|
|
'ScottishSummer',
|
|
'SandInMyEars',
|
|
null,
|
|
'Kangaroo',
|
|
'NoOneCanHurtMe',
|
|
'ManFromAtlantis',
|
|
'LetsGoBaseJumping',
|
|
'Rocketman',
|
|
'IDoAsIPlease',
|
|
'BringItOn',
|
|
'StingLikeABee',
|
|
'IAmNeverHungry',
|
|
'StateOfEmergency',
|
|
'CrazyTown',
|
|
'TakeAChillPill',
|
|
'FullClip',
|
|
'IWannaDriveBy',
|
|
'GhostTown',
|
|
'HicksVille',
|
|
'WannaBeInMyGang',
|
|
'NoOneCanStopUs',
|
|
'RocketMayhem',
|
|
'WorshipMe',
|
|
'HelloLadies',
|
|
'ICanGoAllNight',
|
|
'ProfessionalKiller',
|
|
'NaturalTalent',
|
|
'OhDude',
|
|
'FourWheelFun',
|
|
'HitTheRoadJack',
|
|
'ItsAllBull',
|
|
'FlyingToStunt',
|
|
'MonsterMash'
|
|
];
|
|
|
|
var cheatEffects = [
|
|
'Weapon Set 1',
|
|
'Weapon Set 2',
|
|
'Weapon Set 3',
|
|
'Health, Armor, $250k',
|
|
'Wanted level 2 stars',
|
|
'Clear wanted level',
|
|
'Sunny weather',
|
|
'Very sunny weather',
|
|
'Overcast weather',
|
|
'Rainy weather',
|
|
'Foggy weather',
|
|
'Faster clock',
|
|
'Faster gameplay',
|
|
'Slower gameplay',
|
|
'Peds attack other (+ get golf club)',
|
|
'Have a bounty on your head',
|
|
'Everyone armed',
|
|
'Spawn Rhino',
|
|
'Spawn Bloodring Banger',
|
|
'Spawn Rancher',
|
|
'Spawn Hotring A',
|
|
'Spawn Hotring B',
|
|
'Spawn Romero',
|
|
'Spawn Stretch',
|
|
'Spawn Trashmaster',
|
|
'Spawn Caddy',
|
|
'Blow up all cars',
|
|
'Invisible cars',
|
|
'Insane handling',
|
|
'Suicide',
|
|
'All green lights',
|
|
'Aggressive drivers',
|
|
'Pink traffic',
|
|
'Black traffic',
|
|
'Cars on water',
|
|
'Boats fly',
|
|
'Fat player',
|
|
'Max muscle',
|
|
'Skinny player',
|
|
'Elvis is everywhere',
|
|
'Peds attack you with rockets',
|
|
'Beach party',
|
|
'Gang members everywhere',
|
|
'Gangs controls the streets',
|
|
'Ninja theme',
|
|
'Slut magnet',
|
|
'Cheap cars',
|
|
'Expensive cars',
|
|
'Cars fly',
|
|
'Huge bunny hop',
|
|
'Spawn Hydra',
|
|
'Spawn Vortex',
|
|
"Smash n' boom",
|
|
'All cars have nitro',
|
|
'Cars float away when hit',
|
|
'Always midnight',
|
|
'Stop game clock orange sky',
|
|
'Thunder storm',
|
|
'Sand storm',
|
|
'(Unknown)',
|
|
'Mega jump',
|
|
'Infinite health',
|
|
'Infinite oxygen',
|
|
'Get parachute',
|
|
'Get jetpack',
|
|
'Never wanted',
|
|
'Six wanted stars',
|
|
'Mega punch',
|
|
'Never get hungry',
|
|
'Riot mode',
|
|
'Funhouse theme',
|
|
'Adrenaline mode',
|
|
'Infinite ammo',
|
|
'Weapon aiming while driving',
|
|
'Reduced traffic',
|
|
'Country traffic',
|
|
'Recruit anyone (9mm)',
|
|
'Recruit anyone (AK-47)',
|
|
'Recruit anyone (rockets)',
|
|
'Lock respect at max',
|
|
'Lock sex appeal at max',
|
|
'Max stamina',
|
|
'Hitman level for all weapons',
|
|
'Max driving skills',
|
|
'Spawn Hunter',
|
|
'Spawn Quad',
|
|
'Spawn Tanker Truck',
|
|
'Spawn Dozer',
|
|
'Spawn Stunt Plane',
|
|
'Spawn Monster',
|
|
'Prostitutes pay you',
|
|
'All taxis have nitrous',
|
|
];
|
|
|
|
var crcToCheat = {};
|
|
cheats.map(function(cheatCode, index){
|
|
if (cheatCode !== null)
|
|
crcToCheat[crc32(cheatCode.toUpperCase().split('').reverse().join(''))] = [index, cheatCode];
|
|
});
|
|
|
|
var inp = document.getElementById('cheatcode');
|
|
var params_f = document.getElementById('params');
|
|
var stop_b = document.getElementById('stop');
|
|
var cont_b = document.getElementById('continue');
|
|
var res = document.getElementById('results');
|
|
var stat = document.getElementById('status');
|
|
var inp_chars = document.getElementById('chars');
|
|
var canonical = document.getElementById('canonical');
|
|
var running;
|
|
var hash;
|
|
var prev_time;
|
|
|
|
new Awesomplete(inp, {
|
|
minChars: 0,
|
|
maxItems: 100,
|
|
sort: undefined,
|
|
list: cheats.map(function(el, i){
|
|
return el !== null ? el + ': ' + cheatEffects[i] + ' (#' + i + ')': null
|
|
}).filter(function(el){
|
|
return el !== null}
|
|
),
|
|
replace: function(text){
|
|
this.input.value = text.slice(0, text.indexOf(':'));
|
|
},
|
|
});
|
|
|
|
var chars;
|
|
var chars_n;
|
|
var chars_rev;
|
|
var num;
|
|
var num_crc;
|
|
var num_reset = function() {
|
|
num = [];
|
|
num_crc = [];
|
|
}
|
|
var set_chars = function() {
|
|
inp_chars.value = inp_chars.value.toUpperCase();
|
|
chars = inp_chars.value.split('');
|
|
chars_n = chars.map(function(c){return c.charCodeAt(0)});
|
|
chars_rev = [];
|
|
for(var i = 0; i < chars_n.length; i++)
|
|
chars_rev[chars_n[i]] = 1;
|
|
base = chars.length;
|
|
}
|
|
var search_init = function() {
|
|
set_chars();
|
|
num_reset();
|
|
del_results();
|
|
inp.value = inp.value.toUpperCase();
|
|
var cheatCode = inp.value;
|
|
if (cheatCode === '')
|
|
hash = null;
|
|
else
|
|
hash = crc32(cheatCode.split('').reverse().join(''));
|
|
var cheat = null;
|
|
if (hash !== null) cheat = crcToCheat[hash];
|
|
if (cheat) {
|
|
var cheatNum = cheat[0];
|
|
var intCode = cheat[1];
|
|
if (intCode === 'JQNTDMH')
|
|
intCode = 'DoughnutHandicap (not working due to hash being null)';
|
|
canonical.innerHTML =
|
|
'Cheat index number: '+cheatNum+'<br>'+
|
|
'Intended cheat code: '+intCode+'<br>'+
|
|
'Cheat effect: '+cheatEffects[cheatNum]+'<br><br>';
|
|
} else {
|
|
canonical.innerHTML = '';
|
|
}
|
|
prev_time = new Date().getTime();
|
|
}
|
|
|
|
var base;
|
|
var num_inc = function() {
|
|
for(var i = 0; ; i++) {
|
|
var n = num[i];
|
|
if (n === undefined) {
|
|
num[i] = 0;
|
|
break;
|
|
} else if (n + 1 === base) {
|
|
num[i] = 0;
|
|
} else {
|
|
num[i] = n + 1;
|
|
break;
|
|
}
|
|
}
|
|
var crc = num_crc[i+1];
|
|
if (crc === undefined) crc = 0 ^ (-1);
|
|
while(i >= 0) {
|
|
crc = (crc >>> 8) ^ crcTable[(crc ^ chars_n[num[i]]) & 0xFF];
|
|
num_crc[i] = crc;
|
|
i--;
|
|
}
|
|
return (crc ^ (-1)) >>> 0;
|
|
}
|
|
var num_to_s = function() {
|
|
return num.map(function(n){ return chars[n] }).join('');
|
|
}
|
|
|
|
var results;
|
|
var results_num;
|
|
var results_max_num;
|
|
var results_total;
|
|
|
|
var del_results = function() {
|
|
results = {};
|
|
results_num = {};
|
|
results_max_num = 0;
|
|
res.innerText = '';
|
|
results_total = 0;
|
|
}
|
|
|
|
var print_results_count = function(l, plus) {
|
|
var resultsel = document.getElementById('resultcnt'+l);
|
|
if (!resultsel) return;
|
|
var num = results_num[l];
|
|
if (!num) return;
|
|
var resultstr = 'Length '+l+' results: '+num;
|
|
if (plus) resultstr += '+';
|
|
resultsel.innerText = resultstr;
|
|
}
|
|
|
|
var add_result = function(s, crc) {
|
|
var l = s.length;
|
|
if (results[l] === undefined) {
|
|
results[l] = {};
|
|
results_num[l] = 0;
|
|
while(l > results_max_num) {
|
|
print_results_count(results_max_num, false);
|
|
results_max_num++;
|
|
var res_sub_cnt_div = document.createElement('div');
|
|
res_sub_cnt_div.id = 'resultcnt'+results_max_num;
|
|
var res_sub_div = document.createElement('div');
|
|
res_sub_div.id = 'result'+results_max_num;
|
|
res.appendChild(res_sub_cnt_div);
|
|
res.appendChild(res_sub_div);
|
|
}
|
|
}
|
|
if (results[l][s] === undefined) {
|
|
results[l][s] = 1;
|
|
results_num[l]++;
|
|
print_results_count(l, true);
|
|
var span = document.createElement('span');
|
|
if (hash === null) {
|
|
var cheat = crcToCheat[crc];
|
|
span.setAttribute('title', cheat[1]+': '+cheatEffects[cheat[0]]);
|
|
}
|
|
span.appendChild(document.createTextNode(s.replace(/ /g, '␣')));
|
|
var res_by_cnt = document.getElementById('result'+l);
|
|
res_by_cnt.appendChild(span);
|
|
res_by_cnt.appendChild(document.createTextNode(' '));
|
|
results_total++;
|
|
if (results_total % document.getElementById('stopevery').value === 0)
|
|
stop_b.click();
|
|
}
|
|
}
|
|
|
|
var min_work_per_ti = 256;
|
|
var work_per_ti = min_work_per_ti;
|
|
var search_fun = function() {
|
|
var s;
|
|
var hashes = [ hash ];
|
|
if (hash === null) hashes = Object.keys(crcToCheat);
|
|
|
|
for (var i = 0; i < work_per_ti && running; i += hashes.length) {
|
|
var new_hash = num_inc();
|
|
|
|
hashes.forEach(function(hash) {
|
|
if (new_hash === hash)
|
|
add_result(num_to_s());
|
|
var fix = crc32fix(new_hash, hash);
|
|
for(var j = 0; j < 4; j++)
|
|
if (chars_rev[fix[j]] === undefined)
|
|
return;
|
|
add_result(
|
|
fix.map(function(n){
|
|
return String.fromCharCode(n)
|
|
}).reverse().join('')+num_to_s(),
|
|
hash
|
|
);
|
|
});
|
|
}
|
|
var stat_t;
|
|
if (hash !== null)
|
|
stat_t = 'Searching for CRC32 value: 0x'+hash.toString(16).toUpperCase()+"\n";
|
|
else
|
|
stat_t = "Searching for any cheat. Mouse over a result to see which cheat is it\n";
|
|
stat_t += "Current postfix: "+num_to_s();
|
|
stat.innerText = stat_t;
|
|
var time = new Date().getTime();
|
|
var diff = time - prev_time;
|
|
if (diff < 25) diff = 25;
|
|
if (diff > 2500) diff = 2500;
|
|
work_per_ti = ~~(work_per_ti * 250 / diff);
|
|
if (work_per_ti < min_work_per_ti) work_per_ti = min_work_per_ti;
|
|
prev_time = time;
|
|
}
|
|
var start_search = function() {
|
|
if (running !== undefined) {
|
|
clearInterval(running);
|
|
}
|
|
search_init();
|
|
running = setInterval(search_fun, 0);
|
|
stop_b.removeAttribute('disabled');
|
|
cont_b.setAttribute('disabled', '');
|
|
return false;
|
|
}
|
|
stop_b.onclick = function() {
|
|
stop_b.setAttribute('disabled', '');
|
|
clearInterval(running);
|
|
running = undefined;
|
|
cont_b.removeAttribute('disabled');
|
|
return false;
|
|
}
|
|
cont_b.onclick = function() {
|
|
cont_b.setAttribute('disabled', '');
|
|
running = setInterval(search_fun, 0);
|
|
stop_b.removeAttribute('disabled');
|
|
return false;
|
|
}
|
|
;['k', 'n', 'c'].map(function(param) {
|
|
var value = findGetParameter(param);
|
|
if (value !== null) {
|
|
params_f[param].value = value;
|
|
if (param === 'c') start_search();
|
|
}
|
|
});
|
|
})();
|
|
</script>
|
|
</body></html> |