bytepeel

v0.1.2
io.github.Pinta365/bytepeel Checked 14 hours ago Published 15 days ago

Decode and edit hex, base64, PEM, JWT, gzip, DER, CBOR, MessagePack and protobuf data byte-exactly.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

peel Decode data

Decode data byte-exactly through every layer (hex, base64, PEM, JWT, dumps, gzip/zlib/zstd, DER/ASN.1, CBOR, MessagePack, schemaless protobuf) and return a JSON tree with byte ranges. Ambiguous protobuf LEN fields list ranked alternatives (message, string, bytes, packed); 64-bit integers are JSON strings. Long text and bytes are previewed ("truncated":true); use get with format raw for a full payload. Paths: protobuf field numbers (1.3[2].4: the third field 3 of message 1), DER child indices (0.0.5), a PEM bundle's block index first, CBOR/MessagePack map keys and array indices (users.0.name),…

ParameterTypeDescription
altsintegerMax interpretations kept per protobuf LEN field (default 3).
asstringForce how the innermost decoded bytes are interpreted, when auto-detection picks wrongly.
depthintegerMax nesting of layers and messages (default 16).
filestringPath of a local file to read instead of input (binary files are fine).
formatstringjson (default); tree: a compact indented outline; raw: the selected item's payload bytes as lowercase hex (needs get).
getstringSelect one item by path and return only it.
instringHow to read the input (default auto). raw = the bytes as they are.
inputstringThe data as text: hex, base64, PEM, a JWT, an xxd or hexdump -C dump, or any nesting of these. Give either input or file.
max_itemsintegerMax protobuf fields, CBOR/MessagePack values and DER elements decoded in total (default 1000000).
output_filestringWrite the result to this file instead of returning it. Fails if the file exists, unless overwrite is true.
overwritebooleanAllow output_file to replace an existing file.

set Edit and re-encode data

Change, add or remove values and get the data back in its original encoding (hex spacing, base64 alphabet and wrapping, PEM label, gzip header), with every other byte preserved. Edits apply in order; the result is decoded again and checked (REENCODE_VERIFY_FAILED otherwise). Editing signed data (a certificate) invalidates its signature; JWTs are not editable. Paths: protobuf field numbers (1.3[2].4: the third field 3 of message 1), DER child indices (0.0.5), a PEM bundle's block index first, CBOR/MessagePack map keys and array indices (users.0.name), a JWT part then JSON keys (payload.sub), JS…

ParameterTypeDescription
edits *arrayEdits, applied in order.
altsintegerMax interpretations kept per protobuf LEN field (default 3).
asstringForce how the innermost decoded bytes are interpreted, when auto-detection picks wrongly.
depthintegerMax nesting of layers and messages (default 16).
filestringPath of a local file to read instead of input (binary files are fine).
instringHow to read the input (default auto). raw = the bytes as they are.
inputstringThe data as text: hex, base64, PEM, a JWT, an xxd or hexdump -C dump, or any nesting of these. Give either input or file.
max_itemsintegerMax protobuf fields, CBOR/MessagePack values and DER elements decoded in total (default 1000000).
output_filestringWrite the result to this file instead of returning it. Fails if the file exists, unless overwrite is true.
overwritebooleanAllow output_file to replace an existing file.