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

ILSpy - How to modify the decompiled code to look like the Github source code?

My goal is to decompile a C# libarabry and compare it to the source code of the same library in Github. I would like to research whether the given source code (after decompiling) is equal to the source code in Github. I've used ILSpy to try to…
-2
votes
1 answer

Is there a difference between the address operator and a pointer in assembly?

does the compiler translate the address operator any different than a pointer? I'm wondering because the decompiler sometimes shows me: func_test(&a, &b[0x32*ebx]) which should be essentially the same as func_test((_DWORD *)a,(_DWORD…
Sawb
  • 67
  • 4
-2
votes
1 answer

decompiler project run on tomcat

I have a java project which can run on tomcat and the project now have some problem which need me to fix. They give me a ROOT file to replace the root on tomcat to let the project run.I have all the .class file and I can decompiler to see them.But,…
Feng.kai
  • 3
  • 1
-2
votes
2 answers

classes.dex file does't contain my java classes

I have developed an app in android studio and test it in my phone. I have formatted my computer and forgot to save my project to somewhere. Now i want to get my source codes back. I get the APK file from my phone (either by using adb and some other…
parliament
  • 371
  • 1
  • 5
  • 18
-2
votes
1 answer

Android:shape integer type is not allowed

I decompiled an APK (disclaimer: for personal use, not doing anything illegal) and aside from some weird unknown_attr values some attributes such as layout_width, layout_height and android:shape have integers as values. Such as:
xorinzor
  • 6,140
  • 10
  • 40
  • 70
-2
votes
1 answer

Is there any well known signature(hash) algorithm generating 8 bytes long output?

I want to scrape data via a mobile app interface, unfortunately there is a signature parameter. I tried to decompile a andorid app, The frustrating thing is that the signature algorithm is not written by Java(So couldn't view the source), it's in a…
redice
  • 8,437
  • 9
  • 32
  • 41
-2
votes
2 answers

Is it possible to change a Byte Array (4) in a Compiled Application

Me and my friend have been creating a Advanced C++ TCPClient, He created the client, and i created the server. The client has a static IP inside the code and We lost the code for the client. I am currently wondering is it possible to decompile in…
Callum
  • 725
  • 6
  • 17
-2
votes
1 answer

understanding decompiling assembly code

I have the following code that I was to decompile: movl $0x2feaf, -0x18(%ebp) mov 0x8(%ebp), %eax mov %eax, -0x14(%ebp) my problem is, I don't understand what 0x8(%ebp) means in the context. I tried the following c code: int b = 196271; int a =…
-2
votes
2 answers

Errors after de-compiling Java file Android

I tried de-compiling a Java file but instead of giving the exact code the de-compilation gave me was a code that was using goto statements and label Now i want to extract the code that was used. Can anyone help? @Override public int…
Amit Hooda
  • 2,133
  • 3
  • 23
  • 37
-2
votes
1 answer

how can i protect CIL ( Common Intermediate language ) assembly from Decompiling

can i convert CIL assembly files (.net exe files) to native exe files or exist a tool that protect or avoid from easy decompiling to magar source ? ( Not just Dotfuscator Community Edition )?
mojtaba
  • 339
  • 1
  • 4
  • 17
-2
votes
2 answers

What tool should I use to decompile Java byte code to Java source code?

If you had to decompile java byte code into Java source code, what tool would you use?
leontalbot
  • 2,513
  • 1
  • 23
  • 32
-2
votes
1 answer

How to make a Java decompiler?

As a project at some point in time, I would like to make my own Java decompiler to convert bytecodes back to plain text. I did Google for some APIs that would let me do that but I could not find any. So my question to you is: How do I decompile…
An SO User
  • 24,612
  • 35
  • 133
  • 221
-2
votes
2 answers

Decompile .swf, but no code is shown! help please

Spent two weeks creating a flash presentation hundreds of photos and the file became corrupted when Nero 7 crashed :( and my pc restarted. A quick seach told me of some decompilers (showmycode.com) could save the file... but it shows me not one…
Ron Peyce
  • 1
  • 1
-2
votes
2 answers

Reflecting a way for decompiling?

If so, how can i protect my code from being decompiled? Or from being reflected? If actually the two are very different from each other. Tools like Dotfuscator for the .Net framework, do they help your code from being decompiled? Does that mean that…
-2
votes
2 answers

How do I convert a java class into a java file?

Is there any software to convert a java class into a java file? I know decomplier is there but I was looking for software to convert a java class into a java file.
user1633823
  • 347
  • 2
  • 5
  • 14