Is it legal to use Hachoir?
Answer: I don't know :-) May depend on your country.
I think that reverse engineering may be illegal, but most file formats are standard and well known. It's not forbidden to display a PNG picture for example.
France
- (fr) Law text of intellectual property, article L122-6-1 (about reverse engineering)
- In french: Code de la propriété intellectuelle (partie législative), article L122-6-1, concerne la rétro-ingénierie.