summaryrefslogtreecommitdiff
path: root/binaryview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'binaryview.cpp')
-rw-r--r--binaryview.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/binaryview.cpp b/binaryview.cpp
index 6631f3d6..1c03eca5 100644
--- a/binaryview.cpp
+++ b/binaryview.cpp
@@ -258,6 +258,7 @@ BinaryView::BinaryView(const std::string& typeName, FileMetadata* file)
view.isOffsetReadable = IsOffsetReadableCallback;
view.isOffsetWritable = IsOffsetWritableCallback;
view.isOffsetExecutable = IsOffsetExecutableCallback;
+ view.isOffsetBackedByFile = IsOffsetBackedByFileCallback;
view.getNextValidOffset = GetNextValidOffsetCallback;
view.getStart = GetStartCallback;
view.getLength = GetLengthCallback;
@@ -357,6 +358,13 @@ bool BinaryView::IsOffsetExecutableCallback(void* ctxt, uint64_t offset)
}
+bool BinaryView::IsOffsetBackedByFileCallback(void* ctxt, uint64_t offset)
+{
+ BinaryView* view = (BinaryView*)ctxt;
+ return view->PerformIsOffsetBackedByFile(offset);
+}
+
+
uint64_t BinaryView::GetNextValidOffsetCallback(void* ctxt, uint64_t offset)
{
BinaryView* view = (BinaryView*)ctxt;
@@ -439,6 +447,12 @@ bool BinaryView::PerformIsOffsetExecutable(uint64_t offset)
}
+bool BinaryView::PerformIsOffsetBackedByFile(uint64_t offset)
+{
+ return PerformIsValidOffset(offset);
+}
+
+
uint64_t BinaryView::PerformGetNextValidOffset(uint64_t offset)
{
if (offset < PerformGetStart())
@@ -696,6 +710,12 @@ bool BinaryView::IsOffsetExecutable(uint64_t offset) const
}
+bool BinaryView::IsOffsetBackedByFile(uint64_t offset) const
+{
+ return BNIsOffsetBackedByFile(m_object, offset);
+}
+
+
uint64_t BinaryView::GetNextValidOffset(uint64_t offset) const
{
return BNGetNextValidOffset(m_object, offset);