Vector35 / Vector35/binaryninja-api

Linear sweep missing many thumb2 functions

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

Nobody has claimed this yet.

Arch: ARM/Thumb Component: Core Impact: Medium
Dominant language
C++
Stars
1.3k
Forks
298
Avg merge
5d 5h
Merged PRs (30d)
19

Description

See internal binary problem service sweep initiative

Examples at 0x87e923c4, 0x87e8882c, and lots of other places in the binary

The pseudocode for bx shows that we should be considering creating thumb2 functions at even addresses (taken from here):

// BXWritePC()
// ===========

BXWritePC(bits(32) address)
    if CurrentInstrSet() == InstrSet_ThumbEE then
        if address<0> == '1' then
            BranchTo(address<31:1>:'0');  // Remaining in ThumbEE state
        else
            UNPREDICTABLE;
    else
        if address<0> == '1' then
            SelectInstrSet(InstrSet_Thumb);
            BranchTo(address<31:1>:'0');
        elsif address<1> == '0' then
            SelectInstrSet(InstrSet_ARM);
            BranchTo(address);
        else // address<1:0> == '10'
            UNPREDICTABLE;

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 by reproducing the linear sweep on the referenced internal binary and inspect handling around 0x87e923c4 and 0x87e8882c. Compare the bx behavior with the linked ARM pseudocode, then identify an existing sweep test or entry point to exercise the case. Done means the missing Thumb2 functions are discovered at the reported even addresses without regressing other ARM/Thumb analysis.

Written by the indexing model from the issue text.

Assessment

Domain
reverse-engineering
Issue type
Bug
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.