| 20 | } |
| 21 | |
| 22 | std::optional<VirtualMemoryRegion> VirtualMemory::GetRegionAtAddress(uint64_t address, uint64_t& addressOffset) |
| 23 | { |
| 24 | if (const auto& it = m_regions.find(address); it != m_regions.end()) |
| 25 | { |
| 26 | // The VirtualMemoryRegion object returned contains the page, and more importantly, the file pointer (there can |
| 27 | // be multiple in newer caches) This is relevant for reading out the data in the rest of this file. The second |
| 28 | // item in the returned pair is the offset of `address` within the file. |
| 29 | const auto& range = it->first; |
| 30 | auto mapping = it->second; |
| 31 | addressOffset = mapping.fileOffset + (address - range.start); |
| 32 | return mapping; |
| 33 | } |
| 34 | |
| 35 | return std::nullopt; |
| 36 | } |
| 37 | |
| 38 | std::optional<VirtualMemoryRegion> VirtualMemory::GetRegionAtAddress(uint64_t address) |
| 39 | { |
no test coverage detected