capstone icon indicating copy to clipboard operation
capstone copied to clipboard

Basic Blocks

Open fred26 opened this issue 6 years ago • 5 comments

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

fred26 avatar May 27 '18 17:05 fred26

no.

aquynh avatar May 28 '18 12:05 aquynh

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

pfalcon avatar May 28 '18 14:05 pfalcon

@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 avatar Aug 18 '18 14:08 r4dr3fr4d

@r4dr3fr4d can you show some code to get basic blocks with the help of capstone?

niucool avatar Oct 21 '23 01:10 niucool

@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

r4dr3fr4d avatar Oct 21 '23 13:10 r4dr3fr4d