I am trying to use fstream to write an executable file:
Dim buffer As String
Dim c As Char = Chr(9)
Dim fs As System.IO.FileStream = New System.IO.FileStream("test.exe", IO.FileMode.OpenOrCreate)
Dim w As System.IO.BinaryWriter = New System.IO.BinaryWriter(fs)
w.Seek(0, System.IO.SeekOrigin.Begin)
w.Write(HEX VALUES HERE)
w.Close()
fs.Close()
To convert the hex to ASCII I have tried things such as:
MessageBox.Show(ChrW(Convert.ToInt32("48", 16)))
MessageBox.Show(Chr(CInt("&H" & "48")))
MessageBox.Show(Chr(CInt("&H48")))
However each of those functions will only work with a single character. How do I make those functions work for entire strings?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…