Jun 20, 2015 07:35 PM
(This post was last modified: Jun 21, 2015 03:44 PM by Vysse.)
These quick snippets allow you to turn any object into a byte array and then back into said object. Perfect for RATs.
Here is a quick example of how to use it.
Code
Public Shared Function Serialize(ByVal obj As Object) As Byte()
Using ms As New MemoryStream
Dim bf As New BinaryFormatter
bf.Serialize(ms, obj)
Return ms.ToArray
End Using
End Function
Public Shared Function DeSerialize(Of T)(ByVal data As Byte()) As T
Using ms As New MemoryStream(data)
Dim bf As New BinaryFormatter
Return DirectCast(bf.Deserialize(ms), T)
End Using
End FunctionHere is a quick example of how to use it.
Code
Dim img As Image = retFlag("ipaddress") 'retFlag is an image function I am using in a project of mine
Dim imgByte() As Byte = Serialize(img) Public Shared Function Serialize(ByVal obj As Object) As Byte()
Dim img2 As Image = DeSerialize(Of Image)(imgByte)
PictureBox1.Image = img2


