An open API service indexing awesome lists of open source software.

https://github.com/gustafla/bin2cstr

Utility for converting files to compact C source (as a string)
https://github.com/gustafla/bin2cstr

Last synced: 3 months ago
JSON representation

Utility for converting files to compact C source (as a string)

Awesome Lists containing this project

README

        

# Binary to C string (literal)

This small tool was made for embedding data in self-compiling executables.

The program converts a file by filename from command line into a C string
literal to stdout.

Use shell redirection or concatenation to save the results.

The -p command line flag can be used to try to output printable characters
as such, but keeping to just hex escape sequences may compress better.

## Installation

cc -Os main.c -o /bin2cstr

I recommend installing to ~/.local/bin or similar