summaryrefslogtreecommitdiff
path: root/binaryview.cpp
diff options
context:
space:
mode:
authorGlenn Smith <glenn@vector35.com>2021-07-03 01:08:47 -0400
committerGlenn Smith <glenn@vector35.com>2021-07-09 16:39:09 -0400
commit3808f91664f9632eb9d754a1ff99447b50468b36 (patch)
tree44f0dbf857de5aeeb03fe27fb2c11aa136074682 /binaryview.cpp
parentd19f5e85ee26c3d6604798d30ab821d15731cada (diff)
Cleanup tags and comments in many places
Fixes #1926 #2374 #2325 #2204 #1652 and possibly others
Diffstat (limited to 'binaryview.cpp')
-rw-r--r--binaryview.cpp80
1 files changed, 78 insertions, 2 deletions
diff --git a/binaryview.cpp b/binaryview.cpp
index 139e319c..dd61f0e7 100644
--- a/binaryview.cpp
+++ b/binaryview.cpp
@@ -2569,6 +2569,22 @@ std::vector<TagReference> BinaryView::GetDataTagReferences()
}
+std::vector<TagReference> BinaryView::GetAutoDataTagReferences()
+{
+ size_t count;
+ BNTagReference* refs = BNGetAutoDataTagReferences(m_object, &count);
+ return TagReference::ConvertAndFreeTagReferenceList(refs, count);
+}
+
+
+std::vector<TagReference> BinaryView::GetUserDataTagReferences()
+{
+ size_t count;
+ BNTagReference* refs = BNGetUserDataTagReferences(m_object, &count);
+ return TagReference::ConvertAndFreeTagReferenceList(refs, count);
+}
+
+
std::vector<Ref<Tag>> BinaryView::GetDataTags(uint64_t addr)
{
size_t count;
@@ -2577,6 +2593,22 @@ std::vector<Ref<Tag>> BinaryView::GetDataTags(uint64_t addr)
}
+std::vector<Ref<Tag>> BinaryView::GetAutoDataTags(uint64_t addr)
+{
+ size_t count;
+ BNTag** tags = BNGetAutoDataTags(m_object, addr, &count);
+ return Tag::ConvertAndFreeTagList(tags, count);
+}
+
+
+std::vector<Ref<Tag>> BinaryView::GetUserDataTags(uint64_t addr)
+{
+ size_t count;
+ BNTag** tags = BNGetUserDataTags(m_object, addr, &count);
+ return Tag::ConvertAndFreeTagList(tags, count);
+}
+
+
std::vector<Ref<Tag>> BinaryView::GetDataTagsOfType(uint64_t addr, Ref<TagType> tagType)
{
size_t count;
@@ -2585,14 +2617,46 @@ std::vector<Ref<Tag>> BinaryView::GetDataTagsOfType(uint64_t addr, Ref<TagType>
}
-std::vector<Ref<Tag>> BinaryView::GetDataTagsInRange(uint64_t start, uint64_t end)
+std::vector<Ref<Tag>> BinaryView::GetAutoDataTagsOfType(uint64_t addr, Ref<TagType> tagType)
+{
+ size_t count;
+ BNTag** tags = BNGetAutoDataTagsOfType(m_object, addr, tagType->GetObject(), &count);
+ return Tag::ConvertAndFreeTagList(tags, count);
+}
+
+
+std::vector<Ref<Tag>> BinaryView::GetUserDataTagsOfType(uint64_t addr, Ref<TagType> tagType)
{
size_t count;
- BNTag** tags = BNGetDataTagsInRange(m_object, start, end, &count);
+ BNTag** tags = BNGetUserDataTagsOfType(m_object, addr, tagType->GetObject(), &count);
return Tag::ConvertAndFreeTagList(tags, count);
}
+std::vector<TagReference> BinaryView::GetDataTagsInRange(uint64_t start, uint64_t end)
+{
+ size_t count;
+ BNTagReference* refs = BNGetDataTagsInRange(m_object, start, end, &count);
+ return TagReference::ConvertAndFreeTagReferenceList(refs, count);
+}
+
+
+std::vector<TagReference> BinaryView::GetAutoDataTagsInRange(uint64_t start, uint64_t end)
+{
+ size_t count;
+ BNTagReference* refs = BNGetAutoDataTagsInRange(m_object, start, end, &count);
+ return TagReference::ConvertAndFreeTagReferenceList(refs, count);
+}
+
+
+std::vector<TagReference> BinaryView::GetUserDataTagsInRange(uint64_t start, uint64_t end)
+{
+ size_t count;
+ BNTagReference* refs = BNGetUserDataTagsInRange(m_object, start, end, &count);
+ return TagReference::ConvertAndFreeTagReferenceList(refs, count);
+}
+
+
void BinaryView::AddAutoDataTag(uint64_t addr, Ref<Tag> tag)
{
BNAddAutoDataTag(m_object, addr, tag->GetObject());
@@ -2605,6 +2669,12 @@ void BinaryView::RemoveAutoDataTag(uint64_t addr, Ref<Tag> tag)
}
+void BinaryView::RemoveAutoDataTagsOfType(uint64_t addr, Ref<TagType> tagType)
+{
+ BNRemoveAutoDataTagsOfType(m_object, addr, tagType->GetObject());
+}
+
+
void BinaryView::AddUserDataTag(uint64_t addr, Ref<Tag> tag)
{
BNAddUserDataTag(m_object, addr, tag->GetObject());
@@ -2617,6 +2687,12 @@ void BinaryView::RemoveUserDataTag(uint64_t addr, Ref<Tag> tag)
}
+void BinaryView::RemoveUserDataTagsOfType(uint64_t addr, Ref<TagType> tagType)
+{
+ BNRemoveUserDataTagsOfType(m_object, addr, tagType->GetObject());
+}
+
+
void BinaryView::RemoveTagReference(const TagReference& ref)
{
BNRemoveTagReference(m_object, (BNTagReference)ref);