Skip to content

Instantly share code, notes, and snippets.

View segfault-bilibili's full-sized avatar

segfault-bilibili

View GitHub Profile
@segfault-bilibili
segfault-bilibili / crc32.ts
Last active July 11, 2024 13:43
Calculate CRC-32 without zlib.crc32() binding in NodeJS
private static crc32(data: fsPromises.FileHandle | Uint8Array): Promise<number> {
return new Promise((resolve, reject) => {
let inStream: stream.Readable;
try {
if (data instanceof Uint8Array) {
inStream = new stream.PassThrough().end(data);
} else {
inStream = data.createReadStream({ start: 0, autoClose: false, highWaterMark: this.chunkSize });
}
} catch (e) {
@segfault-bilibili
segfault-bilibili / vfxb.bt
Last active July 16, 2024 21:01
Decode *.vfxb files in Magia Record's resource/image_native/mini/anime_v2
//------------------------------------------------
//--- 010 Editor v14.0.1 Binary Template
//
// File: vfxb.bt
// Authors: segfault-bilibili
// Version: 0.1
// Purpose: Decode *.vfxb files (and decompessed LZ4 data) in Magia Record's resource/image_native/mini/anime_v2
// Category: Game
// File Mask: *.vfxb
// ID Bytes: 64 69 75 47
@segfault-bilibili
segfault-bilibili / shellcode.asm
Created December 8, 2024 04:03
ASRock X79 Extreme9 MRC serial debug output enable
[BITS 32]
PORT equ 0x3F8
PNP_IDX_EN equ 0x30
PNP_IDX_IO0 equ 0x60
NUVOTON_ENTRY_KEY equ 0x87
NUVOTON_EXIT_KEY equ 0xAA
PNP_DEV_PORT equ 0x2E