Disassemble in C++

I have use c++ in ubuntu 16.0.
Now i want to include disassemble function in that program. is it possible?
if possible how to import exist program ?please help me

Thanks
Kuluoz
yes, it is possible. You can disassemble c++ on most platforms but you need a program to do it. You can call assembly language directly in c++. The keyword is either asm{assembly code} or a variation on that (__asm for example). You can also use your system's assembler to make an object that you can link to.

I'm not an expert on doing this on unix, but it is possible and it should be fairly simple to make it work mechanically -- there should be a bunch of examples online of it. It may be a bit of trouble to get your exact code to work, as disassemblers tend to make code that is challenging to use. Start with a simple assembly program that you write yourself, get that working, then try to pull in the big disassembly file ... at least that is how I would do it.


Last edited on
Use objdump, or compile directly to assembler with the -S flag to your compiler.
e.g.
% objdump -d -M att -Sl --no-show-raw-insn object-code.o
Last edited on
Hi Guys,

Actually , what i need ?
i want to write c++ program and i use dissassemble function.
like instrction length,immediate const,etc

can any one?

Kuluoz
Topic archived. No new replies allowed.