https://github.com/chadlrnsn/byteforge
A lightweight C++ tool that converts any file into a C/C++ header containing bytecode array. Features progress bar, drag-and-drop support, and constexpr optimization.
https://github.com/chadlrnsn/byteforge
binary-to-header binary-tools bytecode cmake converter cpp17 file-converter header-generator resource-compiler
Last synced: 3 months ago
JSON representation
A lightweight C++ tool that converts any file into a C/C++ header containing bytecode array. Features progress bar, drag-and-drop support, and constexpr optimization.
- Host: GitHub
- URL: https://github.com/chadlrnsn/byteforge
- Owner: chadlrnsn
- License: mit
- Created: 2025-01-03T16:42:44.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2025-01-03T18:39:54.000Z (5 months ago)
- Last Synced: 2025-01-03T19:19:06.838Z (5 months ago)
- Topics: binary-to-header, binary-tools, bytecode, cmake, converter, cpp17, file-converter, header-generator, resource-compiler
- Language: C++
- Homepage:
- Size: 59.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ByteForge
A simple command-line tool that converts any file into a C/C++ header file containing the file's contents as bytecode.
## Features
- Convert any file to bytecode array in a header file
- Progress bar visualization during conversion
- Support for drag-and-drop or command-line arguments
- Automatic safe variable naming
- Real-time conversion progress display## Usage
```bash
# Using command line arguments
ByteForge input_file [output_file.h]# Interactive mode
ByteForge
> Please enter the file path: input_file
```The tool will generate a header file containing:
- An unsigned int array with the file's bytecode
- A constant with the array size## Output Example
```cpp
unsigned int example_data[] = {
0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A,
// ... more bytes ...
};const size_t example_data_size = sizeof(example_data);
```