Skip to content
This repository has been archived by the owner on Jul 12, 2023. It is now read-only.

tbhaxor/Win-LoadLibrary

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Win LoadLibary

A simple program to load DLL and call exported functions

I got interested into c++ after watching Pavel sir courses and reading books written by him on system programming. So I decided to explore this on my own and implement DLL rather than using static library

NOTE: Although I don't like windows for usage, but I use it for learning exploitation and learning about malwares.

How DLL is used

  1. Create a DLL project (MyDLL)
  2. If you want to execute some code on load, use DllMain function already scaffolded, otherwise create functions
  3. Load the library using LoadLibrary or LoadLibrayA function
  4. Create cast types for function defined in dllmain.cpp (MyDLL/Header.h)
  5. Use the GetProcAddress function to find address of the target function from the loaded dll
  6. Type cast the FARPROC to the typedef from the header file
  7. Call the returned function object which has actual reference for executing code
  8. Free the library using FreeLibrary function

Program Usage

Open the code in visual studio and build both the projects for x86 or x64 (recommended) architecture and run the program as shown below

usage: DLLLoad.exe <x> <y> <add|div|prod|sub>

References

Contact Me

Linkedin: @tbhaxor
Twitter: @tbhaxor
Email: tbhaxor dot proton dot me