简体   繁体   English

一个供内核使用的简单x86反汇编程序开源

[英]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. 我说的是几个(2-4)源代码文件,它们不需要复杂的安装/集成,并且功能非常有限,仅提供非常基本的功能。
Does anybody know such an open source (for C of course)? 有谁知道这样的开源(当然对于C)?

You might have heard of the radare2 project ( github ). 您可能听说过radare2项目( github )。 It includes rasm which is a quite simple disassembler. 它包括rasm ,这是一个非常简单的反汇编程序。

You can find their code in their github repository . 您可以在他们的github存储库中找到他们的代码。

If you're using GNU gcc & binutils, you can just use objdump. 如果您使用的是GNU gcc和binutils,则可以仅使用objdump。 The way I usually use it is: 我通常使用的方式是:

objdump -dSr my_file.o > my_file.s

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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