Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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

This comment has been minimized.

Copy link

Pasukaru commented Jul 10, 2015

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
You can’t perform that action at this time.