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

How can I edit .jar class file in android studio

I've downloaded such an open source android project from github repo. , and the classes which I want to edit are under build/intermediates/exploadded-aar/ly.img.android/photo-editor-sdk/2.0.13/jars , then there is classes.jar folder , inside this I…
-1
votes
1 answer

how and why Golang binary shows file and line info on the error

i was playing around with go sync groups and i just tried what happens if i add more groups than i mark done . and i get the runtime error i posted below. So the question here is if go is compiled into true machine code unlike java or c# how come…
nikoss
  • 3,254
  • 2
  • 26
  • 40
-1
votes
1 answer

recompiling a new apk after decompiling and modifying the previous apk

I have de-compiled an apk file using apk-tool (command: "apktool d file.apk") and changed some xml parts. Also I have the jar file using dex2jar. I opened jar with java de-compiler and selected "save all sources". Then I unzipped it and changed some…
jihizo
  • 11
-1
votes
2 answers

How to recover source code from its executable file?

I lost my source code file code.c on my Linux virtual machine. It is a code I wrote some months ago, and I need to open and read it now. But I cannot find it anymore. All I have is the executable file c after compile it using GCC like this. $ gcc -o…
Samah
  • 61
  • 1
  • 10
-1
votes
1 answer

How to decompile a file to it's original language

I've been looking through files since I got Notepad++, and realized that I could edit them with it, so that's what I did, but just got something like this: uí9öuókuø9öu¸huû9öu¸h+uü9öu#Æ=ué9öuþ9÷u:öuK§uß9öuók-uÿ9öuþ9auÿ9öuK§(uÿ9öuRichþ9öu. At first,…
Flostin
  • 30
  • 1
  • 6
-1
votes
1 answer

dotPeek decompile dll

So we had one old dll at our server, which was made by us, and source code was lost long ago, i tryed to debug .dll file (was made by one of our programmers) and the decompiled code was a bit protected so in some classes variables are like…
HyperX
  • 1,121
  • 2
  • 22
  • 42
-1
votes
1 answer

Java decompiled code

I just decompiled some java code and found something like that public class Example { private static String test(String s) { String[] test = new String[1]; ExampleObject exampleObject = new ExampleObject() { public…
stonar96
  • 1,359
  • 2
  • 11
  • 39
-1
votes
1 answer

How to copy paste audio track from/to mp4

i have 2 video streams, DVD is a big (4.6 GB) iso file white a dutch audio track (it's my own dvd) Mp4 is a small (800MB) mp4 file white a eng audio track. I search for a tool that van pick the audio track from the DVD and place it in the mp4, how…
jens123
  • 11
  • 3
-1
votes
1 answer

About decompiler

i try to open .exe something (i think visual basic language) ex. Private Class JtoJyfwFywdp0oMhf7T82oYvUAlifLO1N3P64NAlifLO1N3P64NAT9q3iTiG85jA Private YWWmY1YGZHRJ1YWWmY1YGZHRJAcyz5jqj3lGWaAXJ0BrSt4pTmrAXJ0BrSt4pTm0 As String() Private…
-1
votes
1 answer

Obfuscation of android app

Is there any way to reverse engineering the ProGuard files? I wrote a program and want to obfuscation it, but I am worrying at the same time is there possible somebody clear it up? Is it any application that obfuscation the android codes better…
user3266062
  • 522
  • 1
  • 7
  • 21
-1
votes
1 answer

How to modify code to the initComponents() method on Net Beans?

I know this question is similar to another question in stackoverflow. But it doesnt same. I want to modify initcomponents method because I have old version source code of my jar file , and I have my new jar file(source code is deleted by…
user2942715
  • 19
  • 1
  • 7
-1
votes
1 answer

Net Reflector decompile issue - wrong method names etc

Hello i try to restore 1 of my old app's source code, i tried to do it via NetReflector 8.1, but when i use it all the method / vars names are weird and incorrect for example: this.NvbptLvr7r.Text = this.BvTcVeQN3(kaynak,…
Dan272
  • 213
  • 1
  • 3
  • 11
-1
votes
2 answers

How to decompile an Android .apk file?

i would like to decompile on my MAC OS X, an Android .apk file. It's possible but i have some difficulties. JD GUI is down. What is the solution?
user785975
  • 169
  • 1
  • 3
  • 11
-2
votes
5 answers

Is there any C# decompiler that can show the coding almost identically to how it was written?

I've been using reflector to decompile a couple simple c# apps but I notice that though code is being decompiled, I still can't see things as they were written on VS. I think this is the way it is as the compiler replaces human instructions by…
okr
  • 135
  • 1
  • 5
  • 13
-2
votes
1 answer

Is there a way to extract C++ code from a Windows .exe driver or a Mac OS driver?

I have a Freestyle Libre 2 blood sugar meter, and it uses a driver to upload results to the website. Unfortunately this driver is written in C++ and only compiled for Windows and Mac OS. I use Linux and have tried installing in a virtual machine and…
figgyfarts
  • 126
  • 8