tags:

views:

129

answers:

6

I am pretty sure that reverse-engineering\decompiling .Net libraries which have no protection methods to prevent this is legal (at least in the EU and US) using tools such as Reflector. This is something that I do from time-to-time myself e.g. when faced with particular bugs, or lack of API documentation.

I am thinking of the .Net framework as an example.

However, is it then legal to make the source code obtained from decompilation publicly available e.g. by posting a decompiled C# representation of that code on a website such as Stack Overflow?

Update

This relates to publishing small samples.

Update 2

Supporting evidence for answers would be helpful.

+1  A: 

In some instances it's not even legal to decompile it. It's not yours to release, even if it's open source I'd say don't bother testing your luck there.

If something is outwardly commercial, it's definitely illegal.

Update: I have no samples. But I would say the size of the sample posted is irrelevant - if it's copyrighted or covered by IP, then even out of context, it's not yours to post.

General advice, get permission from the owners if you want to use it for a publication or academic purposes. Profiteering will likely get you a cyber-door slammed in your face.

Adam
Adam, I think you should refer to a country (legal system) when stating something like "it's not even legal to decompile". I would have a hard time getting arrested for it.
Henk Holterman
Just because you'd have a hard time getting arrested for it, doesn't make it legal :) Plus "in some instances" is generic enough.
Adam
+3  A: 

No. That code would be covered by copyright.

  • The original source is certainly covered by copyright
  • The compiled version is almost certainly covered by copyright, because it is just an alternate representation of the source code
  • The decompiled version is an alternate representation of the compiled version, so this would also be covered under copyright.

Normal copyright rules apply, e.g. you can make a parody, or cite a small piece.

Sjoerd
Would publishing decompiled code to demonstrate how someone has implemented an algorithm\feature come under "cite a small piece"?
chibacity
In the US it is called "Fair use": http://en.wikipedia.org/wiki/Fair_use
Sjoerd
A: 

I'm no legal expert so you should seek advice if you intend on doing this.

However, if the code is open source, there is usually a license that explains what you can and can't do with it. If it is not open source, there should be a copyright notice (either explicit or implied). You may also want to talk to the original source code's author who may give you limited rights. Just taking someone else's code and publishing it is almost certainly a breach of copyright if done without such permissions. The fact that .NET code is easy to reverse engineer doesn't make it automatically publicly distributable.

BlackWasp
A: 

I'd say it depends on the license. Anything out of reflector would fall in the "reverse engineering" clause of most software licenses, which you've agreed to when purchasing the software.

Anything remotely interesting will be obfuscated anyway :/

Spence
A: 

In general no, the code remains copyright of the original authors.

In the specific example of .NET, the EULA is an extension of the OS's EULA which explicitly states you cannot reverse engineer or decompile the application (note though that EU law overrides this and allows you to do this for the purpose of interoperability, but you still can't publish the code).

Paolo
A: 

Mono developers aren't even allowed to look at .NET decompiled code. If they do they are disqualified to implement any open source version of the .NET framework, including Mono.

Jader Dias
@Jader That is a very interesting point. As another example, I have a friend that works at a company where the official policy is "no looking at decompiled or the available source for the .Net framework".
chibacity