Disclaimer: IANAL. Usually the answer is “it depends.” Are you creating a derivative commercial game? Probably it is not so legal. Are you doing that to be “compatible” with that game? It's legal. Are you just researching the internals of the game? It's legal.
For example: I know people who ported game engines by reverse engineering and even copying parts by decompilation & adaptation and, except when they tried to distribute copyrighted things (libraries, graphics, etc…), it was considered legal. Also, please remember that if you're using, say, SAMBA in MacOSX/Linux or Open/LibreOffice, you're actually using code that was reverse engineered from their commercial counterparts and published in open source codes.
In short: derivative products or anything with the aim of damaging a company or getting an economic benefit, is probably not so legal. Research, compatibility and porting is.