Created
September 10, 2020 13:10
-
-
Save qsniyg/ee81ac05117e0f1edbce39a17ed4b85b to your computer and use it in GitHub Desktop.
deobfuscator for protondb report ids
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // https://www.protondb.com/data/counts.json | |
| var get_token_from_counts = function(counts) { | |
| return [counts.reports, counts.timestamp]; | |
| }; | |
| var token = [..., ...]; | |
| var deobfuscate = function(appid, token) { | |
| return deobfuscate_sub(appid, token[0], token[1]); | |
| }; | |
| var numberify = function(string) { | |
| string += "/"; | |
| var output = 0; | |
| for (var i = 0; i < string.length; i++) { | |
| output = (output << 5) - output + string.charCodeAt(i) | 0; | |
| } | |
| return Math.abs(output); | |
| }; | |
| var deobfuscate_sub = function(appid, reports, timestamp) { | |
| var func = null; | |
| if (appid % 2 === 1) { | |
| func = odd_func; | |
| } else { | |
| func = even_func; | |
| } | |
| return numberify(func(appid, reports, timestamp)); | |
| }; | |
| var even_func = function(a1, a2, a3) { | |
| return (a1 * (a2 % a3)) + "?" + (a1 * a3); | |
| }; | |
| var odd_func = function(a1, a2, a3) { | |
| return a2 + ")" + (a1 * (a2 % a3)); | |
| }; | |
| // https://www.protondb.com/data/reports/app/{deobfuscated id}.json |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment