Cela fait un moment déja que je programme en C++ (j'ais les bases), et la je me lance dans les trainers. Je sais quoi faire appart se qu'il faut changer (c'est con) ! Mon trainer marche très bien, mais pas quand je re-démare le jeu puisque la mémoire change, comment contourné ce probléme.
Merci.
Mes codes:
#include <iostream>
#include <windows.h>
using namespace std;
HANDLE hCon;
enum Color { DARKBLUE = 1, DARKGREEN, DARKTEAL, DARKRED, DARKPINK, DARKYELLOW, GRAY, DARKGRAY, BLUE, GREEN, TEAL, RED, PINK, YELLOW, WHITE };
void SetColor(Color c){
if(hCon == NULL)
hCon = GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleTextAttribute(hCon, c);
}
using namespace std;
void Write();
int main()
{
cout<<""<< endl;
SetColor (RED);
cout<<" ..._...|..__________________ __, , "<< endl;
cout<<" ....../ `–-___________–– ;_____|] = = = = POW "<< endl;
cout<<" ...../_==o;;;;;;;;_______.:/ "<< endl;
cout<<" .....), –-.(_(__) / "<< endl;
cout<<" ....// (..) ), –– "<< endl;
cout<<" ...//___// "<< endl;
cout<<" ..//___//"<< endl;
cout<<" .//___// "<< endl;
cout<<""<< endl;
cout<<""<< endl;
cout<<" Bienvenue dans Rino Bot Trainer :"<< endl; //header de la console
cout<<""<< endl;
cout<<" -Touche 0 pour ajouter 1000 points."<< endl; //header de la console
cout<<" -Touche 1 pour vies infini."<< endl;
cout<<" -Touche 2 pour respiration sous l'eau infini."<< endl;
cout<<""<< endl;
cout<<""<< endl;
cout<<" Historiques:"<< endl;
cout<<""<< endl;
while(1)
{
if(GetAsyncKeyState(VK_NUMPAD0)==-32768) { //touche pour BIND
Write();
}
Sleep(75);
}
return 0;
}
void Write()
{
DWORD address = 0x03975494; //adress de l'item a changer
int valueAtAddress = 0;
HANDLE hProcess = 0; HWND hWindow;
DWORD pid = 0;
hWindow = FindWindow(NULL, L"Call Of Duty®"); //Nom du programme pour le cibler
if (hWindow) {
cout<<"window found"<<endl; GetWindowThreadProcessId(hWindow, &pid);
}
hProcess = OpenProcess(PROCESS_VM_READ | PROCESS_VM_WRITE | PROCESS_VM_OPERATION | PROCESS_QUERY_INFORMATION, 0, pid); VirtualProtectEx(hProcess, (LPVOID)address, 256, PAGE_EXECUTE_READWRITE, NULL);
ReadProcessMemory(hProcess,(LPCVOID)address,&valueAtAddress,sizeof(valueAtAddress),NULL);
cout <<" Le nombre de point est maintenant de " << valueAtAddress << endl; //MSGS d'information
DWORD value = valueAtAddress + 1000; //valeur ajouté a la valeur initial
WriteProcessMemory(hProcess,(LPVOID)address,&value,sizeof(value),NULL);
CloseHandle(hProcess);
}
Merci.
Mes codes:
#include <iostream>
#include <windows.h>
using namespace std;
HANDLE hCon;
enum Color { DARKBLUE = 1, DARKGREEN, DARKTEAL, DARKRED, DARKPINK, DARKYELLOW, GRAY, DARKGRAY, BLUE, GREEN, TEAL, RED, PINK, YELLOW, WHITE };
void SetColor(Color c){
if(hCon == NULL)
hCon = GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleTextAttribute(hCon, c);
}
using namespace std;
void Write();
int main()
{
cout<<""<< endl;
SetColor (RED);
cout<<" ..._...|..__________________ __, , "<< endl;
cout<<" ....../ `–-___________–– ;_____|] = = = = POW "<< endl;
cout<<" ...../_==o;;;;;;;;_______.:/ "<< endl;
cout<<" .....), –-.(_(__) / "<< endl;
cout<<" ....// (..) ), –– "<< endl;
cout<<" ...//___// "<< endl;
cout<<" ..//___//"<< endl;
cout<<" .//___// "<< endl;
cout<<""<< endl;
cout<<""<< endl;
cout<<" Bienvenue dans Rino Bot Trainer :"<< endl; //header de la console
cout<<""<< endl;
cout<<" -Touche 0 pour ajouter 1000 points."<< endl; //header de la console
cout<<" -Touche 1 pour vies infini."<< endl;
cout<<" -Touche 2 pour respiration sous l'eau infini."<< endl;
cout<<""<< endl;
cout<<""<< endl;
cout<<" Historiques:"<< endl;
cout<<""<< endl;
while(1)
{
if(GetAsyncKeyState(VK_NUMPAD0)==-32768) { //touche pour BIND
Write();
}
Sleep(75);
}
return 0;
}
void Write()
{
DWORD address = 0x03975494; //adress de l'item a changer
int valueAtAddress = 0;
HANDLE hProcess = 0; HWND hWindow;
DWORD pid = 0;
hWindow = FindWindow(NULL, L"Call Of Duty®"); //Nom du programme pour le cibler
if (hWindow) {
cout<<"window found"<<endl; GetWindowThreadProcessId(hWindow, &pid);
}
hProcess = OpenProcess(PROCESS_VM_READ | PROCESS_VM_WRITE | PROCESS_VM_OPERATION | PROCESS_QUERY_INFORMATION, 0, pid); VirtualProtectEx(hProcess, (LPVOID)address, 256, PAGE_EXECUTE_READWRITE, NULL);
ReadProcessMemory(hProcess,(LPCVOID)address,&valueAtAddress,sizeof(valueAtAddress),NULL);
cout <<" Le nombre de point est maintenant de " << valueAtAddress << endl; //MSGS d'information
DWORD value = valueAtAddress + 1000; //valeur ajouté a la valeur initial
WriteProcessMemory(hProcess,(LPVOID)address,&value,sizeof(value),NULL);
CloseHandle(hProcess);
}