Infer a binary format from samples
re_structCompare 2–32 same-format samples side by side to infer field layout, lengths, counts, checksums, timestamps, offsets, and text boundaries, then draft a Kaitai Struct schema.
Instructions
Give 2 to 32 files of the same unknown format (saves, levels, packets, custom archives). Compares them side by side and returns the layout as fields with the evidence for each: bytes that are the same in every sample (magic, version, padding), numbers that follow the file size or the bytes after them (lengths), counts of fixed-size records (count x record size = what follows) with the columns of the record table (whole numbers, floats, ids that rise), CRC-32/Adler-32 fields and what they cover, MD5/SHA-1/SHA-256 or CRC trailers, Unix times, offsets that land on the same bytes in every sample, and text with a length in front or a NUL behind it. A text of a different length per sample does not end the comparison: every sample keeps its own cursor. Also returns a Kaitai Struct (.ksy) draft. A hypothesis from the samples given: more samples that differ in one known thing sharpen it. Read-only; it decrypts and decompresses nothing.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "re_struct"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | No | Or: a folder with the samples (use match to pick them). | |
| files | No | Sample files of the same format. | |
| match | No | With path: only files matching, e.g. "*.sav" or /slot\d+\.dat/. | |
| maxKB | No | KiB of each sample to read (default 1024). Checksums over the whole file need the whole file. |