laymanshex/README

54 lines
1.2 KiB
Plaintext
Raw Normal View History

2020-04-26 22:57:19 +02:00
LaymansHex
==========
LaymansHex takes a (partial) file description and allows tinkering with
the values in a binary file. It thus serves as a sort of layman's
hex editor.
File description format
-----------------------
In EBNF:
```
description =
{ comment }
endianness
definition
{ definition }
.
comment = '#' { LETTER | DIGIT } '\n'.
endianness = ("little endian" | "big endian") '\n'.
definition = name ':' type '\n'.
name = { LETTER | DIGIT }.
type = ( "byte[" INTEGER "]" )
| int8 | int16 | int32 | int64
| uint8 | uint16 | uint32 | uint64
| float32 | float64
```
The name of a definition line can be left empty to ignore that particular value.
Portions of the binary file not covered be the file description are ignored.
Usage
-----
To get values: laymanshex FORMATFILE BINARY
2020-04-26 23:20:41 +02:00
2020-04-26 23:21:35 +02:00
To set values: laymanshex -set "key1=value1,key2=value2" FORMATFILE BINARY
2020-04-26 22:57:19 +02:00
2020-04-27 15:29:48 +02:00
Examples of format descriptions can be found in the [laymanshex-files repo](/laymanshex-files/).
2020-04-26 22:57:19 +02:00
TODO
----
There is no way to express offset values inside a file yet. Since this is
2020-04-27 08:03:17 +02:00
relatively common, I will add it at some point. Also: Repeated data limited by
marker or size field.