Solved CE Pointer information to C++

Hexui Undetected CSGO Cheats Sinkicheat PUBG Cheat

Tseno95

Newbie
Full Member
Jun 9, 2014
26
188
0
I want to find the static address of an dynamic address so I don't have to look it up every time I start the game.
My code so far:
C++:
#include <iostream>
#include <windows.h>

using namespace std;

int main()
{
	LPCSTR Game_Name = "Starcraft II";
	HWND sc2_window = FindWindow(0, (Game_Name));
	HANDLE hProcess;
	DWORD program_id;

	if (!sc2_window)
	{
		cout << "status:(sc2_window) - Not Found!" << endl;
		cout << "Start Starcraft II first!" << endl;
		cin.get();
	}
	else
	{
		cout << "status:(sc2_window) - Found!" << endl;
		if (sc2_window)
		{
			DWORD program_id;
			GetWindowThreadProcessId(sc2_window, &program_id);
			HANDLE handler_process = OpenProcess(PROCESS_ALL_ACCESS, FALSE, program_id);
			if (!handler_process)
			{
				cout << "status:(sc2_process) - Not Opened!" << endl;
				cin.get();
			}
			else
			{
				cout << "status:(sc2_process) - Opened!" << endl;
				DWORD GAME_BASE = 0x01770000;
				DWORD WORK_C = (DWORD)GetModuleHandleA("SC2.exe") + 0x0112F5EC;
				DWORD Offset1 = 0x6B8;
                DWORD Address;
				int WORK_COUNT;

				ReadProcessMemory(handler_process, (LPCVOID*)(GAME_BASE), &Address, 4, 0);
				WORK_COUNT = ReadProcessMemory(handler_process, (LPCVOID*)(Address + Offset1), &WORK_COUNT, 4, 0);
				//WORK_COUNT = ReadProcessMemory(handler_process, (void*)Off3, &WORK_COUNT, 4, 0);

				cout << WORK_COUNT << endl;
			}
		}
	}

	cin.get();
	return 0;
}

How do I do this in C++ ?
Asking for code ? Yes I am asking for code because I've asked several times on THIS and another forum and I seem to get no useful information.
I've look ALL over the internet and I do not seem to figure out how to do it.
Can someone please do it for me and explain it?
I've tweaked my code in all kinds of ways but still gives me BS information.
 
Last edited:

Nether

The Angel Of Verdun
Meme Tier VIP
Dank Tier Donator
Dec 11, 2013
293
3,738
16
Nether, sorry for being such a pain in the ass, but now when I try to compile I get this:

1>------ Build started: Project: STIM, Configuration: Debug Win32 ------
1> main.cpp
1>main.obj : error LNK2019: unresolved external symbol "public: __thiscall ProcMem::procMem(void)" (??0ProcMem@@QAE@XZ) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "public: __thiscall ProcMem::~ProcMem(void)" (??1ProcMem@@QAE@XZ) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "public: virtual void __thiscall ProcMem::process(char *)" (?Process@ProcMem@@UAEXPAD@Z) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "public: virtual unsigned long __thiscall ProcMem::Module(char *)" (?Module@ProcMem@@UAEKPAD@Z) referenced in function _main
1>C:\Users\Hulk\documents\visual studio 2012\Projects\STIM\Debug\STIM.exe : fatal error LNK1120: 4 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


I did everything you told me to do.
I am set on character set is multi-byte and everything.
Maybe something compiler-ish is broken ?
I thought of download DEV C++ to try it there, but still rather hear what you have to say.
If your getting errors such as these from trying to use my source code, you have to go back and learn the basics im afraid, you have obviously not linked the headers to the cpp files correctly.

https://guidedhacking.com/threads/start-here-beginners-guide-to-learning-game-hacking.5911/
 
Last edited by a moderator:

Nether

The Angel Of Verdun
Meme Tier VIP
Dank Tier Donator
Dec 11, 2013
293
3,738
16
I want to find the static address of an dynamic address so I don't have to look it up every time I start the game.
My code so far:
C++:
#include <iostream>
#include <windows.h>

using namespace std;

int main()
{
	LPCSTR Game_Name = "Starcraft II";
	HWND sc2_window = FindWindow(0, (Game_Name));
	HANDLE hProcess;
	DWORD program_id;

	if (!sc2_window)
	{
		cout << "status:(sc2_window) - Not Found!" << endl;
		cout << "Start Starcraft II first!" << endl;
		cin.get();
	}
	else
	{
		cout << "status:(sc2_window) - Found!" << endl;
		if (sc2_window)
		{
			DWORD program_id;
			GetWindowThreadProcessId(sc2_window, &program_id);
			HANDLE handler_process = OpenProcess(PROCESS_ALL_ACCESS, FALSE, program_id);
			if (!handler_process)
			{
				cout << "status:(sc2_process) - Not Opened!" << endl;
				cin.get();
			}
			else
			{
				cout << "status:(sc2_process) - Opened!" << endl;
				DWORD GAME_BASE = 0x01770000;
				DWORD WORK_C = (DWORD)GetModuleHandleA("SC2.exe") + 0x0112F5EC;
				DWORD Offset1 = 0x6B8;
                DWORD Address;
				int WORK_COUNT;

				ReadProcessMemory(handler_process, (LPCVOID*)(GAME_BASE), &Address, 4, 0);
				WORK_COUNT = ReadProcessMemory(handler_process, (LPCVOID*)(Address + Offset1), &WORK_COUNT, 4, 0);
				//WORK_COUNT = ReadProcessMemory(handler_process, (void*)Off3, &WORK_COUNT, 4, 0);

				cout << WORK_COUNT << endl;
			}
		}
	}

	cin.get();
	return 0;
}

How do I do this in C++ ?
Asking for code ? Yes I am asking for code because I've asked several times on THIS and another forum and I seem to get no useful information.
I've look ALL over the internet and I do not seem to figure out how to do it.
Can someone please do it for me and explain it?
I've tweaked my code in all kinds of ways but still gives me BS information.
https://guidedhacking.com/showthread.php?5093-Nether-s-C-Memory-Class-V1-6-10 << all you'll ever need :)

Ill add more documentation on it tomorrow on how to use all the functions.

C++:
#include "ProcMem"
using namespace std;

int main(){

ProcMem Mem;

Mem.Process("Game.exe");
DWORD Base = Mem.Module("Game.exe");
int Health = Mem.Read<int>(Base + 0x112F5EC, "\x0x5F\x3B\*", true);
std::cout << "The Value Of Health = " << Health;


return ;
}
 

Tseno95

Newbie
Full Member
Jun 9, 2014
26
188
0
Thank you Nether and Superspinne ! REALLY appreciated !
Nether, yes more documentation please :)

Nether what is thi tho : \x0x5F\x3B\ ?


**EDIT**

Nether I get this:
1>------ Build started: Project: STIM, Configuration: Debug Win32 ------
1> main.cpp
1>c:\users\hulk\documents\visual studio 2012\projects\stim\stim\main.cpp(11): warning C4129: '*' : unrecognized character escape sequence
1>c:\users\hulk\documents\visual studio 2012\projects\stim\stim\procmemh.h(59): error C2664: 'ProcMem::iSizeOfArray' : cannot convert parameter 1 from 'char *' to 'int *'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1> c:\users\hulk\documents\visual studio 2012\projects\stim\stim\main.cpp(11) : see reference to function template instantiation 'cData ProcMem::Read<int>(DWORD,char *,BOOL)' being compiled
1> with
1> [
1> cData=int
1> ]
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


When I try to compile this :
C++:
#include "ProcMemH.h"

using namespace std;

int main()
{
	ProcMem Mem;

	Mem.Process("SC2.exe");
	DWORD Base = Mem.Module("SC2.exe");
	int WORK_C = Mem.Read<int>(Base + 0x01770000, "\x0x5F\x3B\*", true);
		cout << "<Player1 Worker Count: >" << WORK_C << endl;
	return 0;
}
 
Last edited:

Nether

The Angel Of Verdun
Meme Tier VIP
Dank Tier Donator
Dec 11, 2013
293
3,738
16
Thank you Nether and Superspinne ! REALLY appreciated !
Nether, yes more documentation please :)

Nether what is thi tho : \x0x5F\x3B\ ?


**EDIT**

Nether I get this:
1>------ Build started: Project: STIM, Configuration: Debug Win32 ------
1> main.cpp
1>c:\users\hulk\documents\visual studio 2012\projects\stim\stim\main.cpp(11): warning C4129: '*' : unrecognized character escape sequence
1>c:\users\hulk\documents\visual studio 2012\projects\stim\stim\procmemh.h(59): error C2664: 'ProcMem::iSizeOfArray' : cannot convert parameter 1 from 'char *' to 'int *'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1> c:\users\hulk\documents\visual studio 2012\projects\stim\stim\main.cpp(11) : see reference to function template instantiation 'cData ProcMem::Read<int>(DWORD,char *,BOOL)' being compiled
1> with
1> [
1> cData=int
1> ]
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


When I try to compile this :
C++:
#include "ProcMemH.h"

using namespace std;

int main()
{
	ProcMem Mem;

	Mem.Process("SC2.exe");
	DWORD Base = Mem.Module("SC2.exe");
	int WORK_C = Mem.Read<int>(Base + 0x01770000, "\x0x5F\x3B\*", true);
		cout << "<Player1 Worker Count: >" << WORK_C << endl;
	return 0;
}

C++:
  int WORK_C = Mem.Read<int>(Base + 0x01770000, "\x5F\x3B\*", true);
the '*' is to say the end of the array, also make sure your character set is multi-byte, and what your asking was just of an example.
 

Nether

The Angel Of Verdun
Meme Tier VIP
Dank Tier Donator
Dec 11, 2013
293
3,738
16
How do you find out this "\x5F\x3B\*?
it doesent mean anything, I randomly wrote them in as an example to show you how it would be written :facepalm:

also i noticed your code before : DWORD Offset1 = 0x6B8;

that is too big for an offset what you need to do is:

C++:
    ProcMem Mem;
 
    Mem.Process("SC2.exe");
    DWORD Base = Mem.Module("SC2.exe");
    DWORD TMP = mem.Read<DWORD>(Base + 0x1770000);
    int WORK_C = mem.Read<int>(TMP+0x6B8);
 
Last edited:

Tseno95

Newbie
Full Member
Jun 9, 2014
26
188
0
Nether, sorry for being such a pain in the ass, but now when I try to compile I get this:

1>------ Build started: Project: STIM, Configuration: Debug Win32 ------
1> main.cpp
1>main.obj : error LNK2019: unresolved external symbol "public: __thiscall ProcMem::procMem(void)" (??0ProcMem@@QAE@XZ) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "public: __thiscall ProcMem::~ProcMem(void)" (??1ProcMem@@QAE@XZ) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "public: virtual void __thiscall ProcMem::process(char *)" (?Process@ProcMem@@UAEXPAD@Z) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "public: virtual unsigned long __thiscall ProcMem::Module(char *)" (?Module@ProcMem@@UAEKPAD@Z) referenced in function _main
1>C:\Users\Hulk\documents\visual studio 2012\Projects\STIM\Debug\STIM.exe : fatal error LNK1120: 4 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


I did everything you told me to do.
I am set on character set is multi-byte and everything.
Maybe something compiler-ish is broken ?
I thought of download DEV C++ to try it there, but still rather hear what you have to say.
 
Last edited:
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