I know the topic is difficult. But - being a programmer and no lawyer - I want to understand it as best as I can. And it would be good to know the legal issue here for all types of works, not just hacked game roms.
My research is that there are laws only against specific cases. One is, removing DRM can be illegal. And another case I found is when releasing a binary patch for a software violates the GPL, because not enough source code was provided.
What I found no answer for is the case where both researched issues seemingly don't apply. When no copy protection is removed, and when there is no original work being copied for distribution.
For example, given that a so called "rom hack" is an unlicensed diff file that can add custom-made levels to a game, what's the law that may prohibit distributing this file?
Usually such a diff file also contains some sort of link to the original work, like a hash or specific instructions that make it work. Is there a law that says, such a link from a diff file to an original work to be patched, is a use of this work? (as in fair use and unfair use)
Or is there a law that says creating or applying a diff file, which technically fits into another work, is seen as a result of a transformative use of this work? (no patch without someone using and understanding the original work at first)
Or is there a law that allows the authors of the original work to give it a license that just forbids creating or distributing unlicensed diff files?