ulysse31 Master Cheater
Reputation: 2
Joined: 19 Mar 2015 Posts: 324 Location: Paris
|
Posted: Sun Jan 08, 2017 4:23 pm Post subject: Re: Minecraft gamehacking |
|
|
Drollex wrote: | Hello, I want to make a minecraft trainer hack for infinite food, my code looks like this, but I have trouble finding the foodADD. I hope u can help me.
#include <iostream>
#include <windows.h>
using namespace std;
DWORD pID;
DWORD foodADD = 0xDC3eFCC4;
int food;
int nfood = food += 20;
int main()
{
cout<<"press arrow key"<<endl;
while(true){
if(GetAsyncKeyState(VK_UP)){
for(; {
HWND hwnd = FindWindowA(0, ("Minecraft 1.8.8"));
GetWindowThreadProcessId(hwnd, &pID);
HANDLE pHandle = OpenProcess(PROCESS_ALL_ACCESS, FALSE, pID);
ReadProcessMemory(pHandle, (LPVOID)foodADD, &food, (DWORD)sizeof(food), NULL);
WriteProcessMemory(pHandle, (LPVOID)foodADD, &nfood, (DWORD)sizeof(nfood), NULL);
}
}
}
system("pause");
return 1;
} |
Please use code balises the forum offers.
It's unclear where you are stuck, maybe the foodAdd changing every time the game starts is your problem or maybe you are just asking you get your code fixed.
So the problem with your code is those lines :
Code: | int food;
int nfood = food += 20; |
Since food is not initialised the value nfood and food hold is completely random.
Since both of those ints are defined globally you are adding 20 to random value at compile time and you will not add 20 to the value read from minecraft which is what you intended.
Code: | #include <iostream>
#include <windows.h>
using namespace std;
DWORD pID;
DWORD foodADD = 0xDC3eFCC4;
int food(0);
int nfood(0);
int main()
{
cout<<"press arrow key"<<endl;
while(true){
if(GetAsyncKeyState(VK_UP)){
for(;;){
HWND hwnd = FindWindowA(0, ("Minecraft 1.8.8"));
GetWindowThreadProcessId(hwnd, &pID);
HANDLE pHandle = OpenProcess(PROCESS_ALL_ACCESS, FALSE, pID);
ReadProcessMemory(pHandle, (LPVOID)foodADD, &food, (DWORD)sizeof(food), NULL);
nfood = food +20;
WriteProcessMemory(pHandle, (LPVOID)foodADD, &nfood, (DWORD)sizeof(nfood), NULL);
}
}
}
system("pause");
return 1;
} |
|
|