{"id":15641455,"url":"https://github.com/idouble/simple-dll-injection","last_synced_at":"2025-04-15T05:56:43.264Z","repository":{"id":50227925,"uuid":"202677029","full_name":"IDouble/Simple-DLL-Injection","owner":"IDouble","description":"🔧 Simple DLL Injection into a Process with C++ 🔧","archived":false,"fork":false,"pushed_at":"2024-02-29T17:13:57.000Z","size":29861,"stargazers_count":110,"open_issues_count":3,"forks_count":8,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-15T05:56:37.689Z","etag":null,"topics":["cplusplus","cpp","dll","dll-injection","dword","findwindow","handle","hwnd","injection","process","simple","snippets","template","thread","windows"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/IDouble.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2019-08-16T07:07:14.000Z","updated_at":"2025-03-30T00:45:57.000Z","dependencies_parsed_at":"2024-04-08T23:02:36.964Z","dependency_job_id":"15794aec-ef47-492a-8135-ae33f6bf1f3e","html_url":"https://github.com/IDouble/Simple-DLL-Injection","commit_stats":null,"previous_names":["idouble/simple-dll-injection"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IDouble%2FSimple-DLL-Injection","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IDouble%2FSimple-DLL-Injection/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IDouble%2FSimple-DLL-Injection/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IDouble%2FSimple-DLL-Injection/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/IDouble","download_url":"https://codeload.github.com/IDouble/Simple-DLL-Injection/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249016320,"owners_count":21198832,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cplusplus","cpp","dll","dll-injection","dword","findwindow","handle","hwnd","injection","process","simple","snippets","template","thread","windows"],"created_at":"2024-10-03T11:42:35.580Z","updated_at":"2025-04-15T05:56:43.246Z","avatar_url":"https://github.com/IDouble.png","language":"C++","readme":"# 🔧 Simple DLL Injection 🔧\n🔧 Simple DLL Injection into a Process with C++ 🔧\n\n## 🔧 Inject DLL into Process (DLL Injection) 🔧\n\n```\n#include \u003ciostream\u003e\n#include \u003cWindows.h\u003e\n\nusing namespace std;\n\nint main()\n{\n\tLPCSTR DllPath = \"C:\\\\Simple-DLL-Injection\\\\C++\\\\Debug\\\\testlib.dll\"; // The Path to our DLL\n\t\n\tHWND hwnd = FindWindowA(NULL, \"Tutorial-x86_64\"); // HWND (Windows window) by Window Name\n\tDWORD procID; // A 32-bit unsigned integer, DWORDS are mostly used to store Hexadecimal Addresses\n\tGetWindowThreadProcessId(hwnd, \u0026procID); // Getting our Process ID, as an ex. like 000027AC\n\tHANDLE handle = OpenProcess(PROCESS_ALL_ACCESS, FALSE, procID); // Opening the Process with All Access\n\n\t// Allocate memory for the dllpath in the target process, length of the path string + null terminator\n\tLPVOID pDllPath = VirtualAllocEx(handle, 0, strlen(DllPath) + 1, MEM_COMMIT, PAGE_READWRITE);\n\n\t// Write the path to the address of the memory we just allocated in the target process\n\tWriteProcessMemory(handle, pDllPath, (LPVOID)DllPath, strlen(DllPath) + 1, 0);\n\n\t// Create a Remote Thread in the target process which calls LoadLibraryA as our dllpath as an argument -\u003e program loads our dll\n\tHANDLE hLoadThread = CreateRemoteThread(handle, 0, 0, \n\t(LPTHREAD_START_ROUTINE)GetProcAddress(GetModuleHandleA(\"Kernel32.dll\"), \"LoadLibraryA\"), pDllPath, 0, 0);\n\n\tWaitForSingleObject(hLoadThread, INFINITE); // Wait for the execution of our loader thread to finish\n\n\tcout \u003c\u003c \"Dll path allocated at: \" \u003c\u003c hex \u003c\u003c pDllPath \u003c\u003c endl;\n\tcin.get();\n\n\tVirtualFreeEx(handle, pDllPath, strlen(DllPath) + 1, MEM_RELEASE); // Free the memory allocated for our dll path\n\n\treturn 0;\n}\n```\n\n![Simple DLL Injection into a Process with C++](Images/DLLInjection.png)\n\n![Binance Ready to give crypto a try ? buy bitcoin and other cryptocurrencies on binance](Images/binance.jpg)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fidouble%2Fsimple-dll-injection","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fidouble%2Fsimple-dll-injection","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fidouble%2Fsimple-dll-injection/lists"}