Reputation: 583
i need to use SLGetWindowsInformation in slc.dll but i would rather implement my own version than pinvoking it 200 times on application start up and create the datatypes it need, so is it illegal to disassemble the library and write my own code that leech the behavior of this function
p.s i'm using c# so i won't inline an assembly, ill just copy the behavior
Upvotes: 2
Views: 115
Reputation: 113322
is it illegal to disassemble the library and write my own code
That depends on where you are. There are jurisdictions where reverse engineering is a protected consumer right, and so any attempt to prohibit it in a user agreement is null and void. There are jurisdictions where reverse engineering is not a protected consumer right, and therefore you may only do so if your license agreement allows it.
If you are somewhere where you can reverse engineer legally, there may still be restrictions from other laws (such as patents) on the code produced, though patents can get in the way even if you don't copy anyone and arrive at the idea in an independent manner, along with further innovations (though ironically patents were originally designed to actually encourage innovation).
Really, you're better off avoiding the issue entirely and never look at code that does something while you're trying to do the same thing, unless that code is released under a license that allows it.
i would rather implement my own version
Why not just implement your own version? If you think you can do better than someone else, do you really need to copy that someone else?
Upvotes: 2
Reputation: 13600
This is really a question for a lawyer and not for a programmer, but...
It all depends on the license of the library. AFAIK system dlls are subject to MS license you agree with before the installation and I bet there's a little line that forbids any kind of disassembling. Even with free libraries you should be careful, because most don't like reverse-engineering. If you need to modify a library, it should be open-source with a license, that permits it.
Upvotes: 1