[LLVMdev] MC Disassembler

Carback, Richard T., III rcarback at draper.com
Mon Sep 8 13:18:51 PDT 2014


> Does LLVM still have code that will disassemble object files back into
> MC IR?  I'm looking at starting a project which will require that
> functionality and would like to know if it got removed along with
> MCAnalysis.

I don't think the MC Disassembler was touched, so this should still work but not the branch analysis and other stuff. 

> On a related note, does LLVM have the facilities to convert code at the
> MC layer back into MachineInstr's?  I'm guessing not but thought I'd
> ask.

Fracture does this here:

https://github.com/draperlaboratory/fracture/blob/master/lib/CodeInv/Disassembler.cpp#L142

Specifically here is where it recovers the MCID which allows you to rebuild the MachineInstr object with some fidelity using the MIB:

https://github.com/draperlaboratory/fracture/blob/master/lib/CodeInv/Disassembler.cpp#L166








More information about the llvm-dev mailing list