Automatic HEX detection