C++

57K

Solutions

24K

Contributors

C++ is an intermediate-level general-purpose programming language, not to be confused with C or C#. It was developed as a set of extensions to the C programming language to improve type-safety and add support for automatic resource management, object-orientation, generic programming, and exception handling, among other features.

Share tech news, updates, or what's on your mind.

Sign up to Post

How to avoid dll-Hijack issue  ?

We have a normal C++ MFC application but we kept a .dll file in the same path where our application resides. When we start the application the dll file present in the current directory also loaded and fall in an infinite loop and our real application is non-responsive because the name of the dll is one of the System module dll that is loaded by the framework from the system path.

The reason is it look in the currentdir instead of the system path on Priprity of Dll search.
How we can avoid this dll hijack issue in Windows ?

Means how to avoid the search of dll from current directory rather look at system path at first priority
0

Author Comment

by:Sudhansu Panda
I have added the following entry by opening the command prompt with Admin privileges

C:\windows\system32>REG ADD "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control
\Session Manager\KnownDLLs" /v dwmapi /t REG_SZ /d dwmapi.dll
ERROR: Access is denied.

Can you let me know how to add the dll names here in HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control
\Session Manager\KnownDLLs entry
0
LVL 31

Expert Comment

by:Zoppo
Yes, to enter information in the registry in HKEY_LOCALMACHINE someone usually needs to be an admin.

It wouldn't make much sense if any user could change this, because each malware running with user right could change it too.
0
Cloud Class® Course: Python 3 Fundamentals
LVL 12
Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

The skillset of programming makes the difference between having billions of operations per second in your lap and having billions of operations per second at your command. If you seek to partake, you may want to consider checking out my new course: https://www.experts-exchange.com/courses/1401/Programming-for-You-Introduction-to-C.html
1
cplusplus.jpg
This jovial programmer is Paul Kent.  I just published his new course on C++.  Great job, Paul!

https://www.experts-exchange.com/courses/1401/Programming-for-You-Introduction-to-C.html

Note: This is a paid course.
0

C++

57K

Solutions

24K

Contributors

C++ is an intermediate-level general-purpose programming language, not to be confused with C or C#. It was developed as a set of extensions to the C programming language to improve type-safety and add support for automatic resource management, object-orientation, generic programming, and exception handling, among other features.