File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -872,7 +872,7 @@ def dataToOutFile(filename, data):
872872 retVal = os .path .join (conf .filePath , filePathToSafeString (filename ))
873873
874874 try :
875- with openFile (retVal , "wb " ) as f :
875+ with open (retVal , "w+b " ) as f :
876876 f .write (data )
877877 except IOError , ex :
878878 errMsg = "something went wrong while trying to write "
@@ -3714,7 +3714,7 @@ def applyFunctionRecursively(value, function):
37143714
37153715 return retVal
37163716
3717- def decodeHexValue (value ):
3717+ def decodeHexValue (value , raw = False ):
37183718 """
37193719 Returns value decoded from DBMS specific hexadecimal representation
37203720
@@ -3729,7 +3729,7 @@ def _(value):
37293729 if value and isinstance (value , basestring ) and len (value ) % 2 == 0 :
37303730 retVal = hexdecode (retVal )
37313731
3732- if not kb .binaryField :
3732+ if not kb .binaryField and not raw :
37333733 if Backend .isDbms (DBMS .MSSQL ) and value .startswith ("0x" ):
37343734 try :
37353735 retVal = retVal .decode ("utf-16-le" )
Original file line number Diff line number Diff line change @@ -232,7 +232,7 @@ def readFile(self, remoteFiles):
232232 fileContent = newFileContent
233233
234234 if fileContent is not None :
235- fileContent = decodeHexValue (fileContent )
235+ fileContent = decodeHexValue (fileContent , True )
236236
237237 if fileContent :
238238 localFilePath = dataToOutFile (remoteFile , fileContent )
You can’t perform that action at this time.
0 commit comments