所以,我正在寻找 MIPS 命令的反汇编代码,例如:如果程序得到像 3c1d8010 这样的命令字,我想获得命令的名称和它使用的寄存器:lui sp,0x8010
示例:25080268 addiu t0,t0,616 40806800 mtc0 零,$13
我知道,自己写是可能的,但也许有人已经这样做了。
提前谢谢了!
所以,我正在寻找 MIPS 命令的反汇编代码,例如:如果程序得到像 3c1d8010 这样的命令字,我想获得命令的名称和它使用的寄存器:lui sp,0x8010
示例:25080268 addiu t0,t0,616 40806800 mtc0 零,$13
我知道,自己写是可能的,但也许有人已经这样做了。
提前谢谢了!
# test1.py
from capstone import *
CODE = b"\x55\x48\x8b\x05\xb8\x13\x00\x00"
md = Cs(CS_ARCH_X86, CS_MODE_64)
for i in md.disasm(CODE, 0x1000):
print("0x%x:\t%s\t%s" %(i.address, i.mnemonic, i.op_str))
输出样本:
$ python test1.py
0x1000: push rbp
0x1001: mov rax, qword ptr [rip + 0x13b8]
如果您想在不安装任何东西的情况下快速访问,请尝试在线反汇编程序。
你可以试试radare2
E:\R2>rasm2.exe -a mips -e -d -
25080268
addiu t0, t0, 0x268
40806800
mtc0 zero, t5, 0
使用 mips.gnu 获取您查询的输出
E:\R2>rasm2.exe -a mips.gnu -e -d -
25080268
addiu t0, t0, 616
40806800
mtc0 zero, $13
rasm2 -h 应该显示开关
-a = arch (use -L to list the numerous architectures it supports)
-e = to tell that the input is Big-Endian
-d = Disassemble
- = to provide input from Stdin