C Char To Hex String, Your sscanf is reading the string as HEX, but the string is written in binary.