summaryrefslogtreecommitdiff
path: root/plugins/rtti/rtti.h
diff options
context:
space:
mode:
authorMason Reed <mason@vector35.com>2026-01-12 10:58:59 -0800
committerMason Reed <35282038+emesare@users.noreply.github.com>2026-01-13 19:37:46 -0800
commite299a6c1bf74f0ca6d2c3d79135e8c23e6b9fbba (patch)
tree132683a047f4a97c0dc18a1f01df8f46b79105b1 /plugins/rtti/rtti.h
parent0893694568345908163262785097878460604855 (diff)
[RTTI] Improve virtual function discovery
- Allow extern functions to show up in a MSVC vtable - Fix https://github.com/Vector35/binaryninja-api/issues/7871 - Share code between itanium and msvc vft analysis, it is the same logic basically
Diffstat (limited to 'plugins/rtti/rtti.h')
-rw-r--r--plugins/rtti/rtti.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/plugins/rtti/rtti.h b/plugins/rtti/rtti.h
index b46a33a1..00b105eb 100644
--- a/plugins/rtti/rtti.h
+++ b/plugins/rtti/rtti.h
@@ -6,6 +6,8 @@ constexpr const char *VIEW_METADATA_RTTI = "rtti";
constexpr int RTTI_CONFIDENCE = 100;
namespace BinaryNinja::RTTI {
+ Ref<Symbol> GetRealSymbol(BinaryView *view, uint64_t relocAddr, uint64_t symAddr);
+
std::optional<std::string> DemangleNameMS(BinaryView* view, bool allowMangled, const std::string &mangledName);
std::optional<std::string> DemangleNameGNU3(BinaryView* view, bool allowMangled, const std::string &mangledName);
@@ -69,6 +71,14 @@ namespace BinaryNinja::RTTI {
class RTTIProcessor
{
protected:
+ enum class FunctionDiscoverState
+ {
+ Failed = 0,
+ AlreadyExists = 1,
+ Discovered = 2,
+ Extern = 3
+ };
+
Ref<BinaryView> m_view;
Ref<Logger> m_logger;
@@ -78,6 +88,10 @@ namespace BinaryNinja::RTTI {
virtual std::optional<ClassInfo> ProcessRTTI(uint64_t objectAddr) = 0;
virtual std::optional<VirtualFunctionTableInfo> ProcessVFT(uint64_t vftAddr, ClassInfo &classInfo, std::optional<BaseClassInfo> baseClassInfo) = 0;
+
+ [[nodiscard]] bool IsLikelyFunction(uint64_t addr) const;
+
+ [[nodiscard]] FunctionDiscoverState DiscoverVirtualFunction(uint64_t vftEntryAddr, uint64_t& vFuncAddr);
public:
virtual ~RTTIProcessor() = default;