If you have to violate the terms of an EULA to do so, it is illegal. Although most states have laws expressly permitting reverse engineering, it is my understanding that that is not an 'inalienable right', but one you can waive contractually. (In other words, permitting reverse engineering does not prevent you from agreeing not to anyway.) Some jurisdictions go further, however, and explicitly state that reverse engineering is always permitted, even if a contract states otherwise.
If you live in the US, the DMCA generally prohibits reverse engineering if you have to circumvent a "copy protection technology" to do so, but it makes specific exception for cirucumventing it for the purpose of making something compatiable with the format.
Otherwise, it is probably legal. Regardless of the answer here, though, consult a lawyer.