What, more exactly, is illegal? Reverse engineering is not illegal (in no jurisdiction that I know of). And neither being in violation of a EULA or a TOS.
If the EULA explicitly states you are not allowed to reverse-engineer the product, which is so common I've never seen one that doesn't say so (I'm not saying it's impossible, I'm saying I haven't see it) then... doing so is a breach of the terms and therefore illegal by definition.