summaryrefslogtreecommitdiff
path: root/databuffer.cpp
diff options
context:
space:
mode:
authorRusty Wagner <rusty@vector35.com>2015-05-13 02:09:39 -0400
committerRusty Wagner <rusty@vector35.com>2015-05-13 02:15:20 -0400
commitcd1ac400a80898b1f6394ce518b0ba92f69fa3e1 (patch)
tree62b9f2a9f2d06eff4e51855e2516862035c2845a /databuffer.cpp
parent4baa6fc4add2b1d9ff32d8eba67621dfdb1cbfd4 (diff)
Base64 transform
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());