Skip to content

Latest commit

 

History

History
27 lines (18 loc) · 697 Bytes

File metadata and controls

27 lines (18 loc) · 697 Bytes

unhex

A minimal C utility that transforms binary strings in MySQL log files into their hexadecimal representation.

Features

  • Detects 'binstring', binary 'binstring', and _binary 'binstring' patterns and replaces them with 0x<hex> format
  • Handles escape sequences (\\, \', \", \0, etc.)

Notes

  • Aborts conversion if a string exceeds 256 bytes leaving the original version (adjustable through defines)
  • Full-line comments are preserved unchanged regardless their content

Build

make

Usage

$ echo "SELECT * FROM table WHERE id = _binary 'abcdefghijklmnop';" | ./unhex
SELECT * FROM table WHERE id = 0x6162636465666768696a6b6c6d6e6f70;