Skip to content

Instantly share code, notes, and snippets.

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
.update(decompressedData + 'makeripples')
if (computedHash != refHash) {
throw Error('Invalid hash');
return JSON.parse(decompressedData);

This comment has been minimized.

Copy link

@Pasukaru Pasukaru commented Jul 10, 2015

makeripples seems to be the wrong salt for the current adcap version ( 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