Vector35 / Vector35/binaryninja-api

Handle ABIs that pass and return floating point values split across multiple integer registers

Open
#5,900 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

The ARM EABI specifies that floating point values be passed and returned in integer registers. Single precision (float or float32) values fit into single registers, but double precision (double or float64) values must be placed in pairs of 32-bit integer registers.

Thus a function like atan2, with this signature in C: double atan2(double, double), would look in the binary like it was int32 atan2(int32, int32, int32, int32).

Ideally, Binary Ninja should support this syntax to capture its true semantics:

    double@r0:r1 atan2(double @ r0:r1, double @ r2:r3)

There are (at least) two parts to adding support for this:

  1. The type parser:
    1. needs to be able to handle register specifiers in return types
    2. needs to be able to handle split register specifiers
  2. The analysis needs to be able to deal with split register parameters and returns, including being aware of the type conversion that they imply.

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

Start with the type parser requirements: register specifiers in return types and split register specifiers. Then examine analysis handling for split-register parameters and returns; the work is done when the shown atan2 signature is accepted and its implied type conversions are handled.

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
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.