load_system32_dll.c 438 B

12345678910111213141516171819
  1. /*
  2. * Wrapper function to load a DLL out of c:\windows\system32 without
  3. * going through the full DLL search path. (Hence no attack is
  4. * possible by placing a substitute DLL earlier on that path.)
  5. */
  6. #include "putty.h"
  7. HMODULE load_system32_dll(const char *libname)
  8. {
  9. char *fullpath;
  10. HMODULE ret;
  11. fullpath = dupcat(get_system_dir(), "\\", libname);
  12. ret = LoadLibrary(fullpath);
  13. sfree(fullpath);
  14. return ret;
  15. }