capstone
capstone copied to clipboard
Basic Blocks
Trying to create basic blocks in x86 x64 mode.
Using modified version of:
https://github.com/aquynh/capstone/blob/master/tests/test_x86.c
Is there away to ask cs_disasm to stop disassembling when an instruction belongs to a jump group (CALL/JNZ/CMOVNE)?
Thanks
no.
Of course there's a way - you disassemble instructions one by one, check groups, and stop when groups match what you want. The issue, Capstone's group support across architectures leaves much to be desired, e.g. https://github.com/aquynh/capstone/issues/1072
@fred26, were you able to implement a solution for this? If not, I may have some code that can help; I've had to do the same thing.
@r4dr3fr4d can you show some code to get basic blocks with the help of capstone?
@niucool I no longer have it handy, but it's going to entail looking for the branching instructions manually. This feature is out of scope for capstone, I imagine. Recommend this issue be closed @aquynh