#1 A little fix that makes extracting files easier

closed
nobody
None
5
2014-02-18
2006-01-15
No

These changes to "msi.xsl" add the name to the save
box for exporting.

Line 254:
From:
WriteBinData('<xsl:value-of select="@md5"/>')
To:
Call WriteBinData('<xsl:value-of select="@md5"/>','<xsl:value-of select="ancestor::row/td&lt;span&gt;[1]&lt;/span&gt;/."/>')

Line 289:
From:
Function WriteBinData(strMD5)
To:
Function WriteBinData(strMD5, name)

Line 303:
From:
strSaveTo = Inputbox("Save binary stream as:", "Save
Binary File As", strSaveTo)
To:
strSaveTo = Inputbox("Save binary stream as:", "Save
Binary File As", strSaveTo & name)

Discussion

  • BlindWanderer

    BlindWanderer - 2006-01-30

    Logged In: YES
    user_id=667699

    I've come across an issue where WriteBinData doesn't always
    write the last character (resulting in a nasty headace).
    After doing extensive research i've found a better way, and
    it's much much fast.

    Function WriteBinData(strMD5, name)
    WriteBinData = False
    Dim oNode
    Set oNode = document.XMLDocument.selectSingleNode("//td
    [@md5='" & strMD5 & "']")
    If oNode Is Nothing Then
    MsgBox "Unable to find binary data."
    Exit Function
    End If

    Dim strSaveTo
    If document.location.protocol = "file:" Then
      strSaveTo = document.location.pathname
      strSaveTo = Mid(strSaveTo, 2, InStrRev
    

    (strSaveTo, "\") - 1)
    End If
    strSaveTo = Inputbox("Save binary stream as:", "Save
    Binary File As", strSaveTo, name)

    If strSaveTo = "" Then
      Exit Function
    End If
    
    With CreateObject("Scripting.FileSystemObject")
      With .CreateTextFile(strSaveTo, True, False)
        Dim RS, LBinary, Binary
        Set Binary = oNode.nodeTypedValue
        Set RS = CreateObject("ADODB.Recordset")
        LBinary = LenB(Binary)
        If LBinary>0 Then
          RS.Fields.Append "mBinary", 201, LBinary
          RS.Open
          RS.AddNew
          RS("mBinary").AppendChunk Binary 
          RS.Update
          .Write RSBinaryToString(RS("mBinary"))
        End If
        .Close
      End With ' Output file
    End With ' FSO
    
    window.status = "Done."
    

    End Function

     
  • BlindWanderer

    BlindWanderer - 2006-01-30

    Logged In: YES
    user_id=667699

    i feel stupid i re-applied the last patch from scratch
    without testing it first... here is the working version.

    Function WriteBinData(strMD5, name)
    WriteBinData = False
    Dim oNode
    Set oNode = document.XMLDocument.selectSingleNode("//td
    [@md5='" & strMD5 & "']")
    If oNode Is Nothing Then
    MsgBox "Unable to find binary data."
    Exit Function
    End If

    Dim strSaveTo
    If document.location.protocol = "file:" Then
      strSaveTo = document.location.pathname
      strSaveTo = Mid(strSaveTo, 2, InStrRev
    

    (strSaveTo, "\") - 1)
    End If
    strSaveTo = Inputbox("Save binary stream as:", "Save
    Binary File As", strSaveTo & name)

    If strSaveTo = "" Then
      Exit Function
    End If
    
    With CreateObject("Scripting.FileSystemObject")
      With .CreateTextFile(strSaveTo, True, False)
        Dim RS, LBinary, Bin
        Bin = oNode.nodeTypedValue
        LBinary = LenB(Bin)
        If LBinary>0 Then
          Set RS = CreateObject("ADODB.Recordset")
          RS.Fields.Append "mBinary", 201, LBinary
          RS.Open
          RS.AddNew
          RS("mBinary").AppendChunk Bin 
          RS.Update
          .Write RS("mBinary")
          RS.Close
          RS = Nothing
        End If
        .Close
      End With ' Output file
    End With ' FSO
    
    window.status = "Done."
    

    End Function

     
  • Daniel Gehriger

    Daniel Gehriger - 2007-09-26

    Logged In: YES
    user_id=30009
    Originator: NO

    Incorporated into trunk revision 93

     


Anonymous

Cancel  Add attachments





Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks