pianoverse/inspect-dump.ts

25 lines
520 B
TypeScript
Raw Normal View History

2024-08-27 17:39:18 +00:00
import { $ } from "bun";
import * as fs from "fs/promises";
2024-12-28 01:19:00 +00:00
const realdumps: number[][] | string[] = []
const dumps = realdumps.map(
(z) =>{
if(Array.isArray(z)) {
return new Uint8Array(z);
}
2024-08-27 17:39:18 +00:00
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`;
2024-12-28 01:19:00 +00:00
2024-08-27 17:39:18 +00:00
}