|
Cheat Engine The Official Site of Cheat Engine
|
View previous topic :: View next topic |
Author |
Message |
++METHOS I post too much Reputation: 92
Joined: 29 Oct 2010 Posts: 4197
|
Posted: Tue Apr 05, 2016 11:29 am Post subject: |
|
|
Zanzer wrote: | Find the health of two enemies. Use the automatic pointer scanner on each. |
Greys0n wrote: | Find the health of two enemies. Use the automatic pointer scanner on each. | -More plagiarism. ZZzzz.
|
|
Back to top |
|
|
Gaz Cheater Reputation: 0
Joined: 08 Aug 2012 Posts: 40
|
Posted: Thu Apr 07, 2016 7:15 am Post subject: |
|
|
By the way that video tells you nothing about using it in c++ , we need an actual address that we can loop through enemies with , like Address + 0 + 50+ 80 = ammo and thats the player1 (You) we know the loop distance is lets say 80 then Address + 80(See what i did here) + 50+ 80 = ammo for player to , then for next enemy it would be Address + 160 + 50+ 80 = ammo for player 3. We dont want to do a simple cmp check in cheat engine script that just finds what is different from you and the enemy we need the actually address so in c++ we can use it like Address + 0 + i( i = Player number) * 80 (Distance to next Player) + 50+ 80 anyway yeah
A video of someone actually doing it without even speaking , or notepad would even suffice ,just to see how they go about it in a modern AA game or any game besides assault cube or some silly small time game
|
|
Back to top |
|
|
JohnathanSweeney Newbie cheater Reputation: 1
Joined: 04 Apr 2016 Posts: 20
|
Posted: Thu Apr 07, 2016 11:33 am Post subject: |
|
|
You seem to have a decent knowledge of how this works so forgive me for beating a dead horse but perhaps you will find what you're seeking:
Finding the Entity List:
The entity list generally is an array of player objects or an array of pointers to play objects that are dynamically allocated perhaps using the "new" operator or otherwise
Find a solid pointer for your health and another player's health that follows the same convention, the last offset should be the same concluding that it is the same variable offset from the same class.
The game code when compiled accesses the player objects by address and uses relative offsets to acccess the member variables.
Set the last offset to 0x0 and this will yield the player's "base address".
If it as an array of pointers you can generally do a hex search for that "base address" and that will give you a list of pointers that point to that base address, view these pointers in struct dissector, view the memory around the pointers and see if you find a pointer to the other players "base address" If you find them in close proximity of each other this will most likely be your array and you will need to do some testing to find the beginning of the array and the size of the entities. Generally if you are in a botmatch and you have 1 enemy and 1 localplayer(you) you subtract the address of one from the other and yield your entity size. Also with only 2 players either you or the enemy's pointer will be element [0] of the array, which if is not static, you will need to find a pointer to it.
If it is an array of player objects, the process is similar, subtract your base address from the base address of the enemy's health. If you're element[0] and the other player is element[1] then this will yield you the size of the player class and the address of the array, you can read more at guidedhacking.com If perhaps your player objects are not located contiguously in memorym then this will yield a size divisible by the sizeof the player object.
You want to use pointers that reflect the original code and access variable using the same logic that the compiled game code uses.
Accessing pointers in C++
Code: |
DWORD CalculateMultiLevelPointer(HANDLE hProcHandle, int NumberOfOffsets, DWORD Offsets[], DWORD FirstAddressOfPointer)
{
DWORD Pointer = FirstAddressOfPointer;
DWORD TempBuffer;
DWORD EndAddressOfPointer;
for (int i = 0; i < NumberOfOffsets; i++)
{
if (i == 0)
{
ReadProcessMemory(hProcHandle, (LPCVOID)Pointer, &TempBuffer, 4, NULL);
}
EndAddressOfPointer = TempBuffer + Offsets[i];
ReadProcessMemory(hProcHandle, (LPCVOID)EndAddressOfPointer, &TempBuffer, 4, NULL);
}
return EndAddressOfPointer;
}
|
Example:
Code: |
//0x509B74 = First address of pointer
DWORD dynamicAddressOfValue;
DWORD pointerOffsets[2] = { 0x374, 0x4 };
dynamicAddressOfValue = CalculatePointer(hProcHandle, 2, pointerOffsets, 0x509B74
|
Example of accessing an array of pointers, and creating local copies of the entities:
PlayerClass:
Code: |
//playerClass to create local copies of data in memory
class playerClass
{
public:
DWORD PlayerAddress;
char Name[16];
BYTE Team;
int Health;
BYTE State;
vec3 vLocation;
//constructor that reads class member variables
playerClass(DWORD PlayerAddress)
{
PlayerAddress = playerAddr;
ReadProcessMemory(hProcHandle, (LPCVOID)(PlayerAddress + 0x225), &Name, sizeof(Name), NULL);
ReadProcessMemory(hProcHandle, (LPCVOID)(PlayerAddress + 0x32c), &Team, sizeof(Team), NULL);
ReadProcessMemory(hProcHandle, (LPCVOID)(PlayerAddress + 0xF8), &Health, sizeof(Health), NULL);
ReadProcessMemory(hProcHandle, (LPCVOID)(PlayerAddress + 0x34), &vLocation, sizeof(vLocation), NULL);
ReadProcessMemory(hProcHandle, (LPCVOID)(PlayerAddress + 0x338), &State, sizeof(State), NULL);
}
};
|
Some variables:
Code: |
DWORD localPlayerPointer = 0x509B74;
DWORD localPlayerAddr = 0;
DWORD playerArrayPointer = 0x50F4F8;
DWORD playerArrayAddress = 0;
//local copy of array of player pointers
DWORD playerPointers[31];
//I like vectors :)
std::vector<playerClass> playerVector;
|
A function to read information out of the player array:
Code: |
//populate our local variables with data from memory
void readPlayerData()
{
ReadProcessMemory(hProcHandle, (LPCVOID)localPlayerPointer, &localPlayerAddr, 4, NULL);
ReadProcessMemory(hProcHandle, (LPCVOID)playerArrayPointer, &playerArrayAddress, 4, NULL);
playerClass localPlayer = playerClass(localPlayerAddr);
playerVector.clear();
ReadProcessMemory(hProcHandle, (LPCVOID)playerArrayAddress, &playerPointers, sizeof(playerPointers), NULL);
//for all player pointers in the array
for (DWORD player : playerPointers)
{
DWORD tmp;
//grab dynamic address of player
//Do this in a IF statement, checking the return of RPM for success
if (ReadProcessMemory(hProcHandle, (LPCVOID)player, &tmp, 4, NULL) == TRUE)
{
//add your own error checking here specific to the game
if (tmp != NULL)
{
//Call a PlayerClass constructor on the dyamic address of the player
playerVector.push_back(playerClass(player));
}
}
}
} |
There are a million ways to do anything, this is just one example I have used in the past, hope that helps you
|
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
|
|