Enable DLL Protection (Windows only)

Found an issue in the documentation ? Please report it here !

Moderator: Documentation Editors

User avatar
Teddy Rogers
User
User
Posts: 98
Joined: Sun Feb 23, 2014 2:05 am
Location: Australia
Contact:

Enable DLL Protection (Windows only)

Post by Teddy Rogers »

I note in PureBasic 6.04 LTS there is a new DLL protection feature in compiler options.

The English translation in the documentation is not well worded. From the wording in the documentation, my understanding, is the default search directory of system DLL's is restricted to the System32 folder. Please correct me if wrong.

Additionally it would be good to know in the documentation if calling, for example, either SetDefaultDllDirectories or SetDllDirectory API's in user code changes this behaviour.

Current wording...
Enable DLL Protection (Windows only)
Enable DLL preloading protection to the executable. It prevents that system DLLs are first searched for in the program directory instead of in the System32 directory of the Windows operating system. This option is not XP compatiable.
Proposed/ assumed alternative...
Enable DLL Protection (Windows only)
Enable DLL preloading protection to prevent an attacker using your application to execute code using a malicious system DLL. When enabled the standard system defined DLL directory search order is not used, the search order is restricted to the System32 directory of the Windows operating system. When an attacker has write access to the same system defined DLL search order directories as your application they can place a malicious copy of a DLL to execute code in the same process context as the user running your application. Example, when the application is run as Administrator the malicious DLL will execute code with the same elevated privileges.

If your application depends on loading a DLL consider installing your application and DLL's to a Windows protected folder such as "C:\Program Files\". If your application needs to be portable avoid searching for DLL's in the same folder as your application, use SetDefaultDllDirectories and SetDllDirectory API's specifying fully qualified search paths to locate DLL's.

This option is not supported in Windows XP.
Ted.
User avatar
Andre
PureBasic Team
PureBasic Team
Posts: 2137
Joined: Fri Apr 25, 2003 6:14 pm
Location: Germany (Saxony, Deutscheinsiedel)
Contact:

Re: Enable DLL Protection (Windows only)

Post by Andre »

This extended descriptions makes sense from my point of view. Thank you!

If there is no better suggestion, I will include it in the PB docs....
Bye,
...André
(PureBasicTeam::Docs & Support - PureArea.net | Order:: PureBasic | PureVisionXP)
Post Reply