| 1467 | |
| 1468 | |
| 1469 | DataBuffer DbgEngAdapter::ReadMemory(std::uintptr_t address, std::size_t size) |
| 1470 | { |
| 1471 | const auto source = std::make_unique<std::uint8_t[]>(size); |
| 1472 | |
| 1473 | unsigned long bytesRead {}; |
| 1474 | const auto success = |
| 1475 | this->m_debugDataSpaces->ReadVirtual(address, source.get(), size, &bytesRead) == S_OK && bytesRead == size; |
| 1476 | if (!success) |
| 1477 | return {}; |
| 1478 | |
| 1479 | return {source.get(), size}; |
| 1480 | } |
| 1481 | |
| 1482 | bool DbgEngAdapter::WriteMemory(std::uintptr_t address, const DataBuffer& buffer) |
| 1483 | { |