Quote:
//SimpleWc3Hack for Warcraft 3 Patch 1.22...
#include <windows.h>
#include <Tlhelp32.h>
#include <iostream>
using namespace std;
DWORD GetPIDForProcess (char* process);
void EnableDebugPriv();
DWORD GetDLLBase(char* DllName, DWORD tPid);
#define PATCH(i,w,l) WriteProcessMemory(hProc,reinterpret_cast<LPVOID>( gameBase+i),w,l,&dSize)
void main()
{ <-----
cout << "SimpleWc3Hack v1.0 by sd333221 loaded!" << endl << endl;
cout << "Searching Wc3..." << endl;
if(GetPIDForProcess("WAR3.EXE") == 0)
{
cout << "Warcraft 3 was not found..." << endl;
system("Pause");
exit(0);
}
else
{
cout << "Getting debug privileges..." << endl;
EnableDebugPriv();
cout << "Opening Warcraft 3 Process..." << endl;
HANDLE hProc = OpenProcess(PROCESS_ALL_ACCESS, false, GetPIDForProcess("WAR3.EXE"));
if(hProc)
{
cout << "Process opened... Patching" << endl;
DWORD gameBase = GetDLLBase("Game.dll",GetPIDForProcess("WAR3.EXE") );
DWORD dSize = 0;
PATCH(0x3A04AB,"\x90\x90",2); //Patch 6F3A04AB to nop nop :-)
if(dSize == 0)
{
cout << "Failed to patch showunitsingame" << endl;
}
PATCH(0x36087c,"\x00",1);
if(dSize == 0)
{
cout << "Failed to patch showunitsmap" << endl;
}
PATCH(0x28464C,"\x90\x90",2);
if(dSize == 0)
{
cout << "Failed to patch clickableunits" << endl;
}
PATCH(0x284662,"\xEB\x29",2);
if(dSize == 0)
{
cout << "Failed to patch clickableunits (2nd patch)" << endl;
}
PATCH(0x281F1C,"\x40\xc3",2);
if(dSize == 0)
{
cout << "Failed to patch revealillu" << endl;
}
PATCH(0x73B949,"\xB2\x00\x90\x90\x90\x90",6);
if(dSize == 0)
{
cout << "Failed to patch removefogingame" << endl;
}
PATCH(0x42F836,"\x3B\xC0\x0F\x85\xC0\x00\x00\x00\x 8D\x8B\xF0\x00\x00\x00\xE8\x97\x3C\x03\x00\x3B\xC0 \x0F\x85\xAD\x00\x00\x00",27);
if(dSize == 0)
{
cout << "Failed to patch pingsignal" << endl;
}
PATCH(0x398E01,"\x90\x90\x90\x90\x90\x33\xc0\x40", 8);
if(dSize == 0)
{
cout << "Failed to patch showinvisibleingame" << endl;
}
PATCH(0x360C91,"\x3B\xC0\x0F\x85\x30\x04\x00\x00", 8);
if(dSize == 0)
{
cout << "Failed to patch showinvisiblemap" << endl;
}
PATCH(0x3558FE,"\x90\x90\x90",3);
if(dSize == 0)
{
cout << "Failed to patch showinvisiblemap" << endl;
}
CloseHandle(hProc);
cout << "Done, goodbye!" << endl;
system("Pause");
exit(1);
}
else
{
cout << "Warcraft 3 could not be opened..." << endl;
system("Pause");
exit(0);
}
}
}
//Queries the ProcessId of a certain process
DWORD GetPIDForProcess (char* process)
{
BOOL working=0;
PROCESSENTRY32 lppe= {0};
DWORD targetPid=0;
HANDLE hSnapshot=CreateToolhelp32Snapshot(TH32CS_SNAPPROC ESS ,0);
if (hSnapshot)
{
lppe.dwSize=sizeof(lppe);
working=Process32First(hSnapshot,&lppe);
while (working)
{
if(_stricmp(lppe.szExeFile,process)==0)
{
targetPid=lppe.th32ProcessID;
break;
}
working=Process32Next(hSnapshot,&lppe);
}
}
CloseHandle( hSnapshot );
return targetPid;
}
//Enables to open other processes
void EnableDebugPriv()
{
HANDLE hToken;
LUID sedebugnameValue;
TOKEN_PRIVILEGES tkp;
if ( ! OpenProcessToken( GetCurrentProcess(),
TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, &hToken ) )
return;
if ( ! LookupPrivilegeValue( NULL, SE_DEBUG_NAME, &sedebugnameValue ) ){
CloseHandle( hToken );
return;
}
tkp.PrivilegeCount = 1;
tkp.Privileges[0].Luid = sedebugnameValue;
tkp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
if ( ! AdjustTokenPrivileges( hToken, FALSE, &tkp, sizeof tkp, NULL, NULL ) )
CloseHandle( hToken );
}
//Gets the base of our dll
DWORD GetDLLBase(char* DllName, DWORD tPid)
{
HANDLE snapMod;
MODULEENTRY32 me32;
if (tPid == 0) return 0;
snapMod = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, tPid);
me32.dwSize = sizeof(MODULEENTRY32);
if (Module32First(snapMod, &me32)){
do{
if (strcmp(DllName,me32.szModule) == 0){
CloseHandle(snapMod);
return (DWORD) me32.modBaseAddr;
}
}while(Module32Next(snapMod,&me32));
}
CloseHandle(snapMod);
return 0;
}
Wie gezeigt will er da namme weiter machen der hack is so aufgebaut wie meiner ich hab nur die addy verändert !!






