作者:手机用户2502877507 | 来源:互联网 | 2023-05-19 07:04
SimilarlytoHowdoIdisassemblerawx86code?,butthenfortheMIPSarchitecture:howdoIdisass
Similarly to How do I disassemble raw x86 code?, but then for the MIPS architecture: how do I disassemble raw MIPS code with objdump
? I want to check the instructions in a vmlinux image, but to do so I now have to:
类似地,我如何分解原始的x86代码?但是对于MIPS体系结构:我如何通过objdump分解原始MIPS代码?我想要检查vmlinux映像中的说明,但要这样做,我现在必须:
: > x.c
mipsel-linux-gnu-gcc -c -o x.o x.c
mipsel-linux-gnu-objcopy --add-section raw=vmlinux x.o
mipsel-linux-gnu-objcopy --remove-section .comment x.o
mipsel-linux-gnu-objdump -D x.o | less
Is there an easier way to do it? I've tried the below to no avail:
有没有更简单的方法?我试过下面的方法:
mipsel-linux-gnu-objdump -b elf32-tradlittlemips -mmips -Mgpr-names=O32,cp0-names=mips1,cp0-names=mips1,hwr-names=mips1,reg-names=mips1 -D vmlinux | less
It just spits out:
它只是出来:
mipsel-linux-gnu-objdump: vmlinux: File format not recognized
If it helps, here is the output of some commands:
如果有用,下面是一些命令的输出:
$ file x.o
x.o: ELF 32-bit LSB relocatable, MIPS, MIPS-I version 1 (SYSV), with unknown capability 0xf41 = 0x756e6700, with unknown capability 0x70100 = 0x1040000, not stripped
$ mipsel-linux-gnu-objdump -p x.o
x.o: file format elf32-tradlittlemips
private flags = 1006: [abi=O32] [mips1] [not 32bitmode] [PIC] [CPIC]
The target is an AR7 CPU.
目标是一个AR7 CPU。
3 个解决方案