Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. wrap a dll into another dll

wrap a dll into another dll

Scheduled Pinned Locked Moved C#
csharpc++question
4 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    ppp001
    wrote on last edited by
    #1

    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

    M H 2 Replies Last reply
    0
    • P ppp001

      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

      M Offline
      M Offline
      mav northwind
      wrote on last edited by
      #2

      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

      C 1 Reply Last reply
      0
      • M mav northwind

        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

        C Offline
        C Offline
        Chua Wen Ching
        wrote on last edited by
        #3

        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

        1 Reply Last reply
        0
        • P ppp001

          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

          H Offline
          H Offline
          Heath Stewart
          wrote on last edited by
          #4

          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]

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups