Code to test it:
Dim s1 As String = “”
For i As Integer = 0 To 255
Dim hexI As String = Hex(i)
If hexI.Length = 1 Then
hexI = “0” + hexI
s1 = s1 + System.Text.RegularExpressions.Regex.Unescape(“\x” + hexI)
For i2 As Integer = 0 To 255
RichTextBox1.AppendText(Hex(Microsoft.VisualBasic.AscW(s1(i2))) + vbNewLine)
I didn’t check all values, but all values that could be used as delimiters(\x00 for instance) seem retrievable. Also, notepad tells me the richtextbox has 256 lines(plus one empty at the end).
You need a form and a richtextbox for this code(the code is public domain btw)
I think I’ll store meta information in a separate file. But I’ll let this idea mature a little before I get to coding.
When it comes down to GUI and cryptography, but sucks in everything else. I have a huge program and I’m not close to finishing my header-adding program, I would have already finished with few lines in python. Given that most users won’t need to add headers(only “webmasters”) I will move to python for this part. The worst part is that I don’t even know whether VB.net strings are binary-safe. That would easy my life somewhat.
…wasn’t completely useless now that I think about it. The IPAddress.Any property can be bound to a socket but it can’t display the external IPv4 address(it shows up as “0.0.0.0”)
Isn’t it curious that even if I bind a raw socket at ipaddress.any port 0 I still don’t get all traffic to my IP address(let alone my computer)?
My getlocalip function at https://siliconvalleylatebloomer.wordpress.com/2014/05/19/essential-functions-getlocalip-and-byteartohex/ can be easily replaced(in fact, improved) by getting the property net.ipaddress.any instead
Explode function in VB:
Private Function phpishExplode(ByVal del As String, ByVal s1 As String)
Dim returnValue As New ArrayList
Dim lastMatchIndex As Integer = 0
For i As Integer = 0 To s1.Count – del.Length
Dim match As Boolean = True
For i2 As Integer = 0 To del.Length – 1
If s1(i + i2) <> del(i2) Then
match = False
If match = True Then
returnValue.Add(s1.Substring(lastMatchIndex, i – lastMatchIndex))
lastMatchIndex = i + del.Length
returnValue.Add(s1.Substring(lastMatchIndex, s1.Length – lastMatchIndex))