npm.io
1.0.0 • Published 4 years ago

nksave

Licence
ISC
Version
1.0.0
Deps
1
Size
5 kB
Vulns
0
Weekly
0
Stars
1

NKSave

A Profile.save decryptor for Bloons td 6 (btd6)

Heavily inspired by averysumener's c++ Profile.save thingy and BowDown097's provided c# code. This would not have been possible without them.

usage

unpacking

just some standard stuff, did something a bit different using promisify in this example

const nksave = require('nksave');
const fs = require('fs');

const { promisify } = require('util');
const readFile = promisify(fs.readFile);

async function main() {
    let bytes = await readFile('./path/to/Profile.save', null);
    let json = nksave.unpack(bytes);
    // log it, write to file, etc
}
main();

packing

similar to above example

const nksave = require('nksave');
const fs = require('fs');

const { promisify } = require('util');
const readFile = promisify(fs.readFile);
const writeFile = promisify(fs.readFile);

async function main() {
    let bytes = await readFile('./path/to/editedfile.json', null);
    let encoded = nksave.pack(bytes);
    await writeFile('./path/to/Profile.save', encoded);
}
main();

Keywords