Skip to content

Instantly share code, notes, and snippets.

@ForeverZer0
Created January 30, 2020 06:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ForeverZer0/936c8a01626806bc7b8f98807994c0ef to your computer and use it in GitHub Desktop.
Save ForeverZer0/936c8a01626806bc7b8f98807994c0ef to your computer and use it in GitHub Desktop.
Convert a binary file into a string that can be stored in a C file as an embedded resource.
#!/usr/bin/bash
hexdump -v -e '16/1 "_x%02X" "\n"' $1 | sed 's/_/\\/g; s/\\x //g; s/.*/ "&"/'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment