Solved Error show XYZ with c++.

Hexui Undetected CSGO Cheats Sinkicheat PUBG Cheat

longkuteno3qb

Newbie
Full Member
Jan 27, 2015
21
124
0
C++:
#include <windows.h>
#include <iostream>
using namespace std;
int main(){
	DWORD PID;
	HWND hWnd = FindWindow(0,"AssaultCube");
	if (!hWnd)
	{
		cout<<"Khog tim thay cua so game";
	}else{
		GetWindowThreadProcessId(hWnd,&PID);
		HANDLE hProcess = OpenProcess(PROCESS_ALL_ACCESS,FALSE,PID);
		if (!hProcess){
			cout<<"Loi trong qua trinh viet memory"<<endl;
		}else{
			DWORD dwPlayerPtr = *(DWORD*)0x509B74;
			if(dwPlayerPtr != 0)
			{
				float *posiX;
				float *posiY;
				float *posiZ;
				posiX = (float*)((char *)dwPlayerPtr + 0x34);
				posiY = (float*)((char *)dwPlayerPtr + 0x38);
				posiZ = (float*)((char *)dwPlayerPtr + 0x3C);

				cout<<posiX<<endl;
				cout<<posiY<<endl;
				cout<<posiZ<<endl;
			}
		}

	}
	system("pause");
}
I code for Assault Cube game, but it haven't any error and it doesn't show float value. Help me.
 

Ellvis

Newbie
Full Member
Oct 26, 2012
19
688
0
Using ReadProcessMemory. That's all

(Khi đọc tiến trình từ process khác phải dùng API ReadProcessMemory với Process Handle là thông số trả về từ hàm OpenProcess. Sử dụng kiểu đọc thông số bằng pointer như code của bạn chỉ đọc được thông số của chính tiến trình hack. Thân!)
 

CreepSore

scared of variadic functions
Trump Tier Donator
Full Member
Jan 9, 2015
39
963
1
[COLOR="#4444cs"]This:
C++:
				float *posiX;
				float *posiY;
				float *posiZ;
				posiX = (float*)((char *)dwPlayerPtr + 0x34);
				posiY = (float*)((char *)dwPlayerPtr + 0x38);
				posiZ = (float*)((char *)dwPlayerPtr + 0x3C);

				cout<<posiX<<endl;
				cout<<posiY<<endl;
				cout<<posiZ<<endl;
is Wrong.

It should be like this:
C++:
				float *posiX;
				float *posiY;
				float *posiZ;
				posiX = (float*)(dwPlayerPtr + 0x34);
				posiY = (float*)(dwPlayerPtr + 0x38);
				posiZ = (float*)(dwPlayerPtr + 0x3C);

				cout<<*posiX<<endl;
				cout<<*posiY<<endl;
				cout<<*posiZ<<endl;

Oh, and also you are mixing external with internal, which is wrong.
[/COLOR]
 

r4z0r

Coder
Meme Tier VIP
Jul 21, 2016
246
2,678
13
[COLOR="#4444cs"]This:
C++:
				float *posiX;
				float *posiY;
				float *posiZ;
				posiX = (float*)((char *)dwPlayerPtr + 0x34);
				posiY = (float*)((char *)dwPlayerPtr + 0x38);
				posiZ = (float*)((char *)dwPlayerPtr + 0x3C);

				cout<<posiX<<endl;
				cout<<posiY<<endl;
				cout<<posiZ<<endl;
is Wrong.

It should be like this:
C++:
				float *posiX;
				float *posiY;
				float *posiZ;
				posiX = (float*)(dwPlayerPtr + 0x34);
				posiY = (float*)(dwPlayerPtr + 0x38);
				posiZ = (float*)(dwPlayerPtr + 0x3C);

				cout<<*posiX<<endl;
				cout<<*posiY<<endl;
				cout<<*posiZ<<endl;

Oh, and also you are mixing external with internal, which is wrong.
[/COLOR]
This will not work as well. He is making a external hack, this means he has to read the value of the his base adress with ReadMemoryAdress then add his offsets.

C++:
DWORD PlayerPointer = 0x50F4F4;
DWORD PlayerAddress = 0; //
ReadProcessMemory(handle, (LPVOID)PlayerPointer, &PlayerAddress, sizeof(PlayerAddress), NULL);
 

CreepSore

scared of variadic functions
Trump Tier Donator
Full Member
Jan 9, 2015
39
963
1
This will not work as well. He is making a external hack, this means he has to read the value of the his base adress with ReadMemoryAdress then add his offsets.

C++:
DWORD PlayerPointer = 0x50F4F4;
DWORD PlayerAddress = 0; //
ReadProcessMemory(handle, (LPVOID)PlayerPointer, &PlayerAddress, sizeof(PlayerAddress), NULL);
That's why I added the "Oh, and also you are mixing external with internal, which is wrong." Part.
 

longkuteno3qb

Newbie
Full Member
Jan 27, 2015
21
124
0
[COLOR="#4444cs"]This:
C++:
				float *posiX;
				float *posiY;
				float *posiZ;
				posiX = (float*)((char *)dwPlayerPtr + 0x34);
				posiY = (float*)((char *)dwPlayerPtr + 0x38);
				posiZ = (float*)((char *)dwPlayerPtr + 0x3C);

				cout<<posiX<<endl;
				cout<<posiY<<endl;
				cout<<posiZ<<endl;
is Wrong.

It should be like this:
C++:
				float *posiX;
				float *posiY;
				float *posiZ;
				posiX = (float*)(dwPlayerPtr + 0x34);
				posiY = (float*)(dwPlayerPtr + 0x38);
				posiZ = (float*)(dwPlayerPtr + 0x3C);

				cout<<*posiX<<endl;
				cout<<*posiY<<endl;
				cout<<*posiZ<<endl;

Oh, and also you are mixing external with internal, which is wrong.
[/COLOR]
thanks for reply but it not work
 

longkuteno3qb

Newbie
Full Member
Jan 27, 2015
21
124
0
Using ReadProcessMemory. That's all

(Khi đọc tiến trình từ process khác phải dùng API ReadProcessMemory với Process Handle là thông số trả về từ hàm OpenProcess. Sử dụng kiểu đọc thông số bằng pointer như code của bạn chỉ đọc được thông số của chính tiến trình hack. Thân!)
Bạn có thể cho mình code mẫu, mình thử mọi cách nhưng vẫn sai.
 

Ellvis

Newbie
Full Member
Oct 26, 2012
19
688
0
longkuteno3qb: r4z0r already answear about how to use "ReadProcessMemory". All you have to do is read value with multi pointer. Here is some exam:

https://guidedhacking.com/showthread.php?612-C-Writing-Multi-Level-Pointer
https://www.cheatengine.org/forum/viewtopic.php?t=554773&sid=30a04b1ab3fd3c637efd779d3233be84


C++:
 [USER=43101]longkuteno3qb[/USER]: Làm biếng code quá :"> . r4z0r đã trả lời về cách dùng hàm ReadProcessMemory rồi. Còn nếu bạn muốn đọc với multi Pointer thì tham khảo các code sau:

[url]https://guidedhacking.com/showthread.php?612-C-Writing-Multi-Level-Pointer[/url]
[url]https://www.cheatengine.org/forum/viewtopic.php?t=554773&sid=30a04b1ab3fd3c637efd779d3233be84[/url]

P/s: Đừng dùng hoàn toàn tiếng việt trên diễn đàn để tránh bị ban nhé bạn. Thân!
 

longkuteno3qb

Newbie
Full Member
Jan 27, 2015
21
124
0
This will not work as well. He is making a external hack, this means he has to read the value of the his base adress with ReadMemoryAdress then add his offsets.

C++:
DWORD PlayerPointer = 0x50F4F4;
DWORD PlayerAddress = 0; //
ReadProcessMemory(handle, (LPVOID)PlayerPointer, &PlayerAddress, sizeof(PlayerAddress), NULL);
I Test it but it doesn't success :((
 
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