summaryrefslogtreecommitdiff
path: root/binaryview.cpp
diff options
context:
space:
mode:
authorPeter LaFosse <peter@vector35.com>2023-07-17 13:43:16 -0400
committerPeter LaFosse <peter@vector35.com>2023-07-17 14:42:18 -0400
commitf9a68f76f871449924b4fe32e6ade3d02a98249c (patch)
tree5a6140a80390d0618d77cb759d72896ae97dddb1 /binaryview.cpp
parent1a9be2ee9d1ac8d3506f9d2adbe0f25cf6d2f84d (diff)
Add CheckForStringAnnotationType API
Diffstat (limited to 'binaryview.cpp')
-rw-r--r--binaryview.cpp22
1 files changed, 16 insertions, 6 deletions
diff --git a/binaryview.cpp b/binaryview.cpp
index 343dc322..2be28283 100644
--- a/binaryview.cpp
+++ b/binaryview.cpp
@@ -3185,6 +3185,22 @@ std::vector<Ref<Component>> BinaryView::GetDataVariableParentComponents(DataVari
}
+std::optional<BNStringType> BinaryView::CheckForStringAnnotationType(uint64_t addr, string& value, bool allowShortStrings, bool allowLargeStrings, size_t childWidth)
+{
+ char* str = nullptr;
+ BNStringType type;
+ bool result = BNCheckForStringAnnotationType(m_object, addr, &str, &type,
+ allowShortStrings, allowLargeStrings, childWidth);
+ if (result)
+ {
+ value = string(str);
+ BNFreeString(str);
+ return type;
+ }
+ return std::nullopt;
+}
+
+
bool BinaryView::CanAssemble(Architecture* arch)
{
return BNCanAssemble(m_object, arch->GetObject());
@@ -3303,12 +3319,6 @@ Ref<BackgroundTask> BinaryView::GetBackgroundAnalysisTask()
}
-size_t BinaryView::GetFullStringSize(uint64_t addr, BNStringType type)
-{
- return BNGetFullStringSize(m_object, addr, type);
-}
-
-
uint64_t BinaryView::GetNextFunctionStartAfterAddress(uint64_t addr)
{
return BNGetNextFunctionStartAfterAddress(m_object, addr);