Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I'm writing an article for my blog about undocumented functions which exist in the dwmapi.dll library. I want to post the result of the disassembled code to explain how the names and parameters of these functions are obtained, something like the article from this blog. This is only for educational purposes to show a couple of samples using these undocumented functions. So the question is: Can I post the disassembled code of this library on my blog?

UPDATE : There exist a couple of applications like Aura which uses these undocumented functions (DwmGetColorizationParameters, DwmSetColorizationParameters), obviously the authors in some point disassembled the dwmapi.dll file in order to get the parameters and functions names. But they (the authors) only publish the final source code to access to these functions. This makes me think that I can disassemble in private a Microsoft dll and then publish an application or source code based in this research. Is this correct?

share|improve this question
9  
I wouldn't be relying on any answers from here for this question –  John Shaft May 5 '11 at 7:14
10  
General tip: "Is it legal to [insert action here]" = consult a local lawyer –  Gary Rowe May 5 '11 at 8:06

6 Answers 6

up vote 12 down vote accepted

4. LIMITATIONS ON REVERSE ENGINEERING, DECOMPILATION, AND DISASSEMBLY. You may not reverse engineer, decompile, or disassemble the Software, except and only to the extent that such activity is expressly permitted by applicable law notwithstanding this limitation.

I'd say no, it's not legal.

Edit for clarification:

Simply put, by posting disassembly on your blog, (imo) you're playing with fire. I'm far from a legal expert, but I'd assume that there are legal loopholes that Microsoft lawyers could use, such as physical location of your blog provider's server. Even though your local laws may say one thing, if Microsoft decided that what you posted was sensitive enough (chances in this case are not as it's old tech), I'm fairly certain that their barrage of top notch lawyers could find some way to pursue you legally. So simply put (again, imho), the risks far outweigh the potential gains.

Having said that, @David Thornley is correct in his comment: Consult a lawyer about your local laws, as it's the only way to make sure that you're covered.

share|improve this answer
4  
Actually, according to that quote, it appears to depend on where he lives and what the law there says about it :) Although I agree that without consulting a lawyer, the safe choice would be no. –  Deckard May 5 '11 at 6:34
1  
@deckard: Agreed. EULA's always give me a headache with their legal jargon :P –  Demian Brecht May 5 '11 at 6:36
1  
@Demian where is located the document which you quote? –  RRUZ May 5 '11 at 6:38
1  
@RRUZ: microsoft.com/windowsxp/eula/home.mspx. dwmapi.dll is a window manager API, so it should be covered under the Windows EULA. Interesting.. The bullet number should be 4. not 1. (looks like a formatting bug) –  Demian Brecht May 5 '11 at 6:43
5  
It will depend on local law about reverse engineering, local law about whether EULAs are enforceable, and possibly whether somebody actually agreed to that EULA and/or what counts as agreeing in your jurisdiction. Get a lawyer who understands the appropriate law where you are going to do this. It's the only way to be sure, and consulting a lawyer now is much cheaper than defending a lawsuit later. –  David Thornley May 5 '11 at 14:32

Generally it's allowed if your local law explicitly allows so.

Since you live in Chile, it's perfectly legal for you to do reverse-engineering. The law explicitly allows it for interoperability and for research & development. See: http://pumarino.blogspot.com/2010/10/ingenieria-inversa-en-programas.html

Artículo 71 Ñ. Las siguientes actividades relativas a programas computacionales están permitidas, sin que se requiera autorización del autor o titular ni pago de remuneración alguna:

b) Las actividades de ingeniería inversa sobre una copia obtenida legalmente de un programa computacional que se realicen con el único propósito de lograr la compatibilidad operativa entre programas computacionales o para fines de investigación y desarrollo. La información así obtenida no podrá utilizarse para producir o comercializar un programa computacional similar que atente contra la presente ley o para cualquier otro acto que infrinja los derechos de autor.

Now, publishing results of disassembly on blog, that's another thing. I'm not sure about Chilean law, but for example under European law you can do reverse-engineering, but you may not publish the results. Publishing your source code, that you've created thanks to what you found out, should be completely OK.

share|improve this answer

It depends on where do you live and what local law says about it. In my country (Poland) it is legal to perform disassembly if your intention is to study application and make your own application compatibile with the one being disassembled. This takes precedence over anything people write in licenses. I bet other countries have similar laws and that is why these days most licenses state that disassembly is illegal except where it is permited by the local law.

share|improve this answer
    
This is, I believe, also the case in Scots law. –  Scott May 5 '11 at 13:33
    
+1 for this one. Such things heavily depend on the country where you live in. It keeps surprising me how many people don't get this. –  shabunc Aug 22 '12 at 10:14
    
The difficulty is that you could be sued in Borat-istan if somebody there read your blog, and MSFT have an office, and the local laws don't allow it. Big companies can pick where the law applies, that's the reason so many libel cases are heard in London –  Martin Beckett Aug 22 '12 at 16:01

Actually, you don't have to disassemble a dll to check which functions you can call on. Even the undocumented functions can be accessed from outside, without disassembly - for example, load the DLL as a reference inside Visual Studio and IntelliSense will show you which functions are accessible..

Just because you can do this introspection also by "disassembling" the library doesn't mean that it is disassembly (otherwise all Visual Studio users would violate the EULA because of IntelliSense).

share|improve this answer
    
i knew that, but in this case the unducomented functions are exported as entry points and the dll just export these numbers (not the names), because that I disassembly the dwmapi.dll file. –  RRUZ May 5 '11 at 7:52
1  
@RRUZ: ok, but it isn't forbidden to use the same names as MS does inside the library. I wouldn't worry about calling those functions by name, just because they're hidden otherwise. You don't copy their algorithms or code - and there is no copyright law on variable or method names AFAIK ;-) –  vstrien May 5 '11 at 8:31

It is ok, to a point.

When Vista was first announced, and apparently was going to be built with the new cool .NET technology that was so wonderful it was going to be everywhere, Dr Richard Grimes (of the books) thought he'd decompile the headers of every dll in Vista to see just how many of them were .NET dlls, just out of curiosity, and publish the results on his blog.

Naturally, despite Microsoft saying everything was great, only a dozen dlls were .NET (IIRC), and Microsoft heard about this, threw a wobbly, and demanded he take it all down and stop doing this investigation (you'd have thought they'd have something to hide!).

Net result, he stopped, but nowhere did MS sue or take other legal action - all they did was threaten to remove his MVP status.

So I guess (IANAL) that it depends how much decompilation you do, published in the entire decompiled sources would be bad, but publishing the function calls (which are not the same as the source code, as Oracle v Google showed) would be ok. There used to be a lot fo books published with "secrets of hidden Microsoft functions" that MS didn't like but did nothing about (except to say "these will change so don't use them").

share|improve this answer

Based on their available EULAs, it is probably illegal. Whether it's legal or not in this particular case will not conclusively be decided until after you are sued and potentially bankrupt.

Do you really want to risk it? We're talking about Microsoft here. They don't shy away from litigation even when the defendants have million dollar counsel on retainer.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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