#include <windows.h>
#include <iostream>

// Function to inject the DLL into the current process
bool InjectDLLIntoCurrentProcess(const char* dllPath) {
   
    HMODULE hDll = LoadLibraryA(dllPath);

    if (hDll == NULL) {

        std::cerr << "Failed to load DLL. Error code: " << GetLastError() << std::endl;
        return false;
    }

    std::cout << "DLL successfully injected into current process." << std::endl;
    return true;
}

int main() {
    // Path to the target DLL
    const char* dllPath = "C:\\Users\\Munene\\Desktop\\InjectMe.dll";

    // Try to inject the DLL
    if (InjectDLLIntoCurrentProcess(dllPath)) {
        std::cout << "DLL loaded. Mission accomplished." << std::endl;
    } else {
        std::cerr << "Operation failed. Injection not completed." << std::endl;
        return 1;
    }

    return 0;
}