m4b / m4b/goblin

Is there any reason why no enums are provided for the Header fields?

Open
#276 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
1.5k
Forks
202
PR merge metrics
No merged PRs in 30d

Description

I am trying to use `goblin` in a project to check the `e_type` of a binary file. I noticed that there are no `type` methods on the `Header` struct, but that the field was publicly accessible as an u16. I haven't been able to find any "abstractions" over this peculiar field, but noticed that some were available such as the `container` and `endianness` methods with associated enums. Is there any reason as to why more enums have not been introduced?

Something like a `Type` which could be `#[repr(u8)]` and contain the `Dyn`, `Exec`, `None`, etc etc. I know that the constants are available, but it would feel more "rusty" to match against an enum variant created from the underlying `e_type` field rather than matching against raw constants.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reading the Header struct and its public e_type field, then compare the existing container and endianness methods and associated enums. Review the available constants and the issue discussion to determine which header fields and variants are in scope. Done means the proposed enum API is consistent with the existing abstractions and its behavior is covered by the relevant tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
reverse-engineering
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.