Hallo Community,
ich hab nen Trainer für S4 League geschrieben, in C++.
S4 League wird durch XTrap geschützt, die Folge:
man kann keine Values per Cheat Engine finden (zumindest auf x32) und man
bekommt den Process Handle von S4 League nicht (Errorcode 5).
Da aber jemand in der S4 League Section einen Trainer in AutoIt geschrieben
hat, der auch auf x32 funktioniert, habe ich mir den Sourcecode von ihm besorgt
und ihn gefragt wie er es hingkrigt hat. Er sagte mir, dass er den Trainer vor
dem Start von S4 League startet und sobald S4 startet ändert sein Trainer die
Values, weil XTrap.xt ungefähr 1 Sekunde nach S4Client.exe gestartet wird.
Da hab ich mir gedacht, dass ich es auch so mache und mir sobald S4 offen ist
den Window Handle, dann die Process Id und schließlich den Process Handle hole,
um mit ReadProcessMemory und WriteProcessMemory das Value zu verändern.
Jedoch kommt beim Process Handle immernoch Errorcode 5 und ich wieß nicht woran das liegt.
English version
Hello community,
I've coded a trainer for S4 League with C++.
S4 League is protected by XTrap which causes that you can't find any values
with a Cheat Engine (at least with x32) and you can't get the process handle
of S4 League (errorcode 5).
But Alastor has coded a trainer for S4 League (in the S4 section) which works
without a bypass for x32. So I asked him for the sourcecode of his trainer
and how he managed it. He told me that his trainer has to be started before
S4 League and as soon as S4 starts, the trainer changes the values because
XTrap.xt starts about 1 second after S4Client.exe.
So i thought I could do the same with my trainer but I still get the errorcode 5
and I still don't know why it doesn't work.
Hier mal der Source.
Here's the sourcecode.
PHP Code:
#include <windows.h>
#include <iostream>
using namespace std;
int main()
{
float a;
cout << "Type in the value! " << endl;
cin >> a;
HWND hwnd;
do
{
hwnd = FindWindow(0,L"S4 Client");
Sleep(10);
} while(!hwnd);
cout << "Windowhandle: " << hwnd << endl;
DWORD Id;
GetWindowThreadProcessId(hwnd,&Id);
if(!Id)
{
cout << "Process ID not found! Errorcode : " << GetLastError() << endl;
}
else
{
cout << "Process ID: " << Id << endl;
HANDLE ProcessHandle;
ProcessHandle = OpenProcess(PROCESS_ALL_ACCESS ,FALSE,Id);
if(!ProcessHandle)
{
cout << "Process Handle not found! Errorcode : " << GetLastError() << endl;
}
else
{
cout << "Process Handle: " << ProcessHandle << endl;
unsigned adress = 0x00C334A8;
float value = 3000;
ReadProcessMemory(ProcessHandle, (void*)adress, &value, 4, NULL);
WriteProcessMemory(ProcessHandle,(LPVOID)adress,&a ,sizeof(float),NULL);
cout << "Finished " << endl;
}
cin.get();
}
}
Bedenkt bitte, dass ich noch kompletter C++ Anfänger bin.
Please consider I'm a totally beginner with C++.
Ich hoffe, ihr könnt mir helfen.
I hope you can help me.