# maboii

> amiibo™ encryption/decryption library

Latest version **1.1.0** (published 2019-04-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install maboii
pnpm add maboii
yarn add maboii
bun add maboii
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2019-04-27 |
| First published | 2019-04-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 11.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 11 |
| Author | Entrivax |
| Maintainers | entrivax |
| Keywords | amiibo, maboii |

## Links

- npm: https://www.npmjs.com/package/maboii
- Repository: https://github.com/Entrivax/maboii.js
- Homepage: https://github.com/Entrivax/maboii.js#readme
- Issues: https://github.com/Entrivax/maboii.js/issues
- npm.io page: https://npm.io/package/maboii

## Recent versions

- 1.1.0 (latest) — 2019-04-27
- 1.0.0 — 2019-04-26

## README

# maboii.js
amiibo™ encryption/decryption library.
This library is a port of the encryption/decryption code from [socram8888/amiitool](https://github.com/socram8888/amiitool).

## How to use
### Install the package
```bash
npm install maboii
```

### Load the keys
```js
const maboii = require('maboii');
const fs = require('fs');

// Read keys from file
let fileBuffer = fs.readFileSync('./keys.bin');
const keys = maboii.loadMasterKeys([...fileBuffer]);
```

### Decrypt dump
```js
// Read dump from file
let dumpFileBuffer = fs.readFileSync('./dumpFile.bin')
let unpackResult = maboii.unpack(keys, [...dumpFileBuffer]);

// If decrypt is successful
if (unpackResult.result) {
    // The plain data is available through unpackResult.unpacked
}
```

### Encrypt plain data
```js
// Read plain dump from file
let plainDumpFileBuffer = fs.readFileSync('./dumpFile.dec.bin')
let packedResult = maboii.pack(keys, [...plainDumpFileBuffer]);
```

### Read information from plain data
```js
const maboii = require('maboii');
const fs = require('fs')

// Read plain dump from file
let plain = [...fs.readFileSync('./dumpFile.dec.bin')]; // Let's read an Inkling dump

maboii.plainDataUtils.getAmiiboId(plain); // Returns '0800010003820002'
maboii.plainDataUtils.getCharacterId(plain); // Returns '0800'
maboii.plainDataUtils.getGameSeriesId(plain); // Returns '080'
maboii.plainDataUtils.getMiiName(plain); // Returns the Mii name as string, in my case 'Holo' from my dump
maboii.plainDataUtils.getNickName(plain); // Returns the amiibo™ name as string, in my case 'Sushy' from my dump
```

## Credits
- socram8888 - Author of amiitool
- AcK77 - Author of AmiiBomb which helped me a lot to test

---
_Source: https://npm.io/package/maboii · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
