QueryMemory - Server requested client to read bytes @ some memory address returns Error::OK on success */
| 363 | returns Error::OK on success |
| 364 | */ |
| 365 | Error 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 |
nothing calls this directly
no outgoing calls
no test coverage detected