Questions tagged [decompiling]

Decompilers analyze binary code outputting source code in a higher level language such as C. The output is generally not any easier to analyze than the original assembler due to loss of information during compilation.

The concept of a decompiler seems simple to most people. A compiled binary was created from source code, so the operation seems like it should be reversible. However, there are some challenges that a decompiler faces:

  • Decomposing assembler to a basic block.
  • Lose of information during compilation.

Decomposing Basic blocks

Hand crafted assembler may confound analysis into a basic block, which will prohibit the creation of a control flow graph. For example, hand crafted assembler is not bound to follow a function prologue and epilogue. Assembler may make use of instructions that do not map to a higher level language. It may use self-modifying code and multiple entry points (even mid-instruction) for legitimate purposes or to foil reverse engineering. Aggressive compiler optimization may produce the same effects under some cases.

Loss of information

Comment and variable names are obviously lost information in the decompilation process. As well, compilers aggressively optimize code; a key part being to keep high level variable in registers. Because of this, a register maybe re-used for many different high level variable. This may result in the decompiled code have a different amount of variables and control structure from the original code. Also, different compilers (or even different optimization levels) generate different code for the same source code. Ie, the source to machine mapping is compiler dependent. Without hints to the decompiler, it cannot generically re-generate the same source. Often the decompiled code will resemble obfuscated code.

Cristina Cifuentes's research paper from Queensland University of Technology give more technical details of a decompiler. The Boomerang project is an example of an Open Source decompiler.

Some general uses of a decompiler:

  • Retargetting code to a different instruction set.
  • Analyzing a binary for security issue.
  • Patching code for an operating system update.

Due to the loss of information, decompiled code may not assist in understanding assembler code. It certainly can not produce the original source code. Examining decompiled code can give an appreciation of good variable naming.

See also:

1056 questions
0
votes
1 answer

apktool decompile when added external java package

I have an android .apk that decompile with apktool with 3rd party program for changing assets and AndroidManifest.XML this is the command for decompiling: apktool d someAPK.apk somefolder Now i added an external java package .jar to .apk project…
Mohamed Salemyan
  • 691
  • 2
  • 15
  • 31
0
votes
1 answer

command line API for decompiling dll file

I want to read dll contents from command line api So I can access it at run time. Is there any tool that has a CLI API for de-compiling code?
SexyMF
  • 10,657
  • 33
  • 102
  • 206
0
votes
1 answer

Convert compiled VB program to Java to use in Android app.

I have several VB programs that I wrote a few years ago in school. Is there any way possible to convert those programs to Java? Or would that it be easier to just rewrite it from scratch? My goal is to create an Android app that combines at least…
0
votes
0 answers

Decompyle .pyc failed

From my pyc file I got an error: >>> from decompile import main >>> main('','.',['D:\\uiexchange.pyc']) ### Can't decompyle D:\uiexchange.pyc Traceback (most recent call last): File "", line 1, in ? …
0
votes
1 answer

C++ constructors compilition

I have problem with compiling of constructors, when I compile program on VC6 my constructors have memory allocation (sub esp, X), but when I compile on VC9 my constructor not have it. Who know where problem? I think that problem in project settings,…
user3000633
  • 137
  • 7
0
votes
4 answers

net reflector and visual studio

I've lost the source code for one of my programs. Is there anyway to disassemble all the code in .Net reflector and then load it into Visual Studio (express preferably), and hopefully get the designer view as well?
Jonathan.
  • 53,997
  • 54
  • 186
  • 290
0
votes
1 answer

Remove goto/switch stataments after using ILSpy

I'm have some problems with using ILSpy. I'm using this tool to decomplie an DLL but it's exist to much garbages. How can i remove "goto" after using ILSpy? :'( Any suggestions? Thanks in advance.
ngvntoan
  • 82
  • 1
  • 5
0
votes
2 answers

How to remove Form icon from decompiled exe file?

I have a project exe file that I had made for a friend long time ago, now the same program is needed but with slight modifications to the code, I have used Code Reflect to decompile the exe file and recovered the MS VisualStudio solution file. Now…
zindarod
  • 6,328
  • 3
  • 30
  • 58
0
votes
1 answer

What tool can I use to decompile an executable written in VB.net and create a project?

What tool can I use to decompile an executable written in VB.net and create a project? I need to debug and fix an application, but the code is lost. Thanks.
David Shochet
  • 5,035
  • 11
  • 57
  • 105
0
votes
0 answers

Decompiling mobile client app to grab API key

Suppose you have an app that uses a proprietary authentication system based on HTTP headers and further suppose that the authentication info is hard-coded into the app (I don't know how you would do it otherwise). It hits a web service via SSL. I do…
tacos_tacos_tacos
  • 10,277
  • 11
  • 73
  • 126
0
votes
2 answers

Can't I see code of Constructors in .net reflector / other decompilers

In .net decomplilers, i'm not able to see the code for constructors. I've tested in many .net decompilers but none of them are showing constructor code. Is there any decomplier which shows that code. Thanks in advance
Shekar Reddy
  • 616
  • 7
  • 18
0
votes
1 answer

How do ISVs hide their object code when you can decompile?

My book says the following: "Clients of a class do not need access to the class’s source code in order to use the class. The clients do, however, need to be able to link to the class’s object code (i.e., the compiled version of the class). This…
RandomPleb
  • 424
  • 1
  • 5
  • 20
0
votes
1 answer

How to decompile this?

I am decompiling a google chrome extension, because it seems suspicious. The extension was written in javascript, but can somebody tell me exactly what symbols like this are, and how to "translate" them back to normal…
0
votes
1 answer

What are internal and external packages in android

I have been using tools like androgurad, dedexer and apktool to decompile android apk files and have been viewing the statistics. While analysing the packages dependencies in apk files, I noticed that there are internal and external packages. Please…
Annamalai N
  • 371
  • 1
  • 7
  • 16
0
votes
2 answers

Reverse engineer exe or DLL for C# winforms

I want to ask if there is any program I can use to decompile an exe or dll, to C# code, because, by mistake I erased the source code and I want to make modifications.
Stathis Andronikos
  • 1,259
  • 2
  • 25
  • 44