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
-3
votes
1 answer

How to decompile 64-bit binary to retrieve content?

The binary file can be found here: BinaryFile I'm trying to decompile the assembly code to C/ASM to find the hidden content using reverse engineering. But given binary file is quite complex or may be i'm unable to find a tweak here. File info: ELF…
I_am_Vits
  • 47
  • 1
  • 10
-3
votes
1 answer

Decompiling Java Code

I was wondering what is meant with decompiling Java code. Does it mean that the native code is translated back to byte code and then to source code? I was also wondering which role the RAM plays when a java program is compiled. Do decompiling tools…
user9010288
-3
votes
2 answers

I lost my project and my key in android studio what to do?

Well there was an accident on my computer with it I lost my project and my key to my application. How can I decompile the application and sign with new key?
-3
votes
1 answer

Decompiled Java, pi math is in number form, simple

I have recently decompiled a Java program I had written quite a while ago, and I noticed where I had Math.pi it replaced it with 3.1415... etc, I also have gotten this weird number and I cannot figure out what it is, if it was a number I put in…
user140052
  • 176
  • 10
-3
votes
2 answers

How can I decompile an swf file and get the original scripts?

When I am decompiling an swf file, and get variables named _loc1_, _loc2 _, loc3_ ... How can I decompile an swf file and get the original scripts?
A3D AS
  • 1
  • 1
-3
votes
1 answer

Compile extracted ASM code so it can be decompiled?

I have a section of ASM code, a subroutine from a older executable that I need to either turn into a shared library, or C code so that I can incorporate it into a newer, rewritten version of the software. I no longer have access to the original…
-3
votes
1 answer

What are the best Android APK obscurators?

The APKTool made me fear of publishing my APK because it will be visible to any newbie cracker. What's the best APK obfscurators (or Coding practices) which will made it difficult for tools such as (APKTool, DEX2JAR, JD-GUI...) to decompile the…
M. A.
  • 424
  • 6
  • 21
-3
votes
2 answers

Decompile Apk but java code giving wrong layout

I just decompile a apk file and get the java codes but why does the java codes giving wrong id and layouts? Check image java code giving numbers which is not in the xml.
-3
votes
1 answer

How to configure Mocha and Crema for Java obfuscation?

I want to protect my class files from decompiling. After searching the internet the most two common names I found are Mocha and Crema. Can anyone guide me to configure them on Windows?
Abhinab Kanrar
  • 1,532
  • 2
  • 20
  • 46
-3
votes
1 answer

How to create jar which can't be decompile

Hi I have to create a jar which will be send to our client.But issue is client can decompile the jar and do changes according to his requirement. I want to create the jar such that client can't read the code and can't do any changes in it. Can any…
agarwal_achhnera
  • 2,582
  • 9
  • 55
  • 84
-3
votes
1 answer

Having problems editing a dll in visual studio

I have a file called Asembly-CSharp.dll i want to edit in C#. I decompile it with .NET reflector's FileGenerator (also tried file disassembler and dotPeek) plugin, thus creating a visual studio project, i open it in visual studio, but it fails to…
-3
votes
3 answers

assembly x86 'decompiling'

I'm having trouble understanding this assembly x86 code (AT&T notation). I need to be able to understand it (write C++ function that is compiled to that code) and solve similar exercises on the exam. Can you explain to me which part does what and…
niczka
  • 351
  • 1
  • 12
-4
votes
1 answer

How to convert from assembly into readable code in a higher level language?

I want to understand an algorithm that was written in assembler. The code looks like this MOV EAX,DWORD PTR SS:[ESP] - Put Value, entered into EAX Mov ECX, EAX - Copy value from EAX to ECX AND EAX,0xBBD13D22 - add ??? …
hoppler
  • 1
  • 1
-4
votes
1 answer

DotPeek Decompile .dll File

When i decompile a X.dll file i can't rebuild it and i receive the following errors Severity Code Description Project File Line Suppression State Error CS1001 Identifier expected Library C:\Users\ ...\Managers\RpcHubManager.cs …
MMerhi
  • 39
  • 2
-4
votes
2 answers

How to get source code from peers

I just want to have a java sip application to run in eclipse but I have'nt found a way yet. I tried various decompilers but none of them completed their work without any problems. Is there any way to copy the code of a jar to an eclipse project or…
MrGlue
  • 28
  • 5
1 2 3
70
71