MCPcopy Create free account
hub / github.com/AlSch092/UltimateAntiCheat / QueryMemory

Method QueryMemory

Network/NetClient.cpp:365–385  ·  view source on GitHub ↗

QueryMemory - Server requested client to read bytes @ some memory address returns Error::OK on success */

Source from the content-addressed store, hash-verified

363 returns Error::OK on success
364*/
365Error NetClient::QueryMemory(__in const uint64_t address, __in const uint32_t size)
366{
367 if (size == 0 || address == 0)
368 {
369 Logger::logf(Err, "Failed to fetch bytes at memory address (size or address was 0) @ NetClient::QueryMemory");
370 return Error::INCOMPLETE_SEND;
371 }
372
373 BYTE* bytes = Process::GetBytesAtAddress(address, size);
374
375 if (bytes == nullptr)
376 {
377 Logger::logf(Err, "Failed to fetch bytes at memory address @ NetClient::QueryMemory");
378 return Error::NULL_MEMORY_REFERENCE;
379 }
380
381 PacketWriter* outBytes = Packets::Builder::QueryMemory(bytes, size); //now write `bytes` to a packet and send, completing the transaction
382 delete[] bytes;
383 bytes = nullptr;
384 return SendData(outBytes);
385}
386
387/*
388 MakeHeartbeat - Generates a response to server heartbeat requests

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected