This is a tricky legal area. You may not be doing anything illegal if all you do is strictly hack the ROM to make it do what you want, but if you copy its contents (which, BTW, is required to hack the ROM), you're breaking the law.
One could distribute a patch, containing no data from the original ROM and requiring it to build the hacked ROM.
But to create a patch, you'll need the contents of the ROM, which gets into a tricky legal area.

Find content
Male