external-warzone-cheat
external-warzone-cheat copied to clipboard
Reading Strings
Well i use a super old method driver, and now im follow you project.
Work correct, but i go into the point i need to read a text, normal i implement this:
` template<typename T> bool read_array(ULONG64 address, T* array, size_t len) { COPY_MEMORY m{}; m.read = true; m.pid = sdk::process_id; m.address = address; m.buffer = &array; m.size = len;
call_hook(&m);
}
inline bool readS(uint64_t address, void* buffer, size_t size) {
read_array(address, &buffer, sizeof(size_t) * size);
}
std::string readwtf(uintptr_t Address, void* Buffer, SIZE_T Size)
{
read_array(Address, Buffer, Size);
char name[255] = { 0 };
memcpy(&name, Buffer, Size);
return std::string(name);
}
`
Did you see any wrong is for UE4 Game on this case, this is how i calle it: ` std::string GNameFromPawn(uint32_t key) { auto chunkOffset = (UINT)((int)(key) >> 16); auto nameOffset = (USHORT)key;
auto namePoolChunk = driver::read<UINT64>(module_base + offset_GNames + ((chunkOffset + 2) * 8));
auto entryOffset = namePoolChunk + (ULONG)(2 * nameOffset);
auto nameEntry = driver::read<INT16>(entryOffset);
auto nameLength = nameEntry >> 6;
char buff[1028];
if ((DWORD)nameLength && nameLength > 0)
{
driver::readS(entryOffset + 2, buff, nameLength);
buff[nameLength] = '\0';
return std::string(buff);
}
else return "";
}
`
If i no wrong this should work with the memcpy, aside that is same function read (from you project) just expanded to get buffer, and size, is possible what i trying to doe or i just skip?