From 465a8d5d7afd5a5648338009e0fb8dbe4f199347 Mon Sep 17 00:00:00 2001 From: Brandon Miller Date: Thu, 11 Apr 2024 10:40:09 -0400 Subject: Querying candidate base address reasons Querying vector of reason information for a candidate base address using the new core API --- binaryninjacore.h | 39 ++++++++++++++++----------------------- 1 file changed, 16 insertions(+), 23 deletions(-) (limited to 'binaryninjacore.h') diff --git a/binaryninjacore.h b/binaryninjacore.h index 25d7618e..ffe17dba 100644 --- a/binaryninjacore.h +++ b/binaryninjacore.h @@ -3160,25 +3160,25 @@ extern "C" typedef enum BNBaseAddressDetectionPOISetting { - POI_ANALYSIS_STRINGS_ONLY, - POI_ANALYSIS_FUNCTIONS_ONLY, - POI_ANALYSIS_ALL, + POIAnalysisStringsOnly, + POIAnalysisFunctionsOnly, + POIAnalysisAll, } BNBaseAddressDetectionPOISetting; typedef enum BNBaseAddressDetectionPOIType { - POI_STRING, - POI_FUNCTION, - POI_DATA_VARIABLE, - POI_FILE_START, - POI_FILE_END, + POIString, + POIFunction, + POIDataVariable, + POIFileStart, + POIFileEnd, } BNBaseAddressDetectionPOIType; typedef enum BNBaseAddressDetectionConfidence { - CONFIDENCE_UNASSIGNED, - CONFIDENCE_LOW, - CONFIDENCE_HIGH, + NoConfidence, + LowConfidence, + HighConfidence, } BNBaseAddressDetectionConfidence; typedef struct BNBaseAddressDetectionSettings @@ -3197,7 +3197,7 @@ extern "C" { uint64_t Pointer; uint64_t POIOffset; - BNBaseAddressDetectionPOIType BaseAddressDetectionPOIType; + BNBaseAddressDetectionPOIType POIType; } BNBaseAddressDetectionReason; typedef struct BNBaseAddressDetectionScore @@ -3206,15 +3206,6 @@ extern "C" uint64_t BaseAddress; } BNBaseAddressDetectionScore; - typedef struct BNBaseAddressDetectionResults - { - BNBaseAddressDetectionConfidence Confidence; - BNBaseAddressDetectionScore** Scores; - BNBaseAddressDetectionReason** Reasons; - char* ErrorStr; - uint64_t LastTestedBaseAddress; - } BNBaseAddressDetectionResults; - BINARYNINJACOREAPI char* BNAllocString(const char* contents); BINARYNINJACOREAPI void BNFreeString(char* str); BINARYNINJACOREAPI char** BNAllocStringList(const char** contents, size_t size); @@ -7049,8 +7040,10 @@ extern "C" // Base Address Detection BINARYNINJACOREAPI BNBaseAddressDetection* BNCreateBaseAddressDetection(BNBinaryView *view); BINARYNINJACOREAPI bool BNDetectBaseAddress(BNBaseAddressDetection* bad, BNBaseAddressDetectionSettings& settings); - BINARYNINJACOREAPI size_t BNGetBaseAddressDetectionScores(BNBaseAddressDetection* bad, - BNBaseAddressDetectionScore* scores, size_t count, BNBaseAddressDetectionConfidence* confidence); + BINARYNINJACOREAPI size_t BNGetBaseAddressDetectionScores(BNBaseAddressDetection* bad, BNBaseAddressDetectionScore* scores, size_t count, + BNBaseAddressDetectionConfidence* confidence, uint64_t* lastTestedBaseAddress); + BINARYNINJACOREAPI BNBaseAddressDetectionReason* BNGetBaseAddressDetectionReasons(BNBaseAddressDetection* bad, + uint64_t baseAddress, size_t* count); BINARYNINJACOREAPI void BNAbortBaseAddressDetection(BNBaseAddressDetection* bad); BINARYNINJACOREAPI bool BNIsBaseAddressDetectionAborted(BNBaseAddressDetection* bad); BINARYNINJACOREAPI void BNFreeBaseAddressDetection(BNBaseAddressDetection* bad); -- cgit v1.3.1