4

我在做 linux 汇编编程,在过去的几天里,我转而学习 windows 汇编编程。我ml用作我的汇编器和golink链接器。我有我的汇编代码并从中获得了我exe的。现在我需要找回它的十六进制\xff\xab\x55等等。在 linux 中,我使用了objdump -d elf_executableor xxd -i file。它的 windows 等价物是什么?
编辑 我需要提一下,在 Windows 上使用 objdump 我收到以下错误

C:\Arena>objdump -d a.exe                                                                                                                                                 
objdump: a.exe: File format not recognized

编译后

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
4

4 回答 4

8

如果您安装了 Visual Studio,则可以使用DUMPBIN

dumpbin /DISASM /out:log.txt file.exe
于 2013-08-27T13:47:40.340 回答
5

我之前使用过dumppe.exe程序进行反汇编。

通过打字;

在哪里倾倒
对我来说,dumppe.exe与ml.exe位于同一目录中;masm32\bin\dumppe.exe

对于粗略的拆卸,您可以输入;

dumppe -quiet -disassem [文件名-这里]

或者你可以输入;

dumppe -quiet -disassem:![lable-here] [file-name-here]

或更多信息,只需在 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]

与我使用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
于 2013-08-27T17:18:38.307 回答
1

您可以objdump在 Windows 上安装 install MinGW,它与其他工具一起提供:

> dir /b \MinGW\bin
addr2line.exe
ar.exe
as.exe
c++.exe
c++filt.exe
cc.exe
cpp.exe
dlltool.exe
dllwrap.exe
elfedit.exe
g++.exe
gcc.exe
gcov.exe
gdb.exe
gdbserver.exe
gprof.exe
ld.bfd.exe
ld.exe
libexpat-1.dll
libgcc_s_dw2-1.dll
libgmp-10.dll
libgomp-1.dll
libiconv-2.dll
libintl-8.dll
libmpc-2.dll
libmpfr-1.dll
libquadmath-0.dll
libssp-0.dll
libstdc++-6.dll
mingw-get.exe
mingw-get.exe~
mingw32-c++.exe
mingw32-cc.exe
mingw32-g++-4.6.2.exe
mingw32-g++.exe
mingw32-gcc-4.6.2.exe
mingw32-gcc.exe
mingw32-make.exe
mingwm10.dll
nm.exe
objcopy.exe
objdump.exe
pkginfo.exe
pthreadGC2.dll
quserex-test.exe
ranlib.exe
readelf.exe
size.exe
strings.exe
strip.exe
windmc.exe
windres.exe

>

下载并安装,然后设置环境变量,请参阅入门页面上的环境设置部分。

于 2013-08-27T13:37:05.517 回答
0

如果您不介意这些工具仅在 GUI (afaik) 下运行,请查看IDA Pro(静态)、OllyDbg(动态),它们会显示说明和操作码。

于 2013-08-27T17:21:31.937 回答