views:

1237

answers:

7

Is it legal to add support for a 3rd party file format in my application by reverse engineer a unencrypted binary file format from another application, and reading the contents?

+10  A: 

Depends on your location. In the EU it is specifically permitted (article 6 EU software convention) to "reverse engineer file formats for the purpose of interoperability"

In general it's hard to prevent someone reading a file format, there have been examples where you are prohibeted from writing a file because the format contains patented technology (if software patents are allowed in your country). This was the case with GIF for a number of years.

Martin Beckett
+4  A: 

Depends on the format in question, your location, etc. And this is not "cracking", more like "reverse engineering".

Consult a lawyer, with licenses of the applications that produce the formats!

NeARAZ
+1  A: 

IANAL, but yes, I'm pretty sure it is legal, as long as you don't circumvent some copy-protection system or something. See as an example OpenOffice being able to read Word documents.

Epaga
+1  A: 

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?

Scott Dorman
A: 

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.

Nick Johnson
EULAs cannot override state or federal laws, which is why they generally say something along the lines of "except ... to the extent that applicable law expressly permits", when talking about reverse engineering. The DMCA has explicit exceptions for reverse engineering in specific situations.
Chris Upchurch
@Chris: If you sign a contract saying "I will not reverse engineer x", and there is a law saying "reverse engineering is allowed", you are still liable under contract law if you violate the contract. In other words, reverse engineering is not an inalienable right.
Nick Johnson
@Chris: You're right about DMCA exceptions, in that the DMCA says you _may_ circumvent copy protection measures if you're reverse engineering for compatiability purposes. I'll fix the answer.
Nick Johnson
Depends on the country. if the law says "You may reverse engineer" and you sign a contract "You may not reverse engineer", the contract is invalid in some Countries (Germany for example). Hence most contracts contain "If one point is invalid, the contract itself stays valid". Laws > All.
Michael Stum
@Michael: Doesn't that mean that, in Germany, a contract couldn't restrict you from doing _anything_ you're otherwise permitted by law to do? And wouldn't that make contracts rather pointless?
Nick Johnson
@Arachnid: the laws of some jurisdictions do not allow companies to have EULAs that say "I will not reverse engineer X", which is why most EULAs with reverse engineering provisions have exceptions like the one I quoted earlier. See section 5 of the Windows XP EULA, for example.
Chris Upchurch
Ah. Good to know - and good to have, IMO. Though it's standard contract verbiage to have the "valid in whole or part" boilerplate in _any_ contract.
Nick Johnson
Arachnid: Exactly, in Germany, you cannot restrict me from doing anything the law permits, but of course you can restrict me from anything else in contracts. This is one of the reasons why Microsofts OEM-"Only For Sale with a new Computer"-Restriction does not apply in Germany.
Michael Stum
(Note that there may be edge cases like B2B, but on a high level Law > Contracts)
Michael Stum
What if you yourself never agree to a EULA? There are "clean room" techniques where one team reverse engineers and documents, and another team implements from the first team's docs. What if a third team does whatever's asked after agreeing to the EULA?
David Thornley
You can also terminate the EULA. If you want to be ironclad, have a lawyer do it. Many places have laws prohibiting contracts of indeterminate length so "never ever reverse engineer" clauses automatically terminate.
Zan Lynx
A: 

I wonder if this is covered by the DMCA in the US? As always, your best bet is to ask a lawyer.

Mark Ransom
Title 1 of the DMCA contains some exceptions for reverse engineering in specific situations.
Chris Upchurch
+1  A: 

ArsTechnica recently published a nice article about the legality of reverse engineering in the context of Google Chrome using undocumented behavior in windows for some of it's security protections (to achieve DEP on some versions of Windows XP, for example).

Chris Upchurch