By virtue of having written a program, a developer automatically retains the exclusive right for all of that under copyright. Except reselling it -- he doesn't have the right to restrict resale. Specifically, those two actions fall under the exclusive right of a copyright holder to create derivative works. No EULA is needed to protect against the end-user doing those things.
In the case of free (but not public domain) software, a license is given. That license is what lets others freely distribute the work, and make derivative works, without infringing on the author's copyright.
The bottom line here is that whatever restrictions that the software developers want to put on their software to make money is what they do... :-)