From f9a68f76f871449924b4fe32e6ade3d02a98249c Mon Sep 17 00:00:00 2001 From: Peter LaFosse Date: Mon, 17 Jul 2023 13:43:16 -0400 Subject: Add CheckForStringAnnotationType API --- binaryninjaapi.h | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'binaryninjaapi.h') diff --git a/binaryninjaapi.h b/binaryninjaapi.h index 2170e82f..4ea0ff50 100644 --- a/binaryninjaapi.h +++ b/binaryninjaapi.h @@ -4882,6 +4882,24 @@ namespace BinaryNinja { std::vector> GetFunctionParentComponents(Ref function) const; std::vector> GetDataVariableParentComponents(DataVariable var) const; + /*! Heuristically determine if a string exists at the given address. This API checks for the following settings: + "analysis.unicode.utf8" - default true enables UTF-8 string detection + "analysis.unicode.utf16" - default true enables UTF-16 string detection + "analysis.unicode.utf32" - default true enables UTF-32 string detection + "analysis.unicode.blocks" - selects the Unicode blocks to use for detection + + \param addr Address to check + \param value String value to populate + \param allowShortStrings Whether to allow short strings < 4 characters + \param allowLargeStrings If false strings must be less than "rendering.strings.maxAnnotationLength" (default 32) + If true strings must be less than "analysis.limits.maxStringLength" (default 16384) + \param childWidth Width of the characters + \return The type of string annotation found + + */ + std::optional CheckForStringAnnotationType(uint64_t addr, std::string& value, + bool allowShortStrings, bool allowLargeStrings, size_t childWidth); + /*! Check whether the given architecture supports assembling instructions \param arch Architecture to check @@ -5006,7 +5024,6 @@ namespace BinaryNinja { AnalysisInfo GetAnalysisInfo(); BNAnalysisProgress GetAnalysisProgress(); Ref GetBackgroundAnalysisTask(); - size_t GetFullStringSize(uint64_t addr, BNStringType type); /*! Returns the virtual address of the Function that occurs after the virtual address `addr` -- cgit v1.3.1