wrap a dll into another dll
-
Hi, Is it possible to wrap a dll A into another dll B, so I just need to distribute the dll B, but not the dll A? And how are there differences in the following cases ? 1. the dll A is written in VC++, and the wrapping dll B is written in C# 2. the dll A is written in C#, and the wrapping dll B is written in C# My concern is that I don't want others to get the original dll B when I distribute the program. So can other people reverse engineer the wrapped dll and get the original dll out ? Many thanks
-
Hi, Is it possible to wrap a dll A into another dll B, so I just need to distribute the dll B, but not the dll A? And how are there differences in the following cases ? 1. the dll A is written in VC++, and the wrapping dll B is written in C# 2. the dll A is written in C#, and the wrapping dll B is written in C# My concern is that I don't want others to get the original dll B when I distribute the program. So can other people reverse engineer the wrapped dll and get the original dll out ? Many thanks
No, that's not possible. Something like this can only be done with static libraries that are linked with an executable. With dlls you don't get code copied or linked directly, but only references to external functions. That's the whole point of using dlls. mav
-
No, that's not possible. Something like this can only be done with static libraries that are linked with an executable. With dlls you don't get code copied or linked directly, but only references to external functions. That's the whole point of using dlls. mav
Maybe you can buy an enterprise version of obfuscation and then obfuscate your assembly. It might confuse the crackers when reverse engineering your assembly. And i don't think you achieve with what you want. Cheers. Regards, Chua Wen Ching Visit us at http://www.necoders.com
-
Hi, Is it possible to wrap a dll A into another dll B, so I just need to distribute the dll B, but not the dll A? And how are there differences in the following cases ? 1. the dll A is written in VC++, and the wrapping dll B is written in C# 2. the dll A is written in C#, and the wrapping dll B is written in C# My concern is that I don't want others to get the original dll B when I distribute the program. So can other people reverse engineer the wrapped dll and get the original dll out ? Many thanks
There is a messy way of embedded B.dll in A.dll as an embedded resources, extracting it using
Assembly.GetManifestResourceStream
, and then loading it into the AppDomain using several different methods depending on how you extract it or to where you extract it...but that's just dumb. Why? For one, it creates a servicing hastle. Now you have to patch both by virtue of patching A.dll. Also, anyone else can extract it using outside code. If you're worry about disassembly or decompilation, then you picked the wrong language. .NET languages and Java both compile to intermediate code (.NET to Intermediate Language (IL), and Java to bytecode). Even if you obfuscate it some can deobfuscate it just as easily. If you truly want to hide an implementation, then you'll need to put that functionality into a native DLL (which still isn't impossible decompile, though extremely difficult expecially when optimized) and use P/Invoke or COM interop, which you can read more about in Interoperating with Unmanaged Code[^] in the .NET Framework SDK. This posting is provided "AS IS" with no warranties, and confers no rights. Software Design Engineer Developer Division Sustained Engineering Microsoft [My Articles] [My Blog]