Jump to content

[Básico] Proteção Anti Dll Injection


tierrilopes
 Share

Recommended Posts

Esta é uma proteção básica para prevenir contra injeção dll.

Poderá ser ultrapassada em certas condições.

 

Abrir o ficheiro UserInterface/Locale.cpp e colar o seguinte debaixo dos includes:

 

//Inicio Anti DLL injection basico

BOOLEAN BlockAPI(HANDLE, CHAR *, CHAR *);

void AntiDlli()

{

Sleep(666);

auto hProc = GetCurrentProcess();

while (true) {

Sleep(1500);

BlockAPI(hProc, "NTDLL.DLL", "LdrloadDll");

BlockAPI(hProc, "NTDLL.DLL", "LdrploadDll");

BlockAPI(hProc, "KERNEL32.DLL", "LoadLibrary");

BlockAPI(hProc, "KERNEL32.DLL", "LoadLibraryA");

BlockAPI(hProc, "KERNEL32.DLL", "LoadLibraryW");

BlockAPI(hProc, "KERNEL32.DLL", "LoadLibraryEx");

BlockAPI(hProc, "KERNEL32.DLL", "VirtualAlloc");

BlockAPI(hProc, "KERNEL32.DLL", "VirtualAllocEx");

}

}

 

BOOLEAN BlockAPI(HANDLE hProcess, CHAR *libName, CHAR *apiName)

{

CHAR pRet[] = { 0xC3 };

HINSTANCE hLib = nullptr;

VOID *pAddr = nullptr;

auto bRet = FALSE;

DWORD dwRet = 0;

hLib = LoadLibrary(libName);

if (hLib) {

pAddr = GetProcAddress(hLib, apiName);

if (pAddr) {

if (WriteProcessMemory(hProcess,

pAddr,

pRet,

sizeof(pRet),

&dwRet)) {

if (dwRet) {

bRet = TRUE;

}

}

}

FreeLibrary(hLib);

}

return bRet;

}

void initAntiDlli(){

CreateThread(nullptr, NULL, LPTHREAD_START_ROUTINE(AntiDlli), nullptr, 0, nullptr);

}

//Fim Anti DLL injection basico

 

Ir até ao ficheiro UserInterface/StdAfx.h

Procurar por:

 

void initMessenger();

 

Adicionar em baixo:

 

void initAntiDlli();

 

Ir até ao ficheiro UserInterface/UserInterface.cpp

Procurar por:

 

initMessenger();

 

Adicionar em baixo:

 

initAntiDlli();

 

Compilar e está pronto a usar.

Link to comment
Share on other sites

Me da o seguinte erro quiando tento abrir o jogo:

 

Time Stamp: 0x57eed36c - (null)

 

Exception Type: 0xc0000005

 

eax: 0x00000000 ebx: 0x00000000

ecx: 0xf0f45c54 edx: 0x0018de58

esi: 0x06cb8838 edi: 0x1e333538

ebp: 0x0030e76c esp: 0x0030e480

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...