Hello guys i have been working on a solution to try and save the game from noobs with public code. I hope Inix can see this post and patch this cancer once and for all.
For the people that know what they are doing this is easy to bypass but if you post it publicly I will try my best to keep posting a patch.
Stop ruining the game spoon feeding noobs, if anyone want to support me please start posting fixes aswell.
*Added the EAT Hook detection.
*Added the IAT Hook detection.
TODO:
Dll Wrapper detection.
For the people that know what they are doing this is easy to bypass but if you post it publicly I will try my best to keep posting a patch.
Stop ruining the game spoon feeding noobs, if anyone want to support me please start posting fixes aswell.
Code:
BOOL X86DetectInterceptionEAT( HMODULE *lpModule ) {
PIMAGE_DOS_HEADER dwDos = reinterpret_cast< PIMAGE_DOS_HEADER >( lpModule[ 0 ] );
if( dwDos->e_magic == IMAGE_DOS_SIGNATURE ) {
PIMAGE_NT_HEADERS dwHeader = reinterpret_cast< PIMAGE_NT_HEADERS >( reinterpret_cast< DWORD >( dwDos ) +
dwDos->e_lfanew );
if( dwHeader->Signature == IMAGE_NT_SIGNATURE ) {
PIMAGE_EXPORT_DIRECTORY dwAddrOfDir = reinterpret_cast< PIMAGE_EXPORT_DIRECTORY >( ( reinterpret_cast< DWORD >( dwDos ) +
dwHeader->OptionalHeader.DataDirectory[ IMAGE_DIRECTORY_ENTRY_EXPORT ].VirtualAddress ) );
PDWORD dwAddrOfNames = reinterpret_cast< PDWORD >( reinterpret_cast< DWORD >( dwDos ) +
dwAddrOfDir->AddressOfNames );
PDWORD dwAddrOfFuncs = reinterpret_cast< PDWORD >( reinterpret_cast< DWORD >( dwDos ) +
dwAddrOfDir->AddressOfFunctions );
PWORD dwAddrOfOrdinals = reinterpret_cast< PWORD >( reinterpret_cast< DWORD >( dwDos ) +
dwAddrOfDir->AddressOfNameOrdinals );
for( DWORD dwEntry = 0; dwEntry < dwAddrOfDir->NumberOfFunctions; dwEntry++ ) {
if( dwAddrOfFuncs[ dwEntry ] ) {
DWORD dwAddress = reinterpret_cast< DWORD >( dwDos ) + dwAddrOfFuncs[ dwEntry ];
HMODULE dwRes = NULL;
if( GetModuleHandleExA( GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS, reinterpret_cast< LPCSTR >( dwAddress ), &lpModule[ 4 ] ) ) {
if( lpModule[ 4 ] != lpModule[ 0 ] && lpModule[ 4 ] != lpModule[ 1 ] &&
lpModule[ 4 ] != lpModule[ 2 ] && lpModule[ 4 ] != lpModule[ 3 ] ) {
return TRUE;
}
}
}
}
}
}
return FALSE;
}
BOOL X86DetectInterceptionIAT( HMODULE lpModule ) {
PIMAGE_DOS_HEADER dwDos = reinterpret_cast< PIMAGE_DOS_HEADER >( lpModule );
if( dwDos->e_magic == IMAGE_DOS_SIGNATURE ) {
PIMAGE_NT_HEADERS dwHeader = reinterpret_cast< PIMAGE_NT_HEADERS >( reinterpret_cast< DWORD >( dwDos ) +
dwDos->e_lfanew );
if( dwHeader->Signature == IMAGE_NT_SIGNATURE ) {
PIMAGE_IMPORT_DESCRIPTOR dwAddrOfDir = reinterpret_cast< PIMAGE_IMPORT_DESCRIPTOR >( reinterpret_cast< DWORD >( dwDos ) +
dwHeader->OptionalHeader.DataDirectory[ IMAGE_DIRECTORY_ENTRY_IMPORT ].VirtualAddress );
while( dwAddrOfDir->Name ) {
HMODULE dwModule[ 5 ] = {
GetModuleHandleA( reinterpret_cast< PCHAR >( reinterpret_cast< DWORD >( dwDos ) + dwAddrOfDir->Name ) ),
//SYSTEM WIDE RESERVATION
GetModuleHandleA( "KERNEL32.DLL" ),
GetModuleHandleA( "USER32.DLL" ),
GetModuleHandleA( "NTDLL.DLL" ),
NULL
};
if( dwModule[ 0 ] ) {
if( X86DetectInterceptionEAT( dwModule ) ) { //DETECTED EAT HOOK FROM MODULES IN THE IMPORT TABLE
return TRUE;
}
PIMAGE_THUNK_DATA dwAddressOfThunk = reinterpret_cast< PIMAGE_THUNK_DATA >( reinterpret_cast< DWORD >( dwDos ) +
dwAddrOfDir->FirstThunk );
while( dwAddressOfThunk->u1.Function ) {
if( GetModuleHandleExA( GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS, reinterpret_cast< LPCSTR >( dwAddressOfThunk->u1.Function ), &dwModule[ 4 ] ) ) {
if( dwModule[ 4 ] != dwModule[ 0 ] && dwModule[ 4 ] != dwModule[ 1 ] &&
dwModule[ 4 ] != dwModule[ 2 ] && dwModule[ 4 ] != dwModule[ 3 ] ) {
return TRUE;
}
}
dwAddressOfThunk++;
}
}
dwAddrOfDir++;
}
}
}
return FALSE;
}
//PUT THIS ON THE MAIN THREAD BEFORE RENDERING THE FRAME WITH A TIMER
//This function already includes the EAT scan on all modules listed in the Import Table
if( !X86DetectInterceptionIAT( GetModuleHandle( 0 ) ) ) {
//user is clean
} else {
//eat or iat changed
}
*Added the IAT Hook detection.
TODO:
Dll Wrapper detection.