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

Can't De-Compile Windows Phone 8.1 App Installed Assemblies

I have changed settings to install apps in the SD card in Windows phone 8.1. I then got the installed apps to the PC, and I browsed to the WPSystem\Apps\{C93F42CB-C64F-45EB-A628-A24891D82A4C}\Install folder. There I found several .dll files. I tried…
Idrees Khan
  • 7,702
  • 18
  • 63
  • 111
0
votes
0 answers

Extract Audio from Jar file

So, I'm trying to extract the music from a Java Mobile game. It's Block Breaker Deluxe 2. Unfortunately there is nothing on the Internet about it, pretty much. At least about the music. I used to play this game a lot years and years ago. I want to…
0
votes
0 answers

VB.NET - Debug third party application

I'm trying to debug my .exe file (without source) using .net reflector. I want to see if the MD5 of this file will change. The problem is that also following https://www.youtube.com/watch?v=E2eFk6YQRqY this I can't see the stack calls of my…
Ferra
  • 91
  • 9
0
votes
0 answers

Deobfuscating Jar file [java]

I am trying to make a game client that is similar to one already made so I tried to decompile the program to see how they did it to give myself ideas. The issue is, when it was decompiled I found that it was fully obfuscated. Now, I've read up on…
0
votes
1 answer

Java Android - Will Decompiling and Compiling end successfully?

I want to get an app (apk file), decompile it, add a code which will send area to my server. The question: will it be ok? Decompiling+adding custom code+compiling won't occur on work and internal logic? So, will the app work as expected after those…
BuGiZ400
  • 395
  • 1
  • 4
  • 12
0
votes
2 answers

Decompiled Obfuscated Code "Cannot return from within an initializer"

I have a class file named StaticInitializer.class which obfuscated successfully. When I have decompiled it I got following result where IDE gives an compiler error "Cannot return from within an initializer". Removing "return" statement solves the…
Ahmet Karakaya
  • 9,899
  • 23
  • 86
  • 141
0
votes
1 answer

Are JAD decompiled files 100% accurate

Are JAD decompiled files 100% accurate. I am decompiling some jar files to get the source code and when i am trying to build the project with these java files it is not showing the accurate build. Does i am doing it wrong or the decompiled files are…
nikhilgupta86
  • 472
  • 3
  • 15
0
votes
2 answers

Decompile a Java project and compile

I am trying to decompile a java project(.jar) file and I am able to get .java files from it. Now how can I compile it back? I am able to add the .java files to Netbeans just as a single file.But how can I add it as a project add compile it? The…
IT researcher
  • 3,274
  • 17
  • 79
  • 143
0
votes
2 answers

Compiling a Java file out of context

I have a large pre-compiled project with lots of packages and class files. I have extracted one of the class files and decompiled it and edited some of the code inside. Now I would like to compile the changed code and re-insert it back into the…
Will Sherwood
  • 1,484
  • 3
  • 14
  • 27
0
votes
1 answer

XNA - how to determine font type and font size used in compiled XNB file

XNB files are created by Microsoft XNA and distributed with many games. XNB is a general serialization format capable of representing arbitrary .NET objects, but there are common definitions for textures, sound samples, 3D models, fonts, and…
binball
  • 2,255
  • 4
  • 30
  • 34
0
votes
4 answers

what happens when calling a non-existent method in flash actionscript?

I am a Java developer. My recent project requires me to understand some decompiled ActionScript. I think I understand most of the code since the syntax isn't much different from Java. However, it starts confusing me when I see _loc_10 = {}; if…
user2375809
  • 409
  • 1
  • 6
  • 12
0
votes
1 answer

Having problems decompiling class files

I have been working on a game for a while now and i tried to make this game as easy to understand as possible and easy to change as well by using one variable in a few places and not write the variables value in each place so that if i decide to…
bill
  • 11
  • 3
0
votes
1 answer

iOS App code recovery

My notebook has been stolen and some apps I´ve been working on were not backuped (about 2 months of developement). I have learned my lesson now :( But my question is: I have those apps on my iPad which I use as a development device. Is there any way…
Skiny
  • 405
  • 1
  • 4
  • 16
0
votes
1 answer

Cannot find the "this.b.a.q()" method in decompiled obfuscated anonymous inner class

I am reading the source code of a decompiled Java software. It is obfuscated, but I think it should also obey the Java's rules. I want this class NK$1 called this.b.a.q() method, but I didn't find anything about the b member, even for a member and…
hsluoyz
  • 2,739
  • 5
  • 35
  • 59
0
votes
2 answers

Save class to file from URLClassLoader? and decompile it?

It's possible to save class from URLClassLoader to normal file.class? and then decompile it? I trying save it just as object using Class clazz = classLoader.loadClass("foo.Bar"); FileOutputStream sf = new FileOutputStream(f); …
user2250333
  • 133
  • 3
  • 17