
Basic Disassembly with Libopcodes - pplonski86
https://blog.yossarian.net/2019/05/18/Basic-disassembly-with-libopcodes
======
whitten
This is cool. Is the approach used to support generic disassembly like this
strong enough to use for generic language definition and thus support a
generic decompilation process ?

~~~
woodruffw
Author here.

Yes and no -- libopcodes doesn't provide a ton of target-independent
information (apart from the fields that _might_ be populated if
`insn_info_valid` is true, which it never is for x86). You can throw a bunch
of different targets at it and it'll happily disassemble their outputs, but
without clobber information/instruction grouping/operand extraction you're
basically where you started.

Capstone and LLVM-MC are potentially better starting points (the former wraps
and extends the latter). Those give us (some) instruction semantics; after
that, the problem of generic decompilation starts to look an awful lot like
binary lifting[1]. And (static) binary lifting is pretty hard ;)

[1]:
[https://github.com/trailofbits/mcsema](https://github.com/trailofbits/mcsema)
(FD: This is my employer)

