Skip to content

Instantly share code, notes, and snippets.

@McSimp
Created May 6, 2015 07:45
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save McSimp/09b29ad1e51502a6b6d0 to your computer and use it in GitHub Desktop.
Save McSimp/09b29ad1e51502a6b6d0 to your computer and use it in GitHub Desktop.
Adventure Capitalist Decoding
var lzf = require('lzf');
var crypto = require('crypto');
function DecodeSaveData(data) {
// Format is: .<Base64 encoded LZF compressed data>|<MD5 hash of data>
if (data.indexOf('.') !== 0) {
throw Error('Invalid save data');
}
var splitStr = data.substr(1).split('|');
if (splitStr.length != 2) {
throw Error('Invalid save data');
}
var b64Data = splitStr[0];
var refHash = splitStr[1];
var compressedData = new Buffer(b64Data, 'base64');
var decompressedData = lzf.decompress(compressedData).toString('utf8');
var computedHash = crypto
.createHash('md5')
.update(decompressedData + 'makeripples')
.digest('hex');
if (computedHash != refHash) {
throw Error('Invalid hash');
}
return JSON.parse(decompressedData);
}
@Pasukaru
Copy link

makeripples seems to be the wrong salt for the current adcap version (1.1.1.1202-45e2c59 on Steam).
Any idea where to find a working one?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment