summaryrefslogtreecommitdiff
path: root/binaryview.cpp
diff options
context:
space:
mode:
authorXusheng <xusheng@vector35.com>2024-07-26 15:57:14 +0800
committerXusheng <xusheng@vector35.com>2024-08-02 12:17:53 +0800
commitabbae639d8ba182e8b3cf2d5a9844a9b1f9844a1 (patch)
tree272322e3269b09201c12489d93e7fbeb614fb140 /binaryview.cpp
parent7a9a2503aae0c2b92b437b2ea7796efaae93a822 (diff)
Support setting user global pointer value
Diffstat (limited to 'binaryview.cpp')
-rw-r--r--binaryview.cpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/binaryview.cpp b/binaryview.cpp
index 861c7eb2..01ab7b95 100644
--- a/binaryview.cpp
+++ b/binaryview.cpp
@@ -5297,6 +5297,38 @@ std::vector<Ref<ExternalLocation>> BinaryView::GetExternalLocations()
}
+Confidence<RegisterValue> BinaryView::GetGlobalPointerValue() const
+{
+ BNRegisterValueWithConfidence value = BNGetGlobalPointerValue(m_object);
+ return Confidence<RegisterValue>(RegisterValue::FromAPIObject(value.value), value.confidence);
+}
+
+
+bool BinaryView::UserGlobalPointerValueSet() const
+{
+ return BNUserGlobalPointerValueSet(m_object);
+}
+
+
+void BinaryView::ClearUserGlobalPointerValue()
+{
+ return BNClearUserGlobalPointerValue(m_object);
+}
+
+
+void BinaryView::SetUserGlobalPointerValue(const Confidence<RegisterValue>& value)
+{
+ BNRegisterValueWithConfidence v;
+ v.confidence = value.GetConfidence();
+ v.value.value = value.GetValue().value;
+ v.value.state = value.GetValue().state;
+ v.value.size = value.GetValue().size;
+ v.value.offset = value.GetValue().offset;
+ BNSetUserGlobalPointerValue(m_object, v);
+}
+
+
+
Relocation::Relocation(BNRelocation* reloc)
{
m_object = reloc;