From c6662cbce926c304eef3e4c80429fb66e38ca252 Mon Sep 17 00:00:00 2001 From: Peter LaFosse Date: Wed, 11 Jul 2018 20:46:46 -0400 Subject: Add APIs for getting the underlying symbol from a relocation --- binaryview.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'binaryview.cpp') 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 Relocation::GetSymbol() const +{ + BNSymbol* sym = BNRelocationGetSymbol(m_object); + if (!sym) + return nullptr; + return new Symbol(sym); +} + + BinaryData::BinaryData(FileMetadata* file): BinaryView(BNCreateBinaryDataView(file->GetObject())) { } -- cgit v1.3.1