Disassembly of instruction stops at section boundary
Here is an issue that I ran into when I deal with the crackme at https://github.com/antire-book/dont_panic. After some processing, I get the following code:
The code at 0x40017a fails to disassemble. However, if we look at the bytes(48 31 ed ...), it is definitely a valid instruction:
And the reason that we stop disassembling even if the bytes are valid is because we are hititng a section boundary:
The related database: trouble.bndb.zip
Upon further investigation, I figured that the disassembly itself succeeds (the arch x86 returns valid instruction info), but the instruction is considered invalid by the core because it strides the .data section, which does not have code semantics.
I suggest we reconsider if we should stop disassembly in such cases. Also, the code creates an invalid instruction tag at the address, which went missing. We need to fix this as well.
I think what we need here is two things:
- Notify the user that the disassembly is halted due to crossing a section boundary.
- Add a setting that allows the user to override this behavior.