Source code for: MapHack
LOL, Maphack... Hate or like it? anyway I found this source code today, and from the person who posted it, it is complilable. I never try it. so please do not ask me how to do. :p, The reason I post it here is to share with you how others are doing maphack. and how can we prevent from this?
---------------------------------------------------------------------------------------------
#include <windows.h>
void EnableDebugPriv();
int main()
{
//We have to set debug privileges for our app to be allowed to OpenProcess (war3.exe)
EnableDebugPriv();
//Get a Handle on Warcraft III window
HWND hwar3 = FindWindow("Warcraft III",NULL);
if (!hwar3) //If we can't find the window...
{
MessageBox(0, "Run Warcarft III First!", "", MB_OK);
return false;
}
DWORD pid;
GetWindowThreadProcessId(hwar3, &pid);
HANDLE hopen = OpenProcess(PROCESS_ALL_ACCESS, false, pid);
if (!hopen) //Can't open Warcarft III's process.. Must be a PID error.
{
MessageBox(0, "Your getting a PID error, use LoaderZ.", "", MB_OK);
return false;
}
//Now we're ready to change the memory!
//We remember: 6F2A3B91 66:BF 0F00 MOV DI,0x0F
BYTE data[] = {0xBF,0x0F,0x00};
bool success = WriteProcessMemory(hopen,(LPVOID)0x6F2A3B92, &data,3, NULL);
if(success)//Everything worked
{
MessageBox(NULL, "Hack Loaded - Remember to Vist www.SkillHackerZ.com", "", MB_OK);
}
else//There was an error!
{
MessageBox(NULL, "Couldn't load hack", "", MB_OK);
}
// Remember to be clean
CloseHandle(hopen);
//Done!
return true;
}
void EnableDebugPriv()
{
HANDLE hToken;
LUID sedebugnameValue;
TOKEN_PRIVILEGES tkp;
OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, &hToken);
LookupPrivilegeValue(NULL, SE_DEBUG_NAME, &sedebugnameValue);
tkp.PrivilegeCount = 1;
tkp.Privileges[0].Luid = sedebugnameValue;
tkp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
AdjustTokenPrivileges(hToken, false, &tkp, sizeof tkp, NULL, NULL);
CloseHandle(hToken);
}
(taken from http://dotatips.tipsabc.com)