' 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

DoWhileNot(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=0Then
      strData = strData & " "
    ElseIf car>=32and car<=128then
      strData = strData & Chr(car)
    Else
      strData = strData & "."
    EndIf
        
  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)=1Then
    s="0" & s
  EndIf
  MyHex=s
EndFunction
search for scripts

VbsEdit contains all these sample scripts!


Download Now!



Download   Home   Scripts

Copyright © 2001-2024 adersοft