Skip to content
MPGHThe Dark Arts
/
RegisterLog in
Forum
Community
What's NewLatest posts across the boardTrendingHottest threads right nowSubscribedThreads you follow
Discussion
GeneralIntroductionsEntertainmentDebate FortFlaming & Rage
Board
News & AnnouncementsMPGH TimesSuggestions & HelpGiveaways
More Sections
Art & Graphic DesignProgrammingHackingCryptocurrency
Hacks & Cheats
Games
ValorantCS2 / CS:GOCall of Duty / WarzoneFortniteApex LegendsEscape From Tarkov
+14 moreLeague of LegendsGTA VMinecraftRustROTMGBattlefieldTroveBattleOnCombat ArmsCrossFireBlackshotRuneScapeDayZDead by Daylight
Resources
Game Hacking TutorialsReverse EngineeringGeneral Game HackingAnti-CheatConsole Game Hacking
Tools
Game Hacking ToolsTrainers & CheatsHack/Release NewsNew
Submit a release →Share your cheat, tool, or config with the community.
AINEW
AI Tools
General & DiscussionPrompt EngineeringLLM JailbreaksHotAI Agents & AutomationLocal / Open Models
AI × Gaming
AI Aimbots & VisionML Anti-CheatGame Bots & Automation
Create
AI Coding / Vibe CodingAI Art & MediaAI Voice & TTS
The AI frontier →Where game hacking meets modern machine learning. Jump in.
Marketplace
Buy & Sell
SellingBuyingTradingUser Services
Trust & Safety
Middleman LoungeMarketplace TalkVouch Copy Profiles
Money
Cryptocurrency TalkCurrency ExchangeWork & Job Offers
Start selling →List accounts, services, and goods. Use the middleman to trade safe.
MPGH The Dark Arts

A community for offensive security research, reverse engineering, and AI.

Community

ForumMarketplaceSearch

Account

RegisterLog in

Legal

Privacy PolicyForum RulesHelp & FAQ
© 2026 MPGH · All rights reserved.Built by the community, for the community. For educational purposes onlyContent is shared for security research and education — we don't condone illegal use. You're responsible for complying with applicable laws. Use at your own risk.
Home › Forum › Programming › C++/C Programming › [SOURCE] C++ Dll injector Code

[SOURCE] C++ Dll injector Code

Posts 1–10 of 10 · Page 1 of 1
Nubzgetkillz
Nubzgetkillz
[SOURCE] C++ Dll injector Code
Code:
#include <windows.h> 
#include <tlhelp32.h> 
#include <shlwapi.h> 
#include <conio.h> 
#include <stdio.h> 


#define WIN32_LEAN_AND_MEAN 
#define CREATE_THREAD_ACCESS (PROCESS_CREATE_THREAD | PROCESS_QUERY_INFORMATION | PROCESS_VM_OPERATION | PROCESS_VM_WRITE | PROCESS_VM_READ) 

BOOL Inject(DWORD pID, const char * DLL_NAME); 
DWORD GetTargetThreadIDFromProcName(const char * ProcName); 

int main(int argc, char * argv[]) 
{ 
   // Retrieve process ID 
   DWORD pID = GetTargetThreadIDFromProcName("Engine.exe"); 
    
   // Get the dll's full path name 
   char buf[MAX_PATH] = {0}; 
   GetFullPathName("HACKS.dll", MAX_PATH, buf, NULL); 
   printf(buf); 
   printf("\n"); 
    
   // Inject our main dll 
   if(!Inject(pID, buf)) 
   { 

        printf("DLL Not Loaded!"); 
    }else{ 
        printf("DLL Loaded!"); 
    } 

    _getch(); 
   return 0; 
} 

BOOL Inject(DWORD pID, const char * DLL_NAME) 
{ 
   HANDLE Proc; 
   HMODULE hLib; 
   char buf[50] = {0}; 
   LPVOID RemoteString, LoadLibAddy; 

   if(!pID) 
      return false; 

   Proc = OpenProcess(PROCESS_ALL_ACCESS, FALSE, pID); 
   if(!Proc) 
   { 
      sprintf(buf, "OpenProcess() failed: %d", GetLastError()); 
      //MessageBox(NULL, buf, "Loader", MB_OK); 
      printf(buf); 
      return false; 
   } 
    
   LoadLibAddy = (LPVOID)GetProcAddress(GetModuleHandle("kernel32.dll"), "LoadLibraryA"); 

   // Allocate space in the process for our DLL 
   RemoteString = (LPVOID)VirtualAllocEx(Proc, NULL, strlen(DLL_NAME), MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE); 

   // Write the string name of our DLL in the memory allocated 
   WriteProcessMemory(Proc, (LPVOID)RemoteString, DLL_NAME, strlen(DLL_NAME), NULL); 

   // Load our DLL 
   CreateRemoteThread(Proc, NULL, NULL, (LPTHREAD_START_ROUTINE)LoadLibAddy, (LPVOID)RemoteString, NULL, NULL); 

   CloseHandle(Proc); 
   return true; 
} 

DWORD GetTargetThreadIDFromProcName(const char * ProcName) 
{ 
   PROCESSENTRY32 pe; 
   HANDLE thSnapShot; 
   BOOL retval, ProcFound = false; 

   thSnapShot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0); 
   if(thSnapShot == INVALID_HANDLE_VALUE) 
   { 
      //MessageBox(NULL, "Error: Unable to create toolhelp snapshot!", "2MLoader", MB_OK); 
      printf("Error: Unable to create toolhelp snapshot!"); 
      return false; 
   } 

   pe.dwSize = sizeof(PROCESSENTRY32); 
    
   retval = Process32First(thSnapShot, &pe); 
   while(retval) 
   { 
      if(StrStrI(pe.szExeFile, ProcName)) 
      { 
         return pe.th32ProcessID; 
      } 
      retval = Process32Next(thSnapShot, &pe); 
   } 
   return 0; 
}
Title explains it bye!

-Nubzgetkillz
#1 · 15y ago
'Bruno
'Bruno
http://www.mpgh.net/forum/31-c-c/145...injection.html

cool... pretty much the same..

and the one at that post is leeched.. so a leeching a leecher.. =D epic
#2 · 15y ago
Void
Void
Quote Originally Posted by Brinuz View Post
http://www.mpgh.net/forum/31-c-c/145...injection.html

cool... pretty much the same..

and the one at that post is leeched.. so a leeching a leecher.. =D epic
Good catch Brinuz.
#3 · 15y ago
WH
whatup777+
He admitted he C&Ped in CA Section...
#4 · 15y ago
Nubzgetkillz
Nubzgetkillz
yeah just posting here didn't know there was that post.

Quote Originally Posted by whatup777+ View Post
He admitted he C&Ped in CA Section...
Yeah for vb injectors
#5 · 15y ago
Gab
Gab
Thank u.. I'll try to understand it
#6 · 15y ago
'Bruno
'Bruno
Give credits then...
#7 · 15y ago
[A
[A]bbest
dll of injector or dll file ?
#8 · 15y ago
'Bruno
'Bruno
Quote Originally Posted by abbest View Post
dll of injector or dll file ?
wtf? oO a Dll is a Dll.. An executable (.exe) is an executable...
#9 · 15y ago
BuRnYoUrSoUl
BuRnYoUrSoUl
Very nice coding
#10 · 15y ago
Posts 1–10 of 10 · Page 1 of 1

Post a Reply

Similar Threads

  • ~ DLL Injector Source Code ~By Silk[H4x] in Visual Basic Programming
    32Last post 16y ago
  • [Request] Source Code DLL Injector (Text) - VB 2008 CodesBy deocute in Visual Basic Programming
    1Last post 16y ago
  • [Release] Enc DLL Injector v1.3 + Source CodeBy encrypted94 in Visual Basic Programming
    7Last post 15y ago
  • WarRock DLL. Injector Source codeBy [Hectic] in WarRock Hack Source Code
    0Last post 15y ago
  • VB DLL Injector v1.0 + Source CodeBy M.P.G.H[Killer] in CrossFire Hack Coding / Programming / Source Code
    21Last post 16y ago

Tags for this Thread

None