disassembling, changing and assembling DLL file

眉间皱痕 提交于 2020-04-30 07:21:09

问题


I have a DLL which I have disassembled, and just to test that my project is going to work. I have tried assembling it again but without luck.

I'm getting different kinds of errors.

The disassembly I have done with IDA Pro freeware, and then exported the file as an .asm, to try to assemble it again I have tried to use A86 assembler and flat assembler.

Maybe I'm disassembling the DLL the wrong or using the wrong assembler, but could somebody maybe point me to some tools and/or resources about this?

Data:

A86, IDA no analysis done on disassembly:

C:\Users\Ma\Documents\sap assembler\a86\Temp>a86 TEST.ASM
A86 macro assembler, V4.02 Copyright 1995 Eric Isaacson
Source:
TEST.ASM [COMPAT.8
Sorry, no such file

Flat assembler 1.69.32, IDA no analysis done on disassembly:

illegal instruction
instruction: .686p

Flat assembler 1.69.32, IDA analysis done on disassembly:

error: invalid name
_LARGE_INTEGER::$837407842DC9087486FDFA5FEB63B74E struc

a86, with analysis done in IDA upon disassembling:

~^
#ERROR messages will be removed if you leave these first two lines in     @@@@#

ICreateErrorInfo struc ; (sizeof=0x4, standard type)
lpVtbl dd ?     ; offset
ICreateErrorInfo ends


fd_set struc ; (sizeof=0x104, standard type)
fd_count dd ?
fd_array dd 64 dup(?)
fd_set ends


_LARGE_INTEGER::$837407842DC9087486FDFA5FEB63B74E struc ; (sizeof=0x8, standard type)
~              ^
#ERROR 06: Symbol Required                                                @@@@#
LowPart dd ?
HighPart dd ?
_LARGE_INTEGER::$837407842DC9087486FDFA5FEB63B74E ends
~              ^
#ERROR 40: Conflicting Multiple Definition Not Allowed                    @@@@#


LARGE_INTEGER union ; (sizeof=0x8, standard type)
~ ^
#ERROR 01: Unknown Mnemonic                                               @@@@#
anonymous_0 _LARGE_INTEGER::$837407842DC9087486FDFA5FEB63B74E ?
~ ^
#ERROR 01: Unknown Mnemonic                                               @@@@#
u _LARGE_INTEGER::$837407842DC9087486FDFA5FEB63B74E ?
~ ^
#ERROR 01: Unknown Mnemonic 

Is my workflow wrong?


回答1:


IDA's output is mostly geared towards MASM syntax but is not guaranteed to be re-assembleable even by it. Some of the constructs it uses to represent the binary faithfully might not be supported by any assembler.

You will need to edit the produced file to make it acceptable. For example, the ::$ used to represent unnamed C unions or structures will need to be replaced with proper characters for identifiers, e.g. an underscore.



来源:https://stackoverflow.com/questions/7152140/disassembling-changing-and-assembling-dll-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!