Ich versuche mich seid längerem daran ein maphack selber zu schreiben in c++
bin noch anfänger!
ich habe mich bei diesem code and die vorgänger gehalten weil es bei mir erst probleme gab mit dem compiler von MSVS 2010 bin ich auf MSVS Express 2012 umgestiegen.
Okay jetzt zum code oder zum eigentlichen fehler :
SourceCode:
#include <windows.h>
int main()
{
//Find wc3 windows
HWND hwar3=::FindWindow(NULL,"Warcraft III")
;HANDLE hcurrent = GetCurrentProcess();
HANDLE hToken;
BOOL bret=OpenProcessToken(hcurrent,40,&hToken);
LUID luid;
bret=LookupPrivilegeValue(NULL,"SeDebugPrivilege", &luid);
TOKEN_PRIVILEGES NewState,PreviousState;
DWORD ReturnLength;
NewState.PrivilegeCount =1;
NewState.Privileges[0].Luid =luid;
NewState.Privileges[0].Attributes=2;
bret=AdjustTokenPrivileges(hToken,FALSE,&NewState, 28,&PreviousState,&ReturnLength);
DWORD PID, TID;
TID = ::GetWindowThreadProcessId (hwar3, &PID);
//Open wc3 process
HANDLE hopen=OpenProcess( PROCESS_ALL_ACCESS|PROCESS_TERMINATE|PROCESS_VM_OP ERATION|PROCESS_VM_READ|
PROCESS_VM_WRITE,FALSE,PID);
//Write memory
//02661563 66:B9 0F00 - 0x66 0xB9 0x0F 0x00 MOV DI,0FF
DWORD data=0x66;
bret=WriteProcessMemory(hopen,(LPVOID)0x02661563,& data,1,0);
data=0xB9;
bret=WriteProcessMemory(hopen,(LPVOID)0x02661564,& data,1,0);
data=0x0F;
bret=WriteProcessMemory(hopen,(LPVOID)0x02661565,& data,1,0);
data=0x00;
bret=WriteProcessMemory(hopen,(LPVOID)0x02661566,& data,1,0);
//Close handle
bret=CloseHandle(hopen);
return 0;
}
okay ist durchgelaufen ohne probleme wollte dann mal gucken ob ich ihn an denn process anhängen kann (WARCRAFT 3 )und es ging nicht hab mir dann nix bei gedacht und exe erstellt.Habe dann die exe beim spiel gestartet dann kam kurz eine Schwarze console aufgeblinkt und nix ist passiert (ingame).
kann mir vllt jmd genaueres sagen?
vielen dank für die hilfe schonmal peace out!
ENGLISH:
hallihallo hallöle,
I try are prolonged it a Maphack himself to write in c ++
am still beginner!
I was kept in this code and the predecessor because there were only problems for me with the compiler of MSVS 2010, I switched to MSVS Express 2012 Design.
Okay now for the code or the actual error:
#include <windows.h>
int main()
{
//Find wc3 windows
HWND hwar3=::FindWindow(NULL,"Warcraft III")
;HANDLE hcurrent = GetCurrentProcess();
HANDLE hToken;
BOOL bret=OpenProcessToken(hcurrent,40,&hToken);
LUID luid;
bret=LookupPrivilegeValue(NULL,"SeDebugPrivilege", &luid);
TOKEN_PRIVILEGES NewState,PreviousState;
DWORD ReturnLength;
NewState.PrivilegeCount =1;
NewState.Privileges[0].Luid =luid;
NewState.Privileges[0].Attributes=2;
bret=AdjustTokenPrivileges(hToken,FALSE,&NewState, 28,&PreviousState,&ReturnLength);
DWORD PID, TID;
TID = ::GetWindowThreadProcessId (hwar3, &PID);
//Open wc3 process
HANDLE hopen=OpenProcess( PROCESS_ALL_ACCESS|PROCESS_TERMINATE|PROCESS_VM_OP ERATION|PROCESS_VM_READ|
PROCESS_VM_WRITE,FALSE,PID);
//Write memory
//02661563 66:B9 0F00 - 0x66 0xB9 0x0F 0x00 MOV DI,0FF
DWORD data=0x66;
bret=WriteProcessMemory(hopen,(LPVOID)0x02661563,& data,1,0);
data=0xB9;
bret=WriteProcessMemory(hopen,(LPVOID)0x02661564,& data,1,0);
data=0x0F;
bret=WriteProcessMemory(hopen,(LPVOID)0x02661565,& data,1,0);
data=0x00;
bret=WriteProcessMemory(hopen,(LPVOID)0x02661566,& data,1,0);
//Close handle
bret=CloseHandle(hopen);
return 0;
}
okay has passed without problems would then let's see if I can attach it to process because (WARCRAFT 3) and it was not then thought to myself nix at and exe erstellt.Habe then the exe started when play came just a black console and aufgeblinkt nothing has happened (in-game).
can vllt jmd accurate tell me?
many thanks for the help in advance peace out!
kk, found my fail
ty anyway
RE OPENED !!
okay like i said i fix the problem! But now,everytime i restart the game the static address change
the first 200 times it didnt why?
example:
02661563 First this
02561253 than this
is there are way to read the binary and write to it ?






