I have tried something similar to the code I have now in the past, and it worked fine, however now when I try to edit the memory I return with the "else" statement rather than the write successful message. It also is not editing the memory either. [Yes I am offline when testing these so I can prevent Vac.] Can anyone help? Here is my code:
#include <iostream>
#include <windows.h>
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
using namespace std;
int main()
{
cout << "Black Ops 3 must be open for this tool to work!" << endl;
system("Pause");
HWND hwnd = FindWindow(0, "Call of Duty® - ship - Microsoft Office");
if(hwnd == 0)
{
cout << "Black Ops 3 has not been detected as opened yet" << endl;
system("Pause");
}
else
{
DWORD proccess_ID;
GetWindowThreadProcessId(hwnd, &proccess_ID);
HANDLE hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, proccess_ID);
cout << "Black Ops 3 has successfully been detected!" << endl;
cout << "Type :";
int Option;
cin >> Option;
if (Option == 1)
{
cout << "Please enter your desired cash..." << endl;
cout << "Type :";
int Points;
cin >> Points;
DWORD newdatasize = sizeof(Points);
if (WriteProcessMemory(hProcess, (LPVOID)0x80A9CE4, &Points, newdatasize, NULL))
{
cout << "Your pills has been successfully written and added to the game, enjoy!" << endl;
system("Pause");
}
else
{
cout << "Nope";
}
}
}
}
First of all, don't use the namespace std. Just manually write std::cout.
Where exactly is your code breaking?
Give us more details.
What's the last message shown in the console?
BTW: if you release code pleas use code tags to get better overview over the code.
soeni77 (09-03-2016)
soeni77 (09-03-2016)
soeni77 (09-03-2016),tommyboy007 (09-06-2016)
soeni77 (09-04-2016)
The using directive is fine when used in a translation unit, it's bad just when used in header files. And, if I want to do this:
it's also good, because I'm using it just in that function's scope.Code:#include <iostream> #include <windows.h> int main() { using namespace std; cout << "Black Ops 3 must be open for this tool to work!" << endl; system("Pause"); HWND hwnd = FindWindow(0, "Call of Duty® - ship - Microsoft Office"); if(hwnd == 0) { cout << "Black Ops 3 has not been detected as opened yet" << endl; system("Pause"); } else { DWORD proccess_ID; GetWindowThreadProcessId(hwnd, &proccess_ID); HANDLE hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, proccess_ID); cout << "Black Ops 3 has successfully been detected!" << endl; cout << "Type :"; int Option; cin >> Option; if (Option == 1) { cout << "Please enter your desired cash..." << endl; cout << "Type :"; int Points; cin >> Points; DWORD newdatasize = sizeof(Points); if (WriteProcessMemory(hProcess, (LPVOID)0x80A9CE4, &Points, newdatasize, NULL)) { cout << "Your pills has been successfully written and added to the game, enjoy!" << endl; system("Pause"); } else { cout << "Nope"; } } } }
Nine11 (02-13-2017)
Umm... maybe unless you have changed it yourself...
Black Ops 3 isn't named "Call of Duty® - ship - Microsoft Office"