A minimal C utility that transforms binary strings in MySQL log files into their hexadecimal representation.
- Detects
'binstring',binary 'binstring', and_binary 'binstring'patterns and replaces them with0x<hex>format - Handles escape sequences (
\\,\',\",\0, etc.)
- Aborts conversion if a string exceeds 256 bytes leaving the original version (adjustable through defines)
- Full-line comments are preserved unchanged regardless their content
make$ echo "SELECT * FROM table WHERE id = _binary 'abcdefghijklmnop';" | ./unhex
SELECT * FROM table WHERE id = 0x6162636465666768696a6b6c6d6e6f70;