Discuss Best way to ReadProcMem?

Hexui Undetected CSGO Cheats Sinkicheat PUBG Cheat

HexMurder

Arcane Hacker
Dank Tier VIP
Dank Tier Donator
Jun 7, 2012
319
7,988
22
I never put much though into this, but i'm now working on a project that actually eats up a good bit of cpu as it's very large (compared to all the other hacks i have done). So now it has me wondering.
Lets say you have a hack that has a few features: ESP, triggerbot, aimbot, etc.

This hack also has a struct/class as follows.

C++:
struct enemy
{
	int health;
	int armor;
	int ammo;
	Vec3 location;
	//etc.
	
	void readData(int playerNum)
	{
		//this function would read memory and assign it to the above items above.
	}
}
Traditionally (as i have been taught) you would only call this data when you needed it.
like the first line or so of a triggerbot would be

C++:
for(int i = 0;i<maxPlayers;i++)
{
    enemy[i].readData(i);
}
This works great.

However when i have 10 different functions (the aimbot, the esp, the trigger, etc) all calling that readData function all the time it seems a little silly to do it that way.
Wouldn't it make more sense to create a dedicated thread that simply calls the readData function constantly?

Pros and cons of doing one way over the other? I'm curious what you guys think.

Something strange i noticed is that when i stopped calling the readdata function in my esp thread, and replaced it with a dedicated reading thread, i had a TON of flickering from my esp which is not there otherwise.
 
Last edited:

HexMurder

Arcane Hacker
Dank Tier VIP
Dank Tier Donator
Jun 7, 2012
319
7,988
22
What? bro did you even read my op? lol?
 

mambda

headass
Escobar Tier VIP
Trump Tier Donator
Jun 25, 2014
2,294
37,938
269
1.) Multithreading isnt necessary, could get some cheeky race conditions, just have it all in one big loop -> read ents -> esp -> triggerbot -> aimbot -> restart

2.) Flickering is because your second thread isnt high enough priority 9 times out of 10, nothing strange, just windows
 

Obsta

Jr.Hacker
Meme Tier VIP
Jan 27, 2014
394
2,978
17
1.) Multithreading isnt necessary, could get some cheeky race conditions, just have it all in one big loop -> read ents -> esp -> triggerbot -> aimbot -> restart
You don't want your winapi calls running on the same thread as your cheat logic, this will introduce unnecessary delay (providing your reading each offset individually and not the entire data structure, which for some bizarre reason is the way that has become standard for beginners.)
keeping them separate but restricted to two threads will eliminate any race conditions


2.) Flickering is because your second thread isnt high enough priority 9 times out of 10, nothing strange, just windows
Using more than a single buffer for drawing eliminates gdi flicker. Relying on cpu prioritization for drawing is a good way to choke your cpu.


What? bro did you even read my op? lol?
He's saying read the data separately and store it in a class, so that when your logic for a triggerbot goes live you can reference that rather using a RPM. essentially using data already available in memory versus calling RPM and waiting for a result during your loop.
 
Last edited:

GAFO666

Hacker
Meme Tier VIP
Aug 19, 2012
520
3,188
23
ya better do all internal, set a pointer on what you want to read , done .. :_D
 

HexMurder

Arcane Hacker
Dank Tier VIP
Dank Tier Donator
Jun 7, 2012
319
7,988
22
Using more than a single buffer for drawing eliminates gdi flicker. Relying on cpu prioritization for drawing is a good way to choke your cpu.
This isn't gdi, It's directx. The flickering is directly caused from reading memory in another thread, as i said in my op. It isn't present otherwise.
 

Rake

Cesspool Admin
Administrator
Jan 21, 2014
12,074
78,998
2,371
In this old external assault cube source you can see I have readPlayerData() function that finds all the valid players and then creates a local player object with all the information I need using a playerClass constructor and adds it to a vector of these local player objects. This functionality occurs before I do any of the other hack stuff so the information is updates. That way I am only doing the overhead of RPM once per hack loop. I hope it is helpful to you. It is easy with the new Visual Studio when debugging to see how many milliseconds it takes your hack loop to execute or long each function takes to execute so you can use this to make your code more efficient, especially important for dem externals
 
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.

Similar threads

Community Mods