A simple x86 disassembler open source for kernel use
I'm writing a kernel for educational purposes and I want to integrate a disassembler into my kernel.
Since I'm going to integrate it into the kernel I want it to be very small and simple,
ie I only need it to receive a memory address and return the assembly instruction at that address.
I've looked for an open source that can do that but all I found is big libraries which are way too big and complicated.
I'm talking about a few (2-4) source code files that does not require a complicated installation/integration and that is very limited in it's abilities and only provide the very basic functionalities.
Does anybody know such an open source (for C of course)?
You might have heard of the radare2 project (github). It includes rasm which is a quite simple disassembler.
You can find their code in their github repository.
If you're using GNU gcc & binutils, you can just use objdump. The way I usually use it is:
objdump -dSr my_file.o > my_file.s
链接地址: http://www.djcxy.com/p/72434.html
上一篇: mov指令与字节目的地立即到内存
下一篇: 一个简单的x86反汇编程序开源内核使用