From 4b2b3d561b92a01f4d29b86d5510d39e4d1accf3 Mon Sep 17 00:00:00 2001 From: Brandon Miller Date: Thu, 21 Mar 2024 10:52:21 -0400 Subject: Base address detection widget in Triage view Initial implementation of base address detection UI widget in triage summary --- binaryninjaapi.h | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) (limited to 'binaryninjaapi.h') diff --git a/binaryninjaapi.h b/binaryninjaapi.h index 6bd63a4b..6bd33c80 100644 --- a/binaryninjaapi.h +++ b/binaryninjaapi.h @@ -17378,6 +17378,61 @@ namespace BinaryNinja { const std::function& add); void Process(); }; + + struct BaseAddressDetectionSettings + { + std::string Architecture; + std::string Analysis; + uint32_t MinStrlen; + uint32_t Alignment; + uint64_t LowerBoundary; + uint64_t UpperBoundary; + BNBaseAddressDetectionPOISetting POIAnalysis; + uint32_t MaxPointersPerCluster; + }; + + enum BaseAddressDetectionConfidence + { + NoConfidence = 0, + LowConfidence = 1, + HighConfidence = 2, + }; + + /*! + \ingroup baseaddressdetection + */ + class BaseAddressDetection + { + BNBaseAddressDetection* m_object; + + public: + BaseAddressDetection(Ref view); + ~BaseAddressDetection(); + + /*! Analyze program, identify pointers and points-of-interest, and detect candidate base addresses + + \param settings Base address detection settings + \return true on success, false otherwise + */ + bool DetectBaseAddress(BaseAddressDetectionSettings& settings); + + /*! Get the top 10 candidate base addresses and thier scores + + \param confidence Confidence level that the top base address candidate is correct + \return Set of pairs containing candidate base addresses and their scores + */ + std::set> GetScores(BaseAddressDetectionConfidence* confidence); + + /*! Abort base address detection + */ + void Abort(); + + /*! Determine if base address detection is aborted + + \return true if aborted by user, false otherwise + */ + bool IsAborted(); + }; } // namespace BinaryNinja -- cgit v1.3.1