简体   繁体   中英

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM