Hex to binary using VBScript

binary, converters, hex, vbscript

Solution

Something like this should work:

hexstr = "00 00 00 0A 4D"

hexarr = Split(hexstr)
ReDim binarr(UBound(hexarr))

For i = 0 To UBound(hexarr)
  binarr(i) = Chr(CInt("&h" & hexarr(i)))
Next

binstr = Join(binarr, "")

Problem

Is it possible to convert a Hexdump to binary using VBS? I made a program that reads any file as Byte array, then it converts it to Hex. In output Hexdump looks like this ``` 00 00 00 0A 4D ``` til the end. Now i want to know if i can convert it back to binary and execute it using a VBScript. I will appreciate any help, thank you.

Original source