summaryrefslogtreecommitdiff
path: root/binaryview.cpp
diff options
context:
space:
mode:
authorPeter LaFosse <peter@vector35.com>2018-07-11 20:46:46 -0400
committerPeter LaFosse <peter@vector35.com>2018-07-11 20:46:46 -0400
commitc6662cbce926c304eef3e4c80429fb66e38ca252 (patch)
tree5abd9f9c20aebe125fd432a90db13b6afa5383c1 /binaryview.cpp
parentb35c7de12f675237655565e26a25c290e04e7dab (diff)
Add APIs for getting the underlying symbol from a relocation
Diffstat (limited to 'binaryview.cpp')
-rw-r--r--binaryview.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/binaryview.cpp b/binaryview.cpp
index 7aa2118f..6e5c3b14 100644
--- a/binaryview.cpp
+++ b/binaryview.cpp
@@ -2230,6 +2230,15 @@ uint64_t Relocation::GetReloc() const
}
+Ref<Symbol> Relocation::GetSymbol() const
+{
+ BNSymbol* sym = BNRelocationGetSymbol(m_object);
+ if (!sym)
+ return nullptr;
+ return new Symbol(sym);
+}
+
+
BinaryData::BinaryData(FileMetadata* file): BinaryView(BNCreateBinaryDataView(file->GetObject()))
{
}