Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

[Release][C++] Usaful anti dll injection function.

Status
Not open for further replies.
Skilled Illusionist
Joined
Jan 7, 2007
Messages
347
Reaction score
78
Anti DLL injection [C++] :

By DLL :
Code:
void AntiInject () 
{ 
   HANDLE hProc = GetCurrentProcess(); 
   while (TRUE) { 
      BlockAPI(hProc, "NTDLL.DLL", "LdrLoadDll"); 
      Sleep (100); 
   } 
} 
 
BOOLEAN BlockAPI (HANDLE hProcess, CHAR *libName, CHAR *apiName) 
{ 
   CHAR pRet[]={0xC3}; 
   HINSTANCE hLib = NULL; 
   VOID *pAddr = NULL; 
   BOOL bRet = FALSE; 
   DWORD dwRet = 0; 
 
   hLib = LoadLibrary (libName); 
   if (hLib) { 
       pAddr = (VOID*)GetProcAddress (hLib, apiName); 
       if (pAddr) { 
           if (WriteProcessMemory (hProcess, 
                            (LPVOID)pAddr, 
                            (LPVOID)pRet, 
                            sizeof (pRet), 
                            &dwRet )) { 
              if (dwRet) { 
                 bRet = TRUE; 
              } 
           } 
       } 
       FreeLibrary (hLib); 
   } 
   return bRet; 
}

Or like this if you do it on .EXE :
Code:
void AntiInject () 
{ 
   HANDLE hProc = FindWindow(0,"Gunz"); 
   while (TRUE) { 
      BlockAPI(hProc, "NTDLL.DLL", "LdrLoadDll"); 
      Sleep (100); 
   } 
} 
 
BOOLEAN BlockAPI (HANDLE hProcess, CHAR *libName, CHAR *apiName) 
{ 
   CHAR pRet[]={0xC3}; 
   HINSTANCE hLib = NULL; 
   VOID *pAddr = NULL; 
   BOOL bRet = FALSE; 
   DWORD dwRet = 0; 
 
   hLib = LoadLibrary (libName); 
   if (hLib) { 
       pAddr = (VOID*)GetProcAddress (hLib, apiName); 
       if (pAddr) { 
           if (WriteProcessMemory (hProcess, 
                            (LPVOID)pAddr, 
                            (LPVOID)pRet, 
                            sizeof (pRet), 
                            &dwRet )) { 
              if (dwRet) { 
                 bRet = TRUE; 
              } 
           } 
       } 
       FreeLibrary (hLib); 
   } 
   return bRet; 
}
Change Gunz to your gunz name like if you use BR it will be "The Duel".


Google it
Thanks.
 
Last edited:
Skilled Illusionist
Joined
Jan 7, 2007
Messages
347
Reaction score
78
VC++ or DevCPP. You need to know that this is usally without other functions like Api hook block or banned windows name ...

Thanks.
 
Custom Title Activated
Loyal Member
Joined
Nov 5, 2006
Messages
1,358
Reaction score
15
Damn.. C++ is weird. To me, C# seems a lot more logical.. i dunno. But hey it's a preference :p.

Thanks, I'm saving this for later.
 
WowIwasSuperCringeB4
Loyal Member
Joined
Jun 21, 2008
Messages
1,297
Reaction score
226
I'm going to find you and shoot you some day. I hope that day comes very very soon. Reading all of your posts in the other Anti-Hack thread your basically like, "HOW EYE USE THIS>!?" in about three posts in that whole thread which is VERY annoying. Just GTFO, Learn some coding then come back and hopefully you wont be as retarded.

Lol Kats, you shouldn't really say 'Learn some coding then come back' Lol
Anyway Chill it's a virtual forum. It means nothing if he says crap lol.
 
Extreme Coder - Delphi
Loyal Member
Joined
Sep 8, 2007
Messages
1,381
Reaction score
39
Kochon C# is .... logicall becuz its a 5second job, seriously all you need to do is drop components and add a few lines of code.
Unless you work on something advanced you will start to think C# is weired :)
 
Status
Not open for further replies.
Back
Top