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
2 answers

decompile apk and inject code

Is there a way to decompile apk (Launcher2.apk from ics) and to edit it's code and compile again? I need to replace toast message "Shortcut Installed", with code that sends custom broadcast or creates file on sd or signals it some other CATCHABLE…
POMATu
  • 3,422
  • 7
  • 30
  • 42
0
votes
2 answers

developing decomplier for java byte code or from class diagram

iam planning to develope one application, which will take java byte code or class diagram or metamodel as an input and produces the source code according to package structure. But i need some suggestions like, How to start this application, mean do…
developer
  • 9,116
  • 29
  • 91
  • 150
0
votes
1 answer

apk file that cannot be decompiled

I have been searching over the internet and in the stackoverflow as well and found that and apk file CAN BE de-compiled with some efforts using dex2jar and then there are many de-compilers for jar files. Some people told me that ProGaurd can…
Nishant Soni
  • 658
  • 1
  • 9
  • 19
0
votes
1 answer

Outputting plain source code from

I have a application that spits out the same error each time i do something specific: Exception EListError in module foo.exe at 000277CF. List index out of bounds(0) (Physical address: XXXXXXX) As a programmer I would love it if there were a way I…
Jason94
  • 13,320
  • 37
  • 106
  • 184
0
votes
1 answer

Does anyone use the generated entity classes on a large project?

In the NerdDinner example they use a repository pattern to decouple the business from the data layer. But then they use the Linq to SQL generated classes (Dinner specifically) as the entity class used throughout the project. So how decoupled is that…
Dan dot net
  • 6,119
  • 5
  • 28
  • 25
0
votes
2 answers

.lib files and decompiling

I have a .exe which is compiled from a combination of .for (fortran), and .c source files. It does not run on anything later than Win98, due to an error with the graphics server: “access violation error in User 32.dll at Ox7e4467a9” Unless there is…
0
votes
1 answer

Is it possible to read source code of a program compiled with microsoft visual c++?

I know there are tools for decompiling C# programs. Is using microsoft visual c++ make the code vulnerable for reverse engineering ? What is the best tool and best programming language for hiding source code ? Or is there any ?
mirza
  • 5,685
  • 10
  • 43
  • 73
0
votes
1 answer

MFC decompile to any code not assembly

Possible Duplicate: Is there a C++ decompiler? Is there a decompiler that will work on Visual Studio 6 C++ I need any way to decompile exe file which written in MFC, I tried IDA Pro, but it convert the file into assembly and no so good, because…
SWE
  • 131
  • 2
  • 7
  • 20
0
votes
2 answers

Finding embedded DLL resources

I'm using a decompiler to look at a DLL I built a while ago because I don't have the original source anymore. I want to see what a specfic value for a resource string is, but I can't seem to find them. I embedded the resource file, so I figured I…
Josh
  • 10,352
  • 12
  • 58
  • 109
-1
votes
2 answers

How do I decompile java .class files in my C# program?

So, I'm making a C# code editor for Minecraft java edition modding. I want to add a decompile feature, like IntelliJ Idea has, so that I can re-create a mod's source code with just a few clicks. To clarify, I want a way to decompile Java .class…
-1
votes
1 answer

"Cannot find extension method" error occurs when decompiling C# assembly

Because of the needs of the project, I need to decompile the C# assembly. Using Relector on the recommendation of a colleague Here is an example: internal class WebTreeDialogPage : WebXmlHttp2Page { public WebTreeDialogPage() { …
Bob Shd
  • 23
  • 4
-1
votes
1 answer

.Net Decompiler and Editor for Linux

I am looking for an application like dnSpy but for linux, I need to be able to edit the code of the binary and also search for methods.
-1
votes
1 answer

Recompiled APK doesn't get Update from Google Play

I de-compiled APK using APKtool and did not change anything latterly nothing has been change and then I recompiled the APK and install it and everything working fine. However when I try to update the app from Google Play the new app refuse to update…
-1
votes
1 answer

Can I decompile Genero .42r/.42m files?

I have an old project that was developed by Genero Studio, but I don't have the source code files (.4gl) of the project. I only have the executable files (.42m/.42r). Is there a way I could view the code of those files and/or modify them?
-1
votes
1 answer

How would I dump files from an APK?

I was looking to mod a game as I really felt like adding a few extra things. It is a mobile game so I got the APK and moved it onto my computer, and began to decompile it. I know it uses the Unity engile so I looked for the .dll files but I couldn't…