Closed GhostFrankWu closed 3 weeks ago
This address is part of two basic blocks, i dont think any other tool except radare supports a single address to be covered by two basic blocks or a single basic block shared between two functions. And this is a design decision.
This address is not in the begining of any instruction in any basic block. the address is not listed in your disasm and its neither listed in the disasm of r2.
Yeah showing two json objects as output is not valid json, so it should be fixed
As you can see, the address is in the middle of two instructions listed as two separate basic blocks, so linear disassembly wont show it properly unless you set flags on each basic block and then use the bbmiddle option, use pdr or agfv
.afb*
e asm.bbmiddle=true
As you see r2 can disassemble the lock instruction properly, but that's an antidisassembly trick and needs to be treated properly to handle it.
So my proposal here is:
if you enable asm.bbmiddle, which should be set by default you should be able to see both instructions, the lock and the sub. so its the je
that breaks the thing and the lock is actually never executed i think
Environment
Description
For x86, "afbi" returns multiple basic blocks. This will make "afbij" output wrong json format, example:
I'm not sure if this is expected behavior, but based on https://github.com/radareorg/radare2/issues/18284#issuecomment-792330115 , at lest result format of json is went wrong.
Test
I'm not sure if this is caused by the "afbij" or "lock" instruction form x86 arch, as in my environment, r2 actually seems unable to deassemble the code at that address.
I was unable to craft a simple binary to reproduce this problem, so here I provide my original binary program (a statically linked CTF challenge): 754392adc-radare2-issue.zip