Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ReadProcessMemory Function:
- template <typename T>
- static T ReadMem(uintptr_t address)
- {
- static T value;
- ReadProcessMemory(hProcess, LPCVOID(address), &value, sizeof(T), NULL);
- return value;
- }
- To get my world:
- uintptr_t GetWorld() {
- return ReadMem<uintptr_t>(ModuleBaseAddress + off_world);
- }
- To get my entity Table:
- uintptr_t NearEntityTable() {
- return ReadMem<uintptr_t>(GetWorld() + off_world_neartable);
- }
- to get my entity from entitytable:
- uintptr_t GetEntity(uintptr_t PlayerList, uintptr_t SelectedPlayer) {
- return ReadMem<uintptr_t>(ReadMem<uintptr_t>(ReadMem<uintptr_t>(PlayerList + SelectedPlayer * off_entitysize) + off_entity_link) + off_entity_object);
- }
- to get the position:
- Vector3 GetPosition(uint64_t Entity, bool islocal = false)
- {
- return Vector3(ReadMem<Vector3>(ReadMem<uintptr_t>(Entity + off_entity_futurevisualstate) + 0x2C));
- }
- So i do this in my main():
- uintptr_t world = GetWorld();
- uintptr_t EntList = NearEntityTable();
- uintptr_t Entity = GetEntity(EntList, 1);
- Vector3 Position = GetPosition(Entity);
- std::cout << "X: " << Position.x << std::endl;
- std::cout << "Y: " << Position.y << std::endl;
- std::cout << "Z: " << Position.z << std::endl;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement