5

I'm working on a commercial application that requires .NET 4.0 Client Profile, but I need to make a call to HttpUtility.ParseQueryString, which is not included in the Client Profile but it is in the normal one.

So I just figured out that I can use Reflector to get the whole method and all the other required methods for it to work and add it to my app. This way I won't need to change the requirement from Client Profile to the normal one which is a lot heavier just to call a single method. Would this be illegal? Do I have to change the applications target framework just for a single method?

9
  • 5
    That probably depends on the licensing terms and advice from a lawyer... Mar 30, 2011 at 18:08
  • 1
    Parsing query string in Java: It's a java implementation, but it is straight forward and likely would not be hard to port. Then you don't have to worry about trying to get around things. Mar 30, 2011 at 18:15
  • @unholysampler - Oracle may sue you a new one though. Mar 30, 2011 at 18:20
  • 1
    I support writing your own parser as suggested by @unholysampler, and think @ChaosPandion must be kidding as parsing and decoding a string has nothing to do with Oracle.
    – Fosco
    Mar 30, 2011 at 18:27
  • That code requires a call to URLDecoder.decode. .NET Client Profile doesn't include a url decoder :( That's actually one of the methods I would need to reflect.
    – Juan
    Mar 30, 2011 at 18:28

7 Answers 7

11

You may not decompile Microsoft's assets.

However you don't have to.

There is an open source project that has the class & method you need. It's called Mono and here is the direct link to it:

https://github.com/mono/mono/blob/master/mcs/class/System.Web/System.Web/HttpUtility.cs

3
  • You should not assume that Mono's code is in the clear, just because MS hasn't challenged it in court doesn't mean they won't. Realistically, you're probably okay as long as you're not a large company working on a huge open source project, a la Google and Android.
    – hambone
    Mar 30, 2011 at 21:17
  • @hambone: that's an excellent point, and yes, if I was a very large company, I would note invest too much in Mono. But I'm no expert, it's just a feeling.
    – user2567
    Mar 31, 2011 at 5:19
  • 3
    @hambone, if mono gets stopped it would be by a proprietary patent that would affect you even if you didn't use their code. Don't spread paranoid FUD if you're not going to be accurate.
    – DougM
    Mar 28, 2014 at 19:04
2

We had a similar situation and we asked Microsoft's lawyers. They (eventually) responded that they regarded it as falling within the "fair use" provisions of copyright law. We used their source code on that basis.

As any competent lawyer will tell you, fair use:

  • allows you to copy and use small parts of a copyright work without seeking permission, depending on the purpose and other factors
  • usually allows commercial use regardless of any other terms in any licence
  • varies from country to country (the term is specific to the USA, the concept applies elsewhere).

This article is pretty good: http://en.wikipedia.org/wiki/Fair_use.

Note: reverse engineering of small parts is not a problem. It's what you do with the source code that matters.

Note: using Mono source code does not solve the problem. It just binds you to the Mono licence instead, unless you (again) rely on fair use.

If you plan commercial use or may cause damage to anyone, you really do need competent legal advice. It won't protect you, but it will tell you the risks and how to mitigate them.

1

I wonder.

Considering Microsoft has recently posted an entire browser for their source code at http://referencesource.microsoft.com/ and the license in the help does not seem particularly restrictive this might become a lot less ambiguous now.

0

I've run into a similar issue as you, and I referred to the Support Services agreement of the software I wanted to deconstruct. It was section 5: "not to disassemble or reverse engineer the SOFTWARE."

I did it anyway, so I suppose I'm in breech of contract at least. But in hindsight (and going forward), I've decided not to do it anymore.

Another thought I have is: if they didn't want their software so easy to disassemble, they shouldn't have written it in .Net.

Obviously, I have ethical standards that I must abide by as a professional and a representative of the company I work for, but I don't believe that you would be committing a crime if you did not reveal any secrets of the software or attempt to sell their proprietary code. Of course, I'm not a lawyer.

0

Probably not.

The EULA for redistributing the .NET Framework says this:

Microsoft grants you a license to use [the framework] under the terms and conditions of the OS Product EULA for the applicable OS Product [on which the framework is installed]

In essence, the framework is licensed under the same terms and conditions as the Windows operating system it is installed on.

I'm pretty sure that there is a "no reverse engineering or disassembly" clause in every Microsoft OS since the beginning of time, so no, it's not legal. I doubt they would really sue you over a small bit of code lifted from a later version of a framework that they essentially "give" to everyone free of charge, but it does give them a ready excuse to do so if they wanted to.

Here's the problem: Microsoft can't support your modification. Because you've "broken the seal" on the Framework as it were, you've essentially "voided the warranty." There's no way that Microsoft can predict or guarantee what the behaviour of your lifted code will be outside of its hermetically-sealed environment.

0

This is probably not legal due to the normal conditions about no reverse engineering / no disassembly.

It is certainly immoral. One way or another you would be passing off the work of another as your own.

If using any code from Mono, be very careful to check the license conditions for that also - for example if Mono is GPL [I have not checked, and won't be... but you should] you may wish to be very careful about lifting code from it.

0

There's a technical argument against reverse-engineering Microsoft's products: your findings may become obsolete when Microsoft releases the next version, and your application may break then.

There are numerous cases where this has happened. See here:

3
  • +1 for a valid technical reason why not Mar 30, 2012 at 15:46
  • -1, this is not universally true. If you reverse a given function and all of its dependencies (if any) to create a parallel implementation, it will not suddenly stop working. You obviously won't get any enhancements or bugfixes made to the original, but for something as well-established as URL parsing there aren't likely to be many of either.
    – nobody
    Mar 28, 2014 at 18:43
  • @AndrewMedico I've edited the post to change "will" to "may", which should address the larger part of your criticism. However, I would question the idea that it's practical to reverse engineer a function and all its dependencies.
    – user16764
    Mar 29, 2014 at 0:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.