0

I have an encoded binary given as a long string of ascii, hex escape sequences, and null escape sequences. How can I convert it back into a binary?

sample: Res\x01\x0c\0\0\0\x12\xff\x88\x01\x01\xfccave\x02>\0\x01\x03EOF\0");

The solutions i've tried are: Convert hex to binary https://unix.stackexchange.com/questions/352569/converting-from-binary-to-hex-and-back

They either can't account for ascii, or escaped null chars.

Enki
  • 1
  • Do you mean something like Python's `x='Res\x01\x0c\0\0\0\x12\xff'; ' '.join([f'{ord(b):08b}' for b in x])` (returns `01010010 01100101 01110011 00000001 00001100 00000000 00000000 00000000 00010010 11111111`)? – JosefZ Feb 06 '23 at 11:53

0 Answers0