angr / angr-management

The official angr GUI.
BSD 2-Clause "Simplified" License
868 stars 109 forks source link

Unconventional Basic Block Termination and nop Instruction Placement in Binary #1106

Closed akulpillai closed 10 months ago

akulpillai commented 10 months ago

Description

Screenshot 2023-10-19 at 5 30 21 PM

In this binary, at addresses 0x401104 and 0x40111c among others, basic blocks don't conclude with a conditional branch or any control flow instruction and instead end with a nop instruction.

Why is the nop instruction positioned as such, rather than in the subsequent basic block?

Doesn't this deviate from the conventional definition of a basic block?

Steps to reproduce the bug

Load the binary using default analysis and configuration. chattr_mips-pc-linux_Os.zip

Environment

Bundled release of commit: 164635168194e06a162539cae31fed9b14a7914b

Additional context

No response

rhelmot commented 10 months ago

branch delay slots are part of the MIPS architecture and the instructions that fill them are traditionally placed in the block of code coming before them because they happen before the control flow transitions.

akulpillai commented 10 months ago

I see, thank you for the quick response!