Pointer and adress

Posts 1–10 of 10 · Page 1 of 1
Pointer and adress
I've got adress and pointer of this adress (using CheatEngine) and need to get value of this adress in C++ program, when using first(dynamic - 0EE06390) adress all was ok, but when I wont to use adress of pointer (0018926C) program return stupid numbers, anywone can help me ?
Code:
#include <iostream>
#include <windows.h>

using std::cout;
using std::endl;

int main(void)
{
    int money;
    HWND GameWindow = FindWindow(0, "Plants vs. Zombies");
    if(GameWindow)
    {
        DWORD  ProcessID;
        cout << "Znalazlem okno gry. Zczytuje pamiec" << endl << endl;
        GetWindowThreadProcessId(GameWindow, &ProcessID);
        HANDLE Proces = OpenProcess(PROCESS_VM_READ, false, ProcessID);
        ReadProcessMemory(Proces, (PCVOID)0x0EE06390, &money, sizeof(PVOID), 0);
        cout << money;
    }
}
Your code shouldn't be able to work.

PCVOID is undefine & try to use this sizeof(money) instead of pvoid.
What if your program couldn't find the window then what? try doing a else statement for that.
You're code looks like it's written by a guy who just learned basics of C++.
Fucking learn the language before trying to create cheats.

Just like @Hitokiri~ said to another guy, You can't run before learning to walk.
I don't know why everyone is so hostile..... Google answered your question OP, try using it first before you post and you should really read/learn more of the basics first.

Answer


If you still REALLY can't find it

______Extra_______

Code:
int main(void)
Is pointless in C++

And as CoBraX pointed out
Code:
sizeof(PVOID)
should be
Code:
sizeof(money)
+ I don't even know where you got PCVOID unless you misread LPVOID
All work. I get value from pointer, but this wasn't numbers , only adress , when I get this adress and add offset all working That was my problem. Pointer returning adress and i don't know what is this
Try this code it's a simple dll hack I didn't test it out.
What it should do is change the value of the address to 999

Code:
#include <Windows.h>
#include <iostream>
using namespace std;

void hackFunction()
{
  *(DWORD_PTR*)(0x0EE06390) = 999;
}

BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpvReserved)
{
	if(dwReason == DLL_PROCESS_ATTACH)
	{
		CreateThread(NULL, NULL,(LPTHREAD_START_ROUTINE)&hackFunction,NULL,NULL,NULL);
		MessageBox(NULL, L"By CoBraX", L"Hackv0", MB_OK);
	}
	return 0;
}
Quote Originally Posted by CoBraX View Post
PCVOID is undefine & try to use this sizeof(money) instead of pvoid.
Quote Originally Posted by InunoTaishou View Post
I don't even know where you got PCVOID unless you misread LPVOID
Wrong, sizeof() works with any void data type.

PVOID, PCVOID, LPCVOID are all the same btw. All sizes are 4 bytes on x86 programs and 8 on x64 programs.
Quote Originally Posted by Hitokiri~ View Post



Wrong, sizeof() works with any void data type.

PVOID, PCVOID, LPCVOID are all the same btw. All sizes are 4 bytes on x86 programs and 8 on x64 programs.
Trying to execute the code he posted, with only the two header files, throws an undeclared identifier.

MSDN document for windows data types does not include PCVOID. It does have LPCVOID (const void*), LPVOID (void *), and PVOID (void *)

However, the cfgmgr32.h header file does have a typedef for PCVOID as a const void * which he could use, if he had included the file.

So again, I don't know where he got PCVOID since it was not defined anywhere in any of the files he included.
Quote Originally Posted by InunoTaishou View Post
Trying to execute the code he posted, with only the two header files, throws an undeclared identifier.

MSDN document for windows data types does not include PCVOID. It does have LPCVOID (const void*), LPVOID (void *), and PVOID (void *)

However, the cfgmgr32.h header file does have a typedef for PCVOID as a const void * which he could use, if he had included the file.

So again, I don't know where he got PCVOID since it was not defined anywhere in any of the files he included.
Oh, I was wrong. PCVOID doesn't actually exist.
I'm not wrong often.

brb gonna cry.
Posts 1–10 of 10 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us