I'm working on a piece of code which is free to use, but when a license code (or serial key or any other term like that) has been bought will remove some advertising.
The code will be freely available as open source, probably under a GPL license, but of course I would rather not have people messing around with the code that verifies the license code with an external provider.
Is there any way to legally protect this piece of code from being modified, or at least from being distributed after being modified, keeping the rest of the code "open"?