What is a DLL?

JM Safe

Level 39
Thread author
Verified
Top Poster
Apr 12, 2015
2,882
Sometimes we read that malware infections start thanks to .dll files code injection. But what is a DLL? A DLL (Dynamic Link Library) is a library which can contains methods (pieces of source code that could return a result for example an integer, a string, boolean, etc.), but obviously methods could also return nothing (but instead this type of methods do stuff in the body of the method but without a result, this is called void method).

The power of DLL files is that they can be used by software by importing them and use library source code without rewrite all the source code of the library, but instead use simply and fastly the DLL source code. To stay a bit safer against DLL injection it is possible to do not permit processes to get high privileges, so privilege escalation.

Example of DLL:

C#:
namespace DLL1
{
    public class DLL1Class
    {
        public static int algorithm(int n)
        {
          
            n++; //do a simple increment here
            return n;
          
        }
    }
}

Ok guys, now to use a method of a DLL we can use this:

C#:
DLL1.DLL1Class.algorithm(6);
 

About us

  • MalwareTips is a community-driven platform providing the latest information and resources on malware and cyber threats. Our team of experienced professionals and passionate volunteers work to keep the internet safe and secure. We provide accurate, up-to-date information and strive to build a strong and supportive community dedicated to cybersecurity.

User Menu

Follow us

Follow us on Facebook or Twitter to know first about the latest cybersecurity incidents and malware threats.

Top