[X] I have reviewed the OFRAK contributor guide and attest that this pull request is in accordance with it.
One sentence summary of this PR (This should go in the CHANGELOG!)
Link to Related Issue(s)
For some Thumb binaries there were 2 errors:
The complex block could not be found by address. The problem was that the address that angr had for the complex block was the "thumbified" address, with LSB set to zero, while the address we stored in OFRAK for the complex block was the "de-thumbified" address with LSB cleared. It is this "de-thumbified" address that the AngrComplexBlockUnpacker was looking for and could not find.
Basic blocks were not correctly identified as being in Thumb mode because the architecture that angr analyzed for the binary did not include "thumb" in the name. So the capstone disassembly was nonsense, disassembling Thumb instructions as ARM.
Please describe the changes in your request.
Fix the first issue by checking for a complex block with the address's LSB set to 1 if the complex block could not be found ith LSB set to 0.
Fix the second issue by checking the address of the basic block that angr gives us is "thumbified" with LSB set 1, and use that to determine if the basic block is Thumb, rather than the name of the global architecture.
Add a new PIE Thumb test case for all disassembler backends.
Fix another ofrak_angr issue with data word extraction - the CB bounds could be over-eager and include data words which would be erroneously unpacked, so now data words are only extracted if they are referenced by basic blocks which have actually been unpacked from the CB.
Anyone you think should look at this, specifically?
…itially
One sentence summary of this PR (This should go in the CHANGELOG!)
Link to Related Issue(s) For some Thumb binaries there were 2 errors:
Please describe the changes in your request. Fix the first issue by checking for a complex block with the address's LSB set to 1 if the complex block could not be found ith LSB set to 0.
Fix the second issue by checking the address of the basic block that angr gives us is "thumbified" with LSB set 1, and use that to determine if the basic block is Thumb, rather than the name of the global architecture.
Add a new PIE Thumb test case for all disassembler backends.
Fix another ofrak_angr issue with data word extraction - the CB bounds could be over-eager and include data words which would be erroneously unpacked, so now data words are only extracted if they are referenced by basic blocks which have actually been unpacked from the CB.
Anyone you think should look at this, specifically?