https://github.com/arklumpus/bin2coff
MS COFF object file generator
Science Score: 13.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
○.zenodo.json file
-
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (12.3%) to scientific vocabulary
Repository
MS COFF object file generator
Basic Info
- Host: GitHub
- Owner: arklumpus
- License: gpl-3.0
- Language: C#
- Default Branch: main
- Size: 20.5 KB
Statistics
- Stars: 8
- Watchers: 1
- Forks: 2
- Open Issues: 0
- Releases: 1
Metadata Files
Readme.md
bin2coff
bin2coff is a tool to create COFF object files containing binary data, which is useful e.g. to embed a binary file in a C/C++ project.
The code on which this project is based was originally created by Pete Batard as part of the libwdi project and modified by Artifex Software Inc. and included in the MuPDF source code.
I translated the original code to C# and added support for producing ARM64 compatible object files (which, in addition to a different flag in the file header, also require the data to be aligned to 4-byte boundaries).
Usage
bin2coff bin obj [label] [64bit|Win32|x64|arm64]
bin: source binary data.obj: target object file, in MS COFF format.label: identifier for the extern data. If not provided, the name of the binary file without extension is used.64bit/Win32/x64/arm64/ARM64: produce an object that is compatible with the specified architecture.For 64bit/x64 and arm64, symbols are generated without leading underscores, and for arm64 the data is aligned to 4-byte boundaries; machine type is set appropriately.
With your linker set properly, typical access from a C source is:
C
extern uint8_t label[] /* binary data */
extern uint32_t label_size /* size of binary data */
This program aims to be a drop-in replacement for other bin2coff versions (e.g. the one included with MuPDF): simply place the executable in the place where the toolchain expects it to be to make it possible to generate arm64-compatible obj files. For x86 and x64 targets, the binaries produced by this program should be identical to the original bin2coff.
Building from source
To build the program from the source code, you will need the .NET 6 SDK or higher. You should use a Windows machine.
- Download the source code: bin2coff-1.0.0.tar.gz (or clone the repository).
- Open a command prompt in the folder where you have downloaded the source code, type
BuildBinariesand press enter. This will build the binaries for thex64,x86andarm64versions of the program (each version can produce object files for all platforms - use the one that corresponds to the host architecture). You can find them in theReleasefolder. - (Optional) To sign the binaries, you will need to have the
signtoolutility installed and in yourPATH. You can get this e.g. by opening a Visual Studio Developer command prompt in the folder with the source code. Use the commandSignBinaries <path_to_certificate.p12> <certificate_password>to sign the binaries.
Owner
- Name: Giorgio Bianchini
- Login: arklumpus
- Kind: user
- Company: University of Bristol
- Website: https://giorgiobianchini.com
- Repositories: 8
- Profile: https://github.com/arklumpus
GitHub Events
Total
- Watch event: 6
- Fork event: 2
Last Year
- Watch event: 6
- Fork event: 2
Issues and Pull Requests
Last synced: about 1 year ago
All Time
- Total issues: 0
- Total pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Total issue authors: 0
- Total pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0