summaryrefslogtreecommitdiff
path: root/view/sharedcache/core/VM.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'view/sharedcache/core/VM.cpp')
-rw-r--r--view/sharedcache/core/VM.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/view/sharedcache/core/VM.cpp b/view/sharedcache/core/VM.cpp
index 72d6d202..358a1dd8 100644
--- a/view/sharedcache/core/VM.cpp
+++ b/view/sharedcache/core/VM.cpp
@@ -465,6 +465,17 @@ BinaryNinja::DataBuffer MMappedFileAccessor::ReadBuffer(size_t address, size_t l
return BinaryNinja::DataBuffer(data, length);
}
+std::pair<const uint8_t*, const uint8_t*> MMappedFileAccessor::ReadSpan(size_t address, size_t length)
+{
+ if (address > m_mmap.len)
+ throw MappingReadException();
+ if (address + length > m_mmap.len)
+ throw MappingReadException();
+ const uint8_t* data = (&(((uint8_t*)m_mmap._mmap)[address]));
+ return {data, data + length};
+}
+
+
void MMappedFileAccessor::Read(void* dest, size_t address, size_t length)
{
if (address > m_mmap.len)