Decompilers : Ethical or Unethical

Tanaya Gogawale
6 min readJun 18, 2022

Considering that we have basic knowledge of what compilation is ? Let’s move to the decompilation process. We will be going through basics of decompilation, some benefits of decompiling , ethics of decompilers and then we will be digging into the legal aspects of decompilation process.

Let’s see what decompiler and decompilation actually is ??

Decompilation is the process of converting executable or ready to run program code i.e. object code into some form of higher level programming language that humans can easily understand. To convert a programming code into a working program, it must first be compiled i.e. converted into a series of binary bits or digits (that is, 1s and 0s) that can be understood by the computer. This operation can be reversed by decompiling the final program. That’s why decompilation is a type of reverse-engineering that performs the opposite operations of a compiler. The tool used to decompile software code and translate it into a human-understandable form is known simply as a decompiler. Decompilers examine the semantics of the instructions in the machine code generated by a compiler and attempt to generate source code

Fig.1.Process of Decompiler

Decompilation follows below mentioned steps:

  • Disassembly- transformation from machine code to the assembly equivalent. There are a surprising number of pitfalls here.
  • Lifting and dataflow analysis — transforming the resulting assembly code into a higher-level internal representation, such as our three-operand assembly. One of the tricky parts here is recognizing distinct variables, and detaching variables from registers or addresses. We also recover expressions, function return values and arguments.
  • Control flow analysis — recovering control flow structure information, such as if and while statements, as well as their nesting level.
  • Type analysis- recovering types of variables, functions, and other pieces of data.

Benefits of Decompiling

Now we have idea about what decompilation is and what is process of decompilation so I guess this is good time to discuss the benefits of decompiling.

Even if the results of the decompiling process are not fully accurate to the original source code, there are some benefits to this process as well. These benefits apply to three categories, depending upon their application.

1) Analyzing

2) Error checking and Evaluation

3) Updating and Optimization

Ethics of decompiler

Here the question arises of If decompilation is possible to a certain extent, is it then allowed?

Firstly ,Decompilation can be used for a number of reasons, including

  • Recovery of lost source code (by accident or via a disgruntled employee),
  • Migration of applications to a new hardware platform,
  • Translation of code written in obsolete languages not supported by compiler tools nowadays,
  • Determination of the existence of viruses or malicious code in the program, and
  • Recovery of someone else’s source code (to determine an algorithm for example.

Throughout the world, computer programs are protected by copyright law. Copyright protects the expression of an idea in the form of a program, hence protecting the developer’s (or company’s) intellectual property on the software. Copyright law provides a bundle of exclusive rights to the software developer, among others, the right to reproduce and make adaptations to the developed computer program. It is a breach of these rights the making of reproductions and adaptations without permission of the copyright holder. Further, license agreements may also bind the user to operate the program in a certain way and to avoid using decompilation or disassembly techniques on that program.

Different countries have different exceptions to the copyright owner’s rights or precedent has been established in court proceedings. This means that these uses are allowed by law. The most common ones are:

  • Decompilation/disassembly for the purposes of interoperability (to another piece of software or hardware) where the interface specification has not been made available.
  • Decompilation/disassembly for the purposes of error correction where the owner of the copyright is not available to make the correction.
  • To determine parts of the program that are not protected by copyright (e.g. algorithms), without breach of other forms of protection (e.g. patents or trade secrets).

Legal Aspect:

US:
Under American law, until recently, there were no explicit provisions about decompilation or reverse engineering. The basic copyright law that has been amended from time-to-time just provides fair use exceptions and courts are left free to interpret fair use.

In 2010, the Library of Congress with the US Register of Copyrights, provided six additional classes that would not be considered infringement.

Europe:

The person having a right to use a copy of a computer program shall be entitled, without the authorization of the rights holder, to observe, study or test the functioning of the program in order to determine the ideas and principles which underlie any element of the program if he does so while performing any of the acts of loading, displaying, running, transmitting or storing the program which he is entitled to do

Requirements:

  1. Posses a legal copy of the program
  2. Modifications said are not readily available
  3. Should not be modified unless for the goal of interoperability with other products
  4. The said program should not be shared unless to achieve the goal of interoperability.
  5. Should not be used to develop a similar product (copyright infringement)

India:

Under Indian law the scope of section 52(1)(ab) is limited to the purpose of achieving “interoperability” between two or more computer programs, section 52(1)(ac) broadly allows for the “observation, study or test of functioning of the computer program in order to determine the ideas and principles which underline any elements of the program while performing such acts necessary for the functions for which the computer program was supplied”, and thereby allows for decompiling a computer program.

Are they Ethical or Unethical?

Decompilers are considered illegal according to the software’s EULA or Terms of Agreement. The user shall not transfer, distribute or dissemble in any way, in whole or in part, any of the software (From companies Terms of Agreement)Most companies that produce software have a part like this in their Agreements or EULA. The part dissemble means decompile. Usually by having the software on your computer, you are bound to the EULA or the Agreements, just like a legal contract, so by using a decompiler is therefore illegal, because you are violating the legal contract. The original point of the decompiler was to help the programmer who owned the program to get their source code back, in case they lost the code.

Not all uses of decompilers are Illegal.

Decompiling is absolutely LEGAL, regardless of what the shills say. At most, you can be sued for unauthorized activity relating to software unless you’re redistributing it. Courts in the U.S. have always upheld the right of users to know exactly what code is being installed on their systems by programs they have legitimately obtained.

It is your right to decompile any software you purchase or freeware you download as long as you do not redistribute it or sell it to third parties. It is also legal to talk about your discoveries. You need to read between the lines of a software contract that is written for the interests of the big corporations.

Now let’s move to the conclusion part

Talking about the ethnicity of decompilers, we don’t think decompiling a program to see how it works should be considered unethical. Besides, reverse-engineering is clearly not illegal as ‘theft’ is ‘breach of property’ law and this at worst can be called ‘breach of contract’. Software is something that comes as a result of investment of time. It may contain some nifty techniques but we don’t agree to the fact that it will damage the value of the product, if those techniques are publicly known. Also, for 99% of the code there, the efforts needed to decompile the code and then understand it are much more than writing the code in its first place.

As long as developers use knowledge gained from decompilation to learn the underlying techniques and not do a cut-paste job and use it into their own codes, we don’t think they are doing anything unethical. Also, as far as one obeys the country laws, decompiling would remain ethical.

And this is how I think we made it clear if decompilers are ethical or unethical. please let me know your views and suggestions below in the comments.

Authors :

Tanaya Gogawale

Aditya Honrao

Sayali Kadam

Shweta Lokhande

--

--