13

I saw this question Does requiring users to accept the GPL before using GPL-licensed software violate the GPL? That states that the GPL license does not apply any restrictions on the user. If that is the case what is there to stop a user from reverse engineering a GPL program and using the reverse engineered code in a non GPL license program?

4
  • 4
    I know you've already accepted the answer here, but I wanted to notify you that I've edited my answer to consider two very different meanings of "reverse engineering" with very different outcomes under copyright law. It's not clear to me which case you meant in your question, so I wanted to let know my answer is now worth a re-read.
    – apsillers
    Commented May 18, 2023 at 11:43
  • 4
    Wow. Folks' brains are really fried by the extralegal and heinous stuff written in "EULAs" to the point of expecting it, thinking it's normal, and expecting a free software license would even want to do the same. Of course there is nothing to stop you from reverse engineering. There never is. You have the freedom to study something you lawfully possess and come to understand how it works. Anyone whose values align with free software wants you to have that freedom and wants you to know you have that freedom. They don't want to delude you into thinking you have to surrender it. Commented May 19, 2023 at 19:54
  • @R..GitHubSTOPHELPINGICE with respect, the question isn't "may I reverse-engineer a GPL program", it's "if I reverse-engineer a GPL program, what conditions if any does the GPL place on me". The freedoms of free software are great, but they don't come without consequences.
    – MadHatter
    Commented May 20, 2023 at 6:04
  • Does the GPL allow you to reverse-engineer the code? Yes. Does the GPL allow you to use the code (no matter how you got it) in a non-GPL program? No. Well, technically you could "use" the code in non-GPL program, but you could not legally distribute the resulting program without providing the full program source code, since that's a GPL requirement.
    – Brandin
    Commented May 23, 2023 at 7:17

2 Answers 2

33

First, note that the Q&A you link says the "GPL does not place any obligations on the user of" some software. This speaks particularly about a "user" in contrast to a "distributor" or "modifier" of a piece of a software: a "user" merely executes the software as received by some upstream distributor.

Second, you are free to reverse engineer a GPL-licensed binary, though if the distributor did things properly, you should also have the source available, so reverse engineering would get you the same or worse results from what you're already free to do.

  • If you mean "reverse engineering" in the sense of a clean-room reimplementation:

    This will allow you to write code not covered by the GPL, because clean-room design avoids creating a derivative work under copyright law. This is because the author in the clean-room process works strictly from a behavioral specification (which is a procedure, not covered by copyright) constructed by others. People have been performing clean-room reimplementation for decades to produce new, identically-behaving code that isn't based on the material of the original work.

    Note that a legally rigorous defense around clean-room design is difficult to construct practically. You must adhere strictly to a separation of behavior and expression, and you must document your methodology and specifications thoroughly enough to satisfy a court that the author of the new work had no exposure to the existing work.

  • If you mean "reverse engineering" in the sense of running the binary through a decompiler:

    If you believe that reverse engineering a GPL'd binary without looking the source will exempt you from a copyleft obligation to share your changes under the GPL, this is not so. Your reverse engineered source code is still a derivative under copyright law (just as, e.g., a machine translation of a human-language novel would be) so GPL requirements apply to distribution of the derivative work, whenever you choose to distribute it.

11
  • 17
    To clarify your last paragraph a bit, reverse engineering in the sense of a clean room design could be used (at a significant labor cost) to "get around" the GPL, since it results in an independent non-derivative reimplementation of the original program's functionality. "Reverse engineering" in the sense of just running an executable binary file through a decompiler, however, definitely produces a derivative work that is still bound by the original program's license terms. (And yes, there's also a broad gray area between these two extremes.) Commented May 18, 2023 at 7:16
  • 3
    @IlmariKaronen Ah, thank you! Those are two very different actions under the umbrella of "reverse engineering" and deserve to be considered separately. I edited my answer to consider both.
    – apsillers
    Commented May 18, 2023 at 11:40
  • 2
    @TheEvilMetal: Whether a work is derivative of another is controlled by copyright law, not by the GPL. Commented May 18, 2023 at 12:55
  • 6
    @TheEvilMetal Agreed, that's what I mean by "the author... works strictly from a behavioral specification". Indeed the burden of proof that you've done so (and the subjective determination that the behavioral spec sufficiently abstracts away copyrightable expression) do make clean-room reimplementation a legally onerous prospect.
    – apsillers
    Commented May 18, 2023 at 14:27
  • 3
    @TheEvilMetal ... Companies making clean-room implementation manage to convince the courts that their code are not copies by proving that the employees who write the new code have never seen the old code. How they do it is hire a different group of employees to read the old code but are not allowed to write code. They write specifications for the code writers (who have never seen the old code) to implement.
    – slebetman
    Commented May 19, 2023 at 13:09
5

What mainly prevents users from-reverse engineering GPLed programs is that they have the source code, so they can just read that instead of reverse-engineering. :)

Whether you read the source code, or reverse engineer machine code, and then produce a copy of that code, that copying activity is not a form of use of the program. It may be deemed to be reproduction: you're copying something from the program.

If you're copying something from either the source or compiled form of a GPLed program, you're making a derived work which is still licensed under the GPL. If you redistribute it without reproducing the copyright notice, and obeying all the redistribution rules, it is infringing.

The compiled code is a derived work of the source code, and is itself copyrighted and under the same GPL. You cannot evade copyright by working with binary code.

Being free to use a GPLed program in any manner doesn't amount to being able to redistribute it, or any portion of it, under a different license and authorship.

2
  • "Reverse engineering" in the question most likely refers to a clean room design, not to disassembling/decompiling the binary.
    – benrg
    Commented May 20, 2023 at 22:31
  • 2
    @benrg "Using the reverse engineered code in a non GPL license program" almost certainly does not refer to clean room design. Clean room design requires someone to reverse engineer the logic, produce a detail requirements specification and then someone else who has never seen the code to implement the specification.
    – Kaz
    Commented May 21, 2023 at 0:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.