Dump routine 0.0
Submitted By:
denis_louet
Rating:
Not rated (
Rate It)
' ===================================================================================
Public Function Dump(ByVal Libelle As String, ByVal Buffer As String) As String
Dim i As Integer
Dim j As Integer
Dim k As Integer
Dim WS As String
Dim WS2 As String
Dim ClearDump As String
Dim ConstructionString As String
ClearDump = ""
ConstructionString = ""
WS = Libelle
For i = 0 To Len(Buffer) - 1
If i Mod 16 = 0 Then
If Len(ConstructionString) > 65000 Then
ConstructionString = ""
End If
ConstructionString = ConstructionString & ":" & WS & ":" & ClearDump & vbCrLf
WS2 = Hex$(i)
If Len(WS2) = 1 Then WS2 = "0" & WS2
WS = String$(4 - Len(WS2), "0") & WS2 & ":"
ClearDump = ""
End If
WS2 = Hex(Asc(Mid$(Buffer, i + 1, 1)))
If Len(WS2) = 1 Then WS2 = "0" & WS2
WS = WS & WS2 & " "
k = Asc(Mid$(Buffer, i + 1, 1))
If (k < 32) Or (k > 128) Then
ClearDump = ClearDump & "."
Else
ClearDump = ClearDump & Mid$(Buffer, i + 1, 1)
End If
Next i
Dump = ConstructionString & (":" & WS & String$((3 * 16) - (3 * Len(ClearDump)), "_") & ":" & ClearDump)
End Function