rpgmard-lib
v5.0.0
Published
Library for decrypting/encrypting RPG Maker `rgss` archives.
Maintainers
Readme
rpgmad-lib
Library for decrypting/encrypting RPG Maker XP/VX/VXAce .rgssad/.rgss2a/.rgss3a archives.
TypeScript port of the rpgmad-lib Rust crate, kept behaviorally identical to that reference implementation. Operates on Uint8Array buffers in place wherever possible, mirroring the Rust crate's zero-copy design.
Used in my rpgm-archive-decrypter CLI tool and RPGMTranslate.
Pure Uint8Array/DataView, no runtime-specific APIs - works the same under Node, Bun, and Deno.
Install
npm install rpgmad-lib
# or
bun add rpgmad-lib
# or
deno add npm:rpgmad-libExample
Decrypt
import { Decrypter } from "rpgmad-lib";
import { readFile, writeFile, mkdir } from "node:fs/promises";
import { dirname, join } from "node:path";
const archiveData = new Uint8Array(await readFile("C:/Game/Game.rgss3a"));
const decrypter = new Decrypter();
for (const entry of decrypter.decrypt(archiveData)) {
const path = new TextDecoder().decode(entry.path);
const outputPath = join("C:/Game", path);
await mkdir(dirname(outputPath), { recursive: true });
await writeFile(outputPath, entry.data);
}Encrypt
import { ArchiveEntry, Decrypter, Engine } from "rpgmad-lib";
import { readFile, writeFile } from "node:fs/promises";
const data = new Uint8Array(await readFile("Graphics/Tilesets/Tileset1.png"));
const archiveEntries: ArchiveEntry[] = [{ path: new TextEncoder().encode("Graphics/Tilesets/Tileset1.png"), data }];
const decrypter = new Decrypter();
const size = Decrypter.encryptedBufferSize(archiveEntries, Engine.VXAce);
const archiveBuffer = new Uint8Array(size);
decrypter.encrypt(archiveEntries, Engine.VXAce, archiveBuffer);
await writeFile("./Game.rgss3a", archiveBuffer);Support
Me, the maintainer of this project, is a poor college student from Eastern Europe.
If you could, please consider supporting us through:
Even if you don't, it's fine. We'll continue to do as we right now.
License
Project is licensed under WTFPL.
