Vector35 / Vector35/binaryninja-api

Integer endianness as a type annotation

Open
#6,061 0 comments 10 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Component: Core Component: Type Parser Effort: Low Impact: Low UI: Linear
Dominant language
C++
Stars
1.3k
Forks
298
Avg merge
5d 5h
Merged PRs (30d)
19

Description

What is the feature you'd like to have?
I want the ability to specify "this field in this struct is in network order endianness" (eg struct sockaddr_in::sin_port) and have Binja render constants correctly when they are assigned to the structure. Might be best to render as htons(XXX) as well, to indicate that a byte swap was performed at compile-time.

Would be useful to have at least the following options:

  • Big Endian (show bswap if != bv platform endianness)
  • Little Endian (show bswap if != bv platform endianness)
  • Network Endian (big endian but always show htons)

Is your feature request related to a problem?
I am looking at some network code and the ports all look wrong.

Are any alternative solutions acceptable?
Maybe a "display as > network endian integer" option instead? Maybe both features and the default integer renderer can just pick up the endianness from the type.

Additional Information:
I remember we had a bunch of discussion about whether this was a good idea or not, in person, like two years ago. Can't remember what the outcomes of that were.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no files, tests, or entry points. First clarify the intended type-annotation and rendering design, including Big Endian, Little Endian, and Network Endian behavior. Done would mean an agreed implementation location, documented semantics, and correct constant rendering for network-order structure fields.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
reverse-engineering
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.