gpt4 book ai didi

assembly - 从 exe 文件中取回汇编级代码?

转载 作者:行者123 更新时间:2023-12-04 22:12:58 32 4
gpt4 key购买 nike

我在做 linux 汇编编程,过去几天我已经转向学习 windows 汇编编程。我使用 ml 作为我的汇编器和 golink 作为我的链接器。我有我的汇编代码并从中获得了我的 exe。现在我需要找回它的十六进制,比如 \xff\xab\x55 等等。在 linux 中,我使用 objdump -d elf_executablexxd -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

最佳答案

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

where dumppe
for me dumppe.exe turns out to be in the same directory as ml.exe; masm32\bin\dumppe.exe

for a rough disassembly you can enter;

dumppe -quiet -disassem [file-name-here]

alternatively you could enter;

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

or for more info just type "dumppe" at the cmd prompt.

I also have a windows version of grep installed on my windows and when i use the cmd

dumppe -disassem -quiet win.exe | grep -A10 start:

I get;

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 text.:
which is pretty much the same as

objdump -M intel -d win.exe

I get;

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
时的比较

关于assembly - 从 exe 文件中取回汇编级代码?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18466658/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com