我正在进行linux汇编编程,过去几天我已经开始学习windows汇编编程.我ml用作汇编程序和golink链接器.我有汇编代码并从中获得了我的汇编代码exe.现在我需要恢复它的十六进制\xff\xab\x55等等.在linux中我使用objdump -d elf_executable或xxd -i file.它的窗户相当于什么?
编辑
我需要提一下,在Windows上使用objdump我收到以下错误
C:\Arena>objdump -d a.exe
objdump: a.exe: File format not recognized
Run Code Online (Sandbox Code Playgroud)
用它编译后
C:\Arena>ml a.asm
Microsoft (R) Macro Assembler Version 10.00.30319.01
Copyright (C) Microsoft Corporation. All rights reserved.
Assembling: a.asm
C:\Arena>golink a.obj kernel32.dll user32.dll
GoLink.Exe Version 0.26.14 - Copyright Jeremy Gordon 2002/9 - JG@JGnet.co.uk
Output file: a.exe
Format: win32 size: 1,536 bytes
Run Code Online (Sandbox Code Playgroud)
如果安装了Visual Studio,则可以使用DUMPBIN:
dumpbin /DISASM /out:log.txt file.exe
Run Code Online (Sandbox Code Playgroud)
我之前使用过dumppe.exe程序进行反汇编。
通过打字;
哪里转储对我来说,dumppe.exe与ml.exe位于同一目录中;masm32\bin\dumppe.exe
对于粗略的拆卸,您可以进入;
dumppe -quiet -disassem [文件名-这里]
或者你可以输入;
dumppe -quiet -disassem:![标签-此处] [文件名-此处]
或了解更多信息,只需在 cmd 提示符下输入“ dumppe ”即可。
我的 Windows 上还安装了 Windows 版本的grep,当我使用 cmd 时
dumppe -disassem -quiet win.exe | grep -A10 开始:
我明白了;
00401000 start:
00401000 6A00 push 0
00401002 680F304000 push offset off_0040300F ; 'program statment!!!',000h
00401007 6800304000 push offset off_00403000 ; 'hello world!!!',000h
0040100C 6A00 push 0
0040100E E80D000000 call jmp_MessageBoxA
00401013 6A00 push 0
00401015 E800000000 call jmp_ExitProcess
0040101A jmp_ExitProcess: ; Xref 00401015
0040101A FF2500204000 jmp dword ptr [ExitProcess]
Run Code Online (Sandbox Code Playgroud)
与我使用objdump时的比较
objdump -M intel -D win.exe | grep -A10 文本。:这几乎与
objdump -M intel -d win.exe
我明白了;
00401000 <.text>:
401000: 6a 00 push 0x0
401002: 68 0f 30 40 00 push 0x40300f
401007: 68 00 30 40 00 push 0x403000
40100c: 6a 00 push 0x0
40100e: e8 0d 00 00 00 call 0x401020
401013: 6a 00 push 0x0
401015: e8 00 00 00 00 call 0x40101a
40101a: ff 25 00 20 40 00 jmp DWORD PTR ds:0x402000
401020: ff 25 08 20 40 00 jmp DWORD PTR ds:0x402008
Run Code Online (Sandbox Code Playgroud)