Solved ReadProcessMemory please

Hexui Undetected CSGO Cheats Sinkicheat PUBG Cheat

brunob2

Newbie
Sep 25, 2016
1
32
0
C++:
// testhack2.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include <windows.h>
#include <iostream>

HANDLE grablehandle(char* game) {

	HWND gamewindow = FindWindowA(NULL, "Counter-Strike Source");
	if (!gamewindow) {
		std::cout << "O JOGO NAO FOI ACHADO\n";
		return NULL;


	}


	DWORD processID;
	GetWindowThreadProcessId(gamewindow, &processID);
	if (!processID) {
		std::cout << "NAO FOI POSSIVEL ACHAR A ID DO PROCESSO\n";
		return NULL;
	}



	HANDLE handle = OpenProcess(PROCESS_ALL_ACCESS, FALSE, processID);
	if (handle == INVALID_HANDLE_VALUE) {
		std::cout << "NAO FOI POSSIVEL ACHAR A IHANDLE DO PROCESSO\n";
		return NULL;
	}



}

int main()
{
	HANDLE handle = grablehandle("Counter-Strike Source");
	    DWORD LocalPlayer = (DWORD)GetModuleHandle(L"server.dll")+0x4F2FFC;
		DWORD pGranade = 0xe4;

		while (1) {
			if (GetAsyncKeyState(VK_NUMPAD1) & 1) {
				DWORD lplayer;
				ReadProcessMemory(handle, (void*)LocalPlayer, &lplayer, sizeof(DWORD), NULL);

				int Granade;
				ReadProcessMemory(handle, (void*)(lplayer+ pGranade), &Granade, sizeof(DWORD), NULL);

				std::cout << "POSIÇÃO DO X DO BOT E : "<< LocalPlayer << std::endl;
			}
		}










    return 0;
}
can anyone tell what is wrong and how to fix?
 
Attention! Before you post:

Read the How to Ask Questions Guide
99% of questions are answered in the Beginner's Guide, do it before asking a question.

No Hack Requests. Post in the correct section.  Search the forum first. Read the rules.

How to make a good post:

  • Fill out the form correctly
  • Tell us the game name & coding language
  • Post everything we need to know to help you
  • Ask specific questions, be descriptive
  • Post errors, line numbers & screenshots
  • Post code snippets using code tags
  • If it's a large project, zip it up and attach it

If you do not comply, your post may be deleted.  We want to help, please make a good post and we will do our best to help you.

Community Mods