bin2cpp featured image

bin2cpp: The easiest way to embed small files into a C++ executable

bin2cpp

Please note that bin2cpp source code is now moved to GitHub. Source code can be downloaded from the project’s GitHub page.

bin2cpp is a command line tool for embedding small files (like images, icons or raw data files) into a C++ executable.

It’s main features are:

  • Easily converts small files as C++ source code for embedding into a C++ executable.
  • Content extraction supported by a unique function call for each embedded file.
  • Supports a multiple embedded files at once.
  • Makes it harder for resource hacker to modify or steal the embedded files.
  • No third party libraries required for retrieving the data of the embedded files.

bin2cpp is not implemented using executable resources. Instead, bin2cpp creates multiple function calls for retrieving the data which makes it harder to steal the executable’s content. It also makes it even harder to replace an existing resource of the executable.

It is designed to be easy to use by developers and to provide easy call functions to get access to the data of the embedded files.

The generated functions that reads and extracts the embedded content does not rely on external libraries so you don’t need to setup your projects to use any third party library to start using bin2cpp. All your embedded data can be accessed right away.

Usage:
bin2cpp [inputfile] [output folder] [header filename] [function identifier] [chunk size] [-override].

  • inputfile: Path to the target file to embed in a C++ source code.
  • output folder: Output path to create generated source code. ie: .\generated_files\
  • header filename: File name of the C++ Header file. ie: SplashScreen.h
  • function identifier: Identifier of the function name that is used to get an instance of the file. ie: SplashScreen
  • chunk size (optional): Size of each string segments. Defaults to 200]
  • override (optional): Tells bin2cpp to over write the destination files.

Screenshots

bin2cpp v1.3 Sample

bin2cpp v1.3 Sample

bin2cpp v1.3 Usage

bin2cpp v1.3 Usage

Download

You can download bin2cpp by clicking on the following links:

Please note that download links are now deprecated. Binary version of bin2cpp can be downloaded directly from the project’s GitHub page.

Code sample

Here are some C++ code samples for embedding a Visual Studio 2008 project file generated with the following command line:

bin2cpp.exe bin2cppTest.vcproj outdir EmbededProjectFile.h Vcproj 250 -override

Compatible with

bin2cpp is only available for the Windows platform and has been tested with the following version of Windows:

  • Windows XP
  • Windows Vista
  • Windows 7

Minimum system requirements

  • 100% PC compatible
  • Pentium II, 300 mhz
  • 256 Mb RAM
  • 1 Mb free disk space
  • Administrator rights (for installation)

License

bin2cpp is being distributed as Freeware for personal, commercial use, non-profit organization, and educational purpose. It may be included with CD-ROM/DVD-ROM distributions. You are NOT allowed to make a charge for distributing this Software (either for profit or merely to recover your media and distribution costs) whether as a stand-alone product, or as part of a compilation or anthology, nor to use it for supporting your business or customers. It may be distributed freely on any website or through any other distribution mechanism, as long as no part of it is changed in any way.

The full license is available here.

History of changes

Version 1.3 – First public release

Leave a Reply