Hii
I have been converting a file into its hex value.But cannot convert it back into same exe value
Let me get in detail
Here is the code
Imports System.IO
Sub Main()
Dim fileName As String = "ABC.exe"
Dim data As Byte() = File.ReadAllBytes(fileName)
Dim fs As FileStream = File.OpenWrite(fileName & ".txt")
Dim sw As StreamWriter = New StreamWriter(fs)
Dim pos As Integer = 0
Dim line As Integer = 0
While pos < data.Length
sw.Write(String.Format("{0}:", line.ToString("0000")))
For i As Integer = 1 To 20
sw.Write(String.Format(" {0:x2}", data(pos)))
pos += 1
If pos = data.Length Then
Exit For
End If
Next
sw.WriteLine()
line += 1
End While
sw.Flush()
sw.Close()
fs.Close()
End Sub
Now,When i call the main method an text file called ABC.exe.txt is generated.
First of all instead of ABC.exe.txt can we have ABC.txt only
and secondly can how can i convert this hex values back to exe.. at least compile it in vb or any other language
Thank you for your time