' Display the Contents of a Binary File
Set BinaryStream1 = CreateObject("ADODB.Stream")
BinaryStream1.Type = 1
BinaryStream1.Open
currentdir=Left(WScript.ScriptFullName,InStrRev(WScript.ScriptFullName,"\"))
BinaryStream1.LoadFromFile currentdir & "pivot.zip"
pos=0
Do While Not(BinaryStream1.EOS)
varByteArray1 = BinaryStream1.Read(16)
strData=""
strBin=""
For lngCounter = 0 to UBound(varByteArray1)
car= Ascb(Midb(varByteArray1,lngCounter + 1, 1))
strBin=strBin & MyHex(car) & " "
If car=0 Then
strData = strData & " "
ElseIf car>=32 and car<=128 then
strData = strData & Chr(car)
Else
strData = strData & "."
End If
Next
spos= string(8-Len(pos),"0") & pos
WScript.Echo spos & " " & strBin & " " & strData
pos=pos + 16
Loop
Function MyHex(c)
s=Hex(c)
If Len(s)=1 Then
s="0" & s
End If
MyHex=s
End Function