pianoverse/inspect-dump.ts
2024-08-27 20:39:18 +03:00

18 lines
626 B
TypeScript

import { $ } from "bun";
import * as fs from "fs/promises";
const dumps = ["EAMqERIGc29waGllGgcjZDlhMmMy", "16, 3, 42, 9, 10, 5, 76, 111, 98, 98, 121, 16, 4, 42, 8, 10, 4, 116, 101, 115, 116, 16, 1, 42, 20, 10, 16, 83, 111, 109, 101, 111, 110, 101, 32, 112, 114, 97, 99, 116, 105, 115, 101, 16, 1 "].map(
(z) => {
if(z.includes(",")) {
return new Uint8Array(z.split(",").map(z=>+z))
} else {
return Buffer.from(z, "base64");
}
}
);
for await (const dump of dumps) {
await fs.writeFile("dump", new Uint8Array(dump.buffer));
const info = await $`~/.local/bin/protobuf_inspector < dump`;
}