So you want to convert that hex string to binary format of a file, so you can save it to a binary file......This functioin HexToDec converts Hex values into decimal or denary values, then you can store it in a byte array which you can then use to output the converted hex to a binary file...
VB Code:
  1. Private Sub Command1_Click
  2. Dim Fno as Integer
  3. Dim ByteArray() As Byte
  4. dim i as Integer
  5.  
  6. Fno = FreeFile
  7.  
  8. For i = 0 To Len(HEXString)
  9.     ByteArray(i) = HexToDec(Mid(HEXString, i, 1))
  10. Next i
  11.  
  12. 'Save it to file
  13. Open "c:\something.exe" For Binary As #Fno
  14.      Put #Fno, , ByteArray
  15. Close #Fno
  16. End Sub
Put the following function either on the form or in a module...
VB Code:
  1. Public Function HexToDec(ByVal HexStr As String) As Double
  2. Dim mult As Double
  3. Dim DecNum As Double
  4. Dim ch As String
  5. Dim i As Integer
  6. mult = 1
  7. DecNum = 0
  8. For i = Len(HexStr) To 1 Step -1
  9.     ch = Mid(HexStr, i, 1)
  10.     If (ch >= "0") And (ch <= "9") Then
  11.         DecNum = DecNum + (Val(ch) * mult)
  12.     Else
  13.         If (ch >= "A") And (ch <= "F") Then
  14.             DecNum = DecNum + ((Asc(ch) - Asc("A") + 10) * mult)
  15.         Else
  16.             If (ch >= "a") And (ch <= "f") Then
  17.                 DecNum = DecNum + ((Asc(ch) - Asc("a") + 10) * mult)
  18.             Else
  19.                 HexToDec = 0
  20.                 Exit Function
  21.             End If
  22.         End If
  23.     End If
  24.     mult = mult * 16
  25. Next i
  26. HexToDec = DecNum
  27. End Function
Replace the filename with your file, and replace HEXString with your hex string variable