When diagnosing low-level binlog corruption, replication decode mismatches, or custom protocol adapters, seeing decoded text is not enough. You need to inspect the raw binary byte stream.
Why Hex Forensics?
Standard CLI utilities like hexdump or xxd display an entire file indiscriminately. Finding where event #4194381 starts in a 1 GB file requires tedious byte-offset calculation. Binsight's Hex Inspector clips and isolates the exact byte range for the selected event automatically.
Anatomy of the Hex Inspector
The Hex Inspector provides a classic fixed-pitch 3-column layout:
- Offset Column: 8-character hexadecimal byte offset relative to the event start (e.g.
00000000). - Hex View (16 Bytes): Two 8-byte columns formatted as hex byte pairs with color-coding for headers vs. payload.
- ASCII View: Printable ASCII characters, with unprintable binary control bytes represented by periods (
.).
Decoding 19-Byte Binlog Event Headers
MySQL v4 binlog events start with a standard 19-byte header:
| Bytes | Field | Description |
|---|---|---|
| 0 – 3 (4 B) | timestamp | Seconds since Unix epoch |
| 4 (1 B) | type_code | Event type identifier (e.g. 0x1e = WRITE_ROWS) |
| 5 – 8 (4 B) | server_id | Origin server ID |
| 9 – 12 (4 B) | event_length | Total size of header + payload in bytes |
| 13 – 16 (4 B) | next_position | End position offset in the binlog file |
| 17 – 18 (2 B) | flags | Event execution flags |