GPL is a copyleft license where, if I make modifications to the source code and distribute the resulting binary, I need to provide the modified source code also under the GPL.

What happens if I make modifications to the binary alone, leaving the source code unchanged? For example, if I compile a binary from GPL'd source code, modify it using a hex editor, then distribute the modified binary, how does the GPL affect me?

  • Do I need to provide the source code under GPL, even though it is unchanged? If yes, do I need to provide it myself, or is linking to where I obtained it sufficient?
  • What about the binary modifications? Do I need to provide the unmodified binary? A description of the modifications I made, and in what format?

The GPL, version 3, has the following to say about distributing modified copies of a covered program in a form other than source code:

Section 6:

You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: [list of acceptable ways to convey source code]

From section 1, the definition of Corresponding Source

The “source code” for a work means the preferred form of the work for making modifications to it. “Object code” means any non-source form of a work.

The “Corresponding Source” for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities.

Since you're distributing a program in non-source form, you need to provide a way for people receiving it to get the source code, including whatever is needed to make your binary modifications (a binary patch, a set of hex values to change, or whatever the preferred form is).


If you hex-edit the binary then the original source becomes less relevant and you have effectively made the new binary "the preferred form of the work for making modifications". Certainly if I wanted to make further changes to your binary I would prefer to hex-edit the binary, not edit the original sources.

Hence the new binary now is the source code.

It is also a derivative of the original, and the GPL applies to it as completely as it were a "normal source" derivation.

This interpretation is entirely speculative (and I advise you not to rely on it without real legal advice), but it does seem to be a consequence of the phrase "the preferred form".

  • 2
    This answer is partially correct but also dangerously wrong. If it were correct as-written, making binary modifications would be a trivial way to bypass the GPL, but obviously it's not. The binary + patch is not the "preferred form of the work for making modifications" unless the modifications to be made are simply binary patches on top of the existing binary patch. Rather, the new source code is probably going to be the original source, plus exact build script needed to recompile the same binary, plus the binary patch. – R.. Jul 7 '15 at 14:09
  • If the binary patch is in a form where it could be applied to substantially different binaries (e.g. built with a different compiler version), which might easily be the case when it's a matter of just replacing strings like pathnames or something, then a patch script that's likely to work with new binaries might be acceptable without ultra-detailed information on reproducing the original binary to patch. – R.. Jul 7 '15 at 14:12
  • @R.. I do not see how the answer makes it any easier, nay "trivial", to bypass the GPL, especially as the effect of the answer is that the modified binary remains subject to the GPL. And hex-editting is the preferred way of editing the new binary, because there is no "new source code". The OP is asking about distributing a modified binary only. I further think a patch script is irrelevant here as that is a separate piece of software, subject to its own copyright and license – jalanb Jul 7 '15 at 15:26
  • @jalanb The trivial way to bypass the GPL comes if the binary changes are not the result of direct binary patching - i.e. this could be taken to mean that providing a binary patch is as good as providing changed source, which in turn would mean that changing source code and then distributing the binary patch for the new binary instead of the changed source code is acceptable practice. – Cubic Jul 7 '15 at 16:06
  • @Cubic How is "a binary patch" relevant to the question? And who "could take it to mean ..." and how would they justify that? – jalanb Jul 7 '15 at 16:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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