jam1garner / jam1garner/binrw

Generating 010 Editor Templates from binrw annotations

Open
#307 4 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Rust
Stars
853
Forks
56
PR merge metrics
No merged PRs in 30d

Description

First off, thanks for creating this fantastic library!
I'm a user of 010 Editor, a hex-editor with support for file format parsing through something they call [template](https://www.sweetscape.com/010editor/templates.html). Essentially, you define something that looks a lot like C structs which then helps you parse and highlight binary data. I'm using binrw to parse some slightly complex file formats and I like to have a hex editor with the data up to debug the structures and annotations. I was thinking that it would be cool if I could generate 010 Editor templates directly from the Rust structs with binrw annotations. Unfortunately, I'm pretty new things like macros etc. in Rust so I'm not sure what's possible or what the best approach is.

I very naively imagine something like having a crate that adds some macro to a struct, like `#[derive(010Template)]` which then at build time would generate a template file alongside the application binary.

Is this possible at all? What Rust mechanisms should I look into to be able to build something like this? Is this something that would be a welcome addition to this library (with a feature flag) or something I should try to implement as a separate crate?

Contributor guide

Open the contributing guide

Research direction

Start by reviewing binrw's annotation and procedural-macro mechanisms, then compare the required output with the 010 Editor template format linked in the issue. Determine whether generation belongs in binrw or a separate crate; done requires a defined approach and scope before implementation can begin.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.