summaryrefslogtreecommitdiff
path: root/databuffer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'databuffer.cpp')
-rw-r--r--databuffer.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/databuffer.cpp b/databuffer.cpp
index 6a0748b4..7814b14e 100644
--- a/databuffer.cpp
+++ b/databuffer.cpp
@@ -136,6 +136,21 @@ DataBuffer DataBuffer::FromEscapedString(const string& src)
}
+string DataBuffer::ToBase64() const
+{
+ char* str = BNDataBufferToBase64(m_buffer);
+ string result = str;
+ BNFreeString(str);
+ return result;
+}
+
+
+DataBuffer DataBuffer::FromBase64(const string& src)
+{
+ return DataBuffer(BNDecodeBase64(src.c_str()));
+}
+
+
string BinaryNinja::EscapeString(const string& s)
{
DataBuffer buffer(s.c_str(), s.size());