0

I have a C++ Windows program that compiles into the DLL. The DLL uses various imported functions (example below):

Hex code for DLL

In this case, my DLL uses InitializeSecurityDescriptor from ADVAPI32.dll, which is a Windows DLL.

My question is: Is it possible to "bake in" the code of ADVAPI32.dll into the compilation of the DLL? E.g. make it not appear as an import, and instead copy in its code? Or is this infeasible, because it in turn has lots of dependencies?

Thanks a lot for any help!

bombax
  • 1,189
  • 8
  • 26
  • 4
    Why exactly would you want to do this? As the DLL is part of the Windows OS it will always be present when your program executes. –  Mar 25 '18 at 21:06
  • 2
    You can embed any data (also a DLL) "piggyback" as a resource, but it's a bit complicated. Take a look at [remcom](https://github.com/kavika13/RemCom), which does that to transport a service exe to a remote host. Nevertheless - as Neil Butterworth already stated, that's not necessary for Windows DLLs. And for other DLLs, a simple installer script would be much more common. – user2328447 Mar 25 '18 at 21:36
  • 3
    What problem are you trying to solve? There are so many potential problems with what you're trying to do. – 1201ProgramAlarm Mar 25 '18 at 21:54
  • This has more problems than the duplicated question. `ADVAPI32.DLL` is a system DLL. Even if you could include today's version, it's expecting to work with today's Windows kernel. – MSalters Mar 26 '18 at 00:38

1 Answers1

0

I think the answer, as pointed out by the comments, and by the answers to "Combine multiple DLL's into 1", this is infeasible, hard, and annoying. Which I gladly accept as an answer. :)

bombax
  • 1,189
  • 8
  • 26