Giter Site home page Giter Site logo

theoathman / binpack Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 0.0 1.39 MB

BinPack is used to embed Resources into executables in the form of a header file that contain unsigned char of array of data or as a 64/32 library file which will be outputted along with a header file containing pointers to every resources.

C 90.07% C++ 9.93%

binpack's Introduction

BinPack

BinPack is a command line tool for C and C++ to statically pack binary data into a header file, a library file or to output the binary content of a file to the console.

Usage:

List files that need to be packed as data array in a single header file or as a static libray. Use minus sign (-) to list options, and equal sign (=) for edit options. Available options are:

Write Options:

  • -hr To pack all the data of provided files into a header file (.h). [default]

  • -l64 To pack all the data of provided files into a 64 bit static library.

  • -l32 To pack all the data of provided files into a 32 bit static library.

  • -p Output data to the console.

  • -pn Output data to the console natively. (strip c++ integer-suffix and comma)

  • -pc Output data to the console as Ascll characters.

Mode Options:

  • -hx Convert data to hexadecimal literals.

  • -bn Convert data to binary literals.

  • -j To align the data or justify all lines.

  • -c To compress the data. (see source code for more details on how to decompress it

Edit Options:

  • =out write the output to a folder. Example: =out C:\Users\Desktop

  • =jl Edit the justify level end line level. Example: =jl 2

  • =cmf compress a file.

  • =ucf decompress a file.

Examples:

Example 1:

text.txt -j -hx -p

This command will output the data of 'text.txt' into the console(-p) in the form of hexadecimal(-hx), and justify(-j) will be applied to the output.

Example 2:

text.txt data.bin -l64

This command will pack the binary data of 'text.txt' and 'data.bin' into a static library file (.lib/.a) which then will be outputted along with a header file that contain pointers to each data within that precompiled binary pachage.

License

Unlicense public domian. I dedicate any and all copyright interest in this software to the public domain. I make this dedication for the benefit of the public at large and to the detriment of my heirs and successors. I intend this dedication to be an overt act of relinquishment in perpetuity of all present and future rights to this software under copyright law.

binpack's People

Contributors

theoathman avatar

Stargazers

 avatar  avatar Graeme Morris avatar

Watchers

 avatar

binpack's Issues

Any tips on how this might compile under Linux?

I tried to just run g++ BinPack.cpp and I got:

โžœ g++ BinPack.cpp 
BinPack.cpp: In function 'const char* char2Hex(uchar, int)':
BinPack.cpp:86:29: error: 'itoa' was not declared in this scope
   86 | #define ITOA(value,buff,rx) itoa(value,buff,rx)
      |                             ^~~~
BinPack.cpp:324:5: note: in expansion of macro 'ITOA'
  324 |     ITOA(c,tempbuf,16);
      |     ^~~~
BinPack.cpp: In function 'const char* char2bin(uchar, int)':
BinPack.cpp:86:29: error: 'itoa' was not declared in this scope
   86 | #define ITOA(value,buff,rx) itoa(value,buff,rx)
      |                             ^~~~
BinPack.cpp:336:5: note: in expansion of macro 'ITOA'
  336 |     ITOA(c,tempbuf,2);
      |     ^~~~
BinPack.cpp: In function 'const char* char2dec(uchar, int)':
BinPack.cpp:86:29: error: 'itoa' was not declared in this scope
   86 | #define ITOA(value,buff,rx) itoa(value,buff,rx)
      |                             ^~~~
BinPack.cpp:352:5: note: in expansion of macro 'ITOA'
  352 |     ITOA(c,tempbuf,10);
      |     ^~~~
BinPack.cpp: In function 'int main(int, const char**)':
BinPack.cpp:86:29: error: 'itoa' was not declared in this scope
   86 | #define ITOA(value,buff,rx) itoa(value,buff,rx)
      |                             ^~~~
BinPack.cpp:559:9: note: in expansion of macro 'ITOA'
  559 |         ITOA(opFlags & op_lib64 ? S_SIZE_VAL:S_SIZE_VAL_32,buf,10);
      |         ^~~~

I also saw this StackOverflow post about iota...

https://stackoverflow.com/a/6462973/6310966

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.