// Video tutorial: http://www.youtube.com/user/vertexbrasil
#include "StdAfx.h"
#include "Dump.h"
// ----------------------------------------------------
// Dll original: f1x / [email protected]
// Creation date: 2008-06-26
// ----------------------------------------------------
#ifdef _MANAGED
#pragma managed(push, off)
#endif
ANITHACK_PROCDUMP g_ProcessesDumps[MAX_PROCESS_DUMP] =
{
////////////////////////////////////////////////////////////////////////////////////////////////
//Dump scan - D-Scan
//Dont forgot to update hack amount on: Dump.h
//{0x000000, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, //xxxxx
////////////////////////////////////////////////////////////////////////////////////////////////
{0x4017D0, {0x55, 0x8b, 0xec, 0x6a, 0xff, 0x68, 0x08, 0x51, 0x40, 0x00, 0x68, 0x9c, 0x24, 0x40, 0x00, 0x64}}, //Win MU (TESTE)
{0x4039e3, {0x81, 0xEC, 0xD4, 0x02, 0x00, 0x00, 0x53, 0x55, 0x56, 0x57, 0x6A, 0x20, 0x33, 0xED, 0x5E, 0x89}}, //Process hacker portable
//DONT FORGOT TO UPDATE HACK TOTAL AMOUNT INSIDE: Dump.h
};
void Msg_D_Br(){
MessageBoxA(NULL,"D-Scan\n\nConteúdo suspeito detectado!", carrega.Nome_das_Janelas, MB_SERVICE_NOTIFICATION | MB_ICONWARNING);
}
void Msg_D_En(){
MessageBoxA(NULL,"D-Scan\n\nAn illegal choice haas been detected!", carrega.Nome_das_Janelas, MB_SERVICE_NOTIFICATION | MB_ICONWARNING);
}
void Msg_D_Page(){
Sleep (4000);
ShellExecute(NULL, "open", carrega.HackSplash_WebSite, NULL, NULL, SW_SHOWNORMAL);
}
void SystemProcessesScan() {
// Add adminstrator privileges to open handle on WINDOWS XP
HANDLE hToken = NULL;
TOKEN_PRIVILEGES tokenPriv;
LUID luidDebug;
if(OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES, &hToken) != FALSE)
{
if(LookupPrivilegeValue(NULL, SE_DEBUG_NAME, &luidDebug) != FALSE)
{
tokenPriv.PrivilegeCount = 1;
tokenPriv.Privileges[0].Luid = luidDebug;
tokenPriv.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
if(AdjustTokenPrivileges(hToken, FALSE, &tokenPriv, 0, NULL, NULL) != FALSE)
{
// Always successful, even in the cases which lead to OpenProcess failure
// cout << "SUCCESSFULLY CHANGED TOKEN PRIVILEGES" << endl;
}
else
{
// cout << "FAILED TO CHANGE TOKEN PRIVILEGES, CODE: " << GetLastError() << endl;
}
}
}
CloseHandle(hToken);
// OPEN HANDLE
HANDLE hProcessSnap = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
if(hProcessSnap != INVALID_HANDLE_VALUE)
{
PROCESSENTRY32 pe32;
pe32.dwSize = sizeof(PROCESSENTRY32);
if(Process32First(hProcessSnap, &pe32))
//cout << hProcessSnap <<endl;
{
do
{
HANDLE hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, pe32.th32ProcessID);
//cout << pe32.th32ProcessID <<endl;
if(hProcess != NULL)
{
if(ScanProcessMemory(hProcess))
{
if (carrega.Log_Txt_Hack == 1){
ofstream out("GameGuard/Log.txt", ios::app);
out << "\n D-Scan: ", out << pe32.szExeFile;
out.close();
}
if (carrega.Message_Warning_En == 1){
CreateThread(NULL,NULL,LPTHREAD_START_ROUTINE(Msg_D_En),NULL,0,0);
Sleep(5000);
ExitProcess(0);
}
if (carrega.Message_Warning_En == 2){
CreateThread(NULL,NULL,LPTHREAD_START_ROUTINE(Msg_D_Br),NULL,0,0);
Sleep(5000);
ExitProcess(0);
}
if (carrega.Message_Warning_En == 3){
CreateThread(NULL,NULL,LPTHREAD_START_ROUTINE(Msg_D_Page),NULL,0,0);
Sleep(5000);
ExitProcess(0);
}
if (carrega.Message_Warning_En == 0){
ExitProcess(0);
}
}
}
}
while(Process32Next(hProcessSnap, &pe32));
}
}
CloseHandle(hProcessSnap);
}
bool ScanProcessMemory(HANDLE hProcess)
{
for(int i = 0; i < MAX_PROCESS_DUMP; i++)
{
char aTmpBuffer[MAX_DUMP_SIZE];
SIZE_T aBytesRead = 0;
ReadProcessMemory(hProcess, (LPCVOID)g_ProcessesDumps[i].m_aOffset, (LPVOID)aTmpBuffer, sizeof(aTmpBuffer), &aBytesRead);
if(memcmp(aTmpBuffer, g_ProcessesDumps[i].m_aMemDump, MAX_DUMP_SIZE) == 0)
{
return true;
break;
}
}
return false;
}
#ifdef _MANAGED
#pragma managed(pop)
#endif
void D_Scan(){
again:
SystemProcessesScan();
Sleep(carrega.DDump_occours);
goto again;
}
void ProtectionMain(){
CreateThread(NULL,NULL,LPTHREAD_START_ROUTINE(D_Scan),NULL,0,0);
}