binaryninja-api
binaryninja-api copied to clipboard
Linear sweep missing many thumb2 functions
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;