|
Dump Hexa FileDumps a file into an hexadecimal listing
File Name : dumphexafile.vbs Requirement : none Author : Jean-Luc Antoine Submitted : 01/09/2001 Category : Other Preview : Click here ! Dim f, a, s, n, t, c, r, k
set f = wscript.arguments
If f.Count Then
s = f.item(0)
Else
s = InputBox("File Name :")
If s = "" Then WScript.Quit(1)
End If
Set f = CreateObject("Scripting.FileSystemObject")
If Not f.FileExists(s) Then
MsgBox "File not found : " & s, 16
WScript.Quit(2)
End If
t = f.GetTempName
Set c = f.CreateTextFile(t, -1)
Set a = f.OpenTextFile(s, 1)
c.WriteLine(s & vbCRLF & " 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F")
n = 0
While Not a.AtEndOfStream
If (n Mod 16) = 0 Then
s = Right("00000" & Hex(n), 6)
r = " "
End If
k = Asc(a.Read(1))
If k > 31 And k < 128 Then r = r & Chr(k) Else r = r & "."
s = s & " " & Right("0" & Hex(k), 2)
n = n + 1
If ((n Mod 16) = 0) or a.AtEndOfStream Then c.WriteLine(s) & Space(((n Mod 16)>0)*((n Mod 16)*3-48)) & r
Wend
a.Close
c.Close
Set c = WScript.CreateObject("WScript.Shell")
c.Run "notepad.exe " & t,3 ,-1
f.DeleteFile t
|
|||||
|
|