Skip to content
/ bin2c Public

Tool to convert a binary file into C code (array of uint8_t)

License

Notifications You must be signed in to change notification settings

irqmask/bin2c

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bin2c

Convert binary files into C-code. More precisely, it will create an array of uint8_t containing the binary data.

Compile

cmake .
make

Usage

./bin2c <filename>

e.g.

./bin2c smb.snd

The output file smb.c will be created and it looks like this:

/**
 * @file smb.c
 */
#include <stdint.h>

/** Size in bytes of data_smb */
#define DATA_SMB_SIZE 26401

uint8_t data_smb[] = {
    0x53, 0x4e, 0x44, 0x1a, 0x03, 0x05, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    // ...
    };

About

Tool to convert a binary file into C code (array of uint8_t)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published