Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to decompile an exe or a dll to assembly

I am really interested in assembly language and I want to learn about how exe files work how dlls run etc... and I have an idea of writing an application to decompile an exe to assembly code since i am not a very good assembly programmer and with the lack of knowledge of the inner working of exe I couldn't do it. Since I can read an exe in hex i think it is not impossible but I don't know how to write my own program. Any resources or any help would be appreciated.

like image 300
Keshan Avatar asked Dec 30 '10 19:12

Keshan


People also ask

Can you decompile a DLL?

Such a DLL is compiled to machine language and can only be directly decompiled to assembly language. So, again, it depends on the language used. And the answer might be that it's just not possible to get anything resembling the original source code. Then, as stated, if it's Visual Basic, research p-code decompilers.

Can you decompile an EXE?

It depends on the type of your executable. However, other types are very difficult to decompile and most likely you will not manage it. If the program was compiled from VB6, Pascal/Delphi, C++, etc. then you are lost.

Are EXE files written in assembly?

EXE file contains mostly x86 or x86-64 assembly, but it also includes a header. It would be possible to disassemble the assembly within that file into machine code.

What is assembly EXE and DLL?

An assembly is a collection of types and resources that are built to work together and form a logical unit of functionality. Assemblies take the form of executable (.exe) or dynamic link library (. dll) files, and are the building blocks of . NET applications.


2 Answers

If you're interested in what a compiled program looks like at the a assembler level a much more meaningful approach would be compile and look at the generated assembly. For example with gcc/g++ this just requires gcc -c -S filename.c and will leave a clear text assembly file to look at.

like image 138
6502 Avatar answered Oct 12 '22 11:10

6502


I think you're looking for a disassembler not a decompiler. IDA pro seems to be popular and you can download an older version for free at http://www.hex-rays.com/idapro/idadownfreeware.htm

like image 21
Matt Avatar answered Oct 12 '22 09:10

Matt