It all depends on the laws in your country and the intent behind which you are reverse engineering the file format. You need to check with an attorney/lawyer/barrister to be certain. Have you checked with the company that owns the file format to see if there is a published spec or other information that would allow you to interoperate without the need to reverse engineer?