Solved building the playerarray without its address

Hexui Undetected CSGO Cheats Sinkicheat PUBG Cheat

Loset

Newbie
Trump Tier Donator
Full Member
Jan 13, 2016
47
663
1
well I am not sure if Im correct I just wanted to see what you guys think..

lets say I have this program in C

C++:
static void **playerArray = malloc(sizeof(void*)*32);
static int index = 0;

void addPlayerPtr(void * player)
{
if(index<32) playerArray[index++]=player
}

so this function gets a pointer and adds it to array of pointers..
then you find a function that loops thru the playerarray and mid hook it..

then you just need to use the right callingconvention to put the playerptr in the right place
and Call the function addPlayerPtr?
 
Last edited:

Rake

Cesspool Admin
Administrator
Jan 21, 2014
12,140
78,998
2,394
I am trying to have a copy of the player array in case I cant find a pointer to it..
what I am saying instead of spending time finding it.. I will mid function hook something like health or change position that loops thru all the players
and then I would have a function that gets a pointer and adds it to my new made array
Rather than recreate the function and the array, you can just hook the function and pull the address of the player array out of a register.

The example function will look like this:
C++:
PlayerClass players[16];

void DecreaseHealth()
{

for (i = 0; i < 16; i++)
{
players[i].health -= 1;
}

}
At some point the address of "players" gets placed in a register and it adds the "EntityLoopDistance" multiplied by "i" to it to access each player object.

So find when the address of players gets placed in a register, hook that spot and in 1 line of assembly as GAFO posted to grab it.

You may discover that just finding a pointer will be easier :)
 

GAFO666

Hacker
Meme Tier VIP
Aug 19, 2012
520
3,188
23
depending on how the function "addPlayerPtr" looks like in asm you could do something like

C++:
...
...
DWORD*  playerarrayptr == nullptr;
...
...
...
__asm mov playerarrayptr, PointerInAsm
...
...
means just copy the basepointer
 

Rake

Cesspool Admin
Administrator
Jan 21, 2014
12,140
78,998
2,394
Calling addPlayerPtr would add a player pointer to the games player array. Are you trying access the player array from your hack or are you trying to add a player to the game's player array?
 

Loset

Newbie
Trump Tier Donator
Full Member
Jan 13, 2016
47
663
1
Rake;41150 said:
Calling addPlayerPtr would add a player pointer to the games player array. Are you trying access the player array from your hack or are you trying to add a player to the game's player array?
I am trying to have a copy of the player array in case I cant find a pointer to it..

what I am saying instead of spending time finding it.. I will mid function hook something like health or change position that loops thru all the players

I will create static field in my program
static void **playerArray = malloc(sizeof(void*)*32);

and then I would have a function that gets a pointer and adds it to my new made array

then I would mid hook the function and tell it to send the current player pointer to that function and so I will add players untill out of space in my created array or untill I have nothing unique to add.

in theory it would work right? this combination of c++ and asm?
 

Loset

Newbie
Trump Tier Donator
Full Member
Jan 13, 2016
47
663
1
depending on how the function "addPlayerPtr" looks like in asm you could do something like

C++:
...
...
DWORD*  playerarrayptr == nullptr;
...
...
...
__asm mov playerarrayptr, PointerInAsm
...
...
means just copy the basepointer
thats exactly it.. I dont want to code addPlayerPtr in assembly .. just the mid hook in assembly

I want to match my function with the function I am hooking so the parameter of the pointer will be in the same register as the function I am hooking
so I could just do Call addPlayerPtr and it would work
 
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