# Bin_transform_h **Repository Path**: caraba/bin_transf_h ## Basic Information - **Project Name**: Bin_transform_h - **Description**: 将bin 文件转换成 .h 文件,转变成一个完整的结构体数组。 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 1 - **Created**: 2026-09-26 - **Last Updated**: 2026-09-26 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # bin2h - Binary to C Header Converter Convert binary firmware files (`.bin`) to C header arrays (`.h`). Useful for embedding firmware blobs directly into C source code. ## Features - **GUI mode** — Double-click `bin2h.exe`, select `.bin` input and `.h` output, click Convert - **CLI mode** — `bin2h.exe input.bin [output.h]` for scripting - **Drag & drop** — Drag a `.bin` file onto the GUI window - **Responsive layout** — Window controls resize and reposition when the window is resized - **Embedded icon** — Custom application icon compiled into the EXE ## Screenshot ![screenshot](https://via.placeholder.com/600x380?text=Bin2H+Converter+Screenshot) ## Build from Source **Requirements:** - [MinGW-w64](https://www.mingw-w64.org/) (`gcc` + `windres`) - Python 3 + Pillow (`pip install Pillow`) — for icon generation **Build:** ```batch build.bat ``` Or manually: ```batch python gen_icon.py # Generate app_icon.ico windres -O coff bin2h.rc bin2h_res.o # Compile resources gcc -O2 -o bin2h.exe bin2h_gui.c bin2h_res.o -mwindows -lcomdlg32 -s ``` ## Usage ### GUI Double-click `bin2h.exe`, or: ```batch bin2h.exe ``` ### CLI ```batch bin2h.exe firmware.bin # -> firmware.h bin2h.exe firmware.bin output.h # -> output.h ``` ## Project Structure ``` bin2h.c CLI version source bin2h_gui.c GUI version source (responsive Win32) bin2h.rc Windows resource script (icon + manifest) bin2h.manifest Visual styles + DPI awareness resource.h Resource ID definitions gen_icon.py Icon generator (svg_log.png -> app_icon.ico) svg_log / .png Original icon artwork build.bat One-click build script test_case/ Test firmware files ``` ## License MIT