File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -351,7 +351,8 @@ def nullAndCastField(self, field):
351351 else :
352352 nulledCastedField = rootQuery .isnull .query % nulledCastedField
353353
354- if conf .hexConvert or conf .binaryFields and field in conf .binaryFields .split (',' ):
354+ kb .binaryField = conf .binaryFields and field in conf .binaryFields .split (',' )
355+ if conf .hexConvert or kb .binaryField :
355356 nulledCastedField = self .hexConvertField (nulledCastedField )
356357
357358 return nulledCastedField
Original file line number Diff line number Diff line change @@ -3478,18 +3478,19 @@ def _(value):
34783478 if value and isinstance (value , basestring ) and len (value ) % 2 == 0 :
34793479 retVal = hexdecode (retVal )
34803480
3481- if Backend .isDbms (DBMS .MSSQL ) and value .startswith ("0x" ):
3482- try :
3483- retVal = retVal .decode ("utf-16-le" )
3484- except UnicodeDecodeError :
3485- pass
3486- elif Backend .isDbms (DBMS .HSQLDB ):
3487- try :
3488- retVal = retVal .decode ("utf-16-be" )
3489- except UnicodeDecodeError :
3490- pass
3491- if not isinstance (retVal , unicode ):
3492- retVal = getUnicode (retVal , "utf8" )
3481+ if not kb .binaryField :
3482+ if Backend .isDbms (DBMS .MSSQL ) and value .startswith ("0x" ):
3483+ try :
3484+ retVal = retVal .decode ("utf-16-le" )
3485+ except UnicodeDecodeError :
3486+ pass
3487+ elif Backend .isDbms (DBMS .HSQLDB ):
3488+ try :
3489+ retVal = retVal .decode ("utf-16-be" )
3490+ except UnicodeDecodeError :
3491+ pass
3492+ if not isinstance (retVal , unicode ):
3493+ retVal = getUnicode (retVal , "utf8" )
34933494
34943495 return retVal
34953496
Original file line number Diff line number Diff line change @@ -1572,6 +1572,7 @@ def _setKnowledgeBaseAttributes(flushAll=True):
15721572 kb .arch = None
15731573 kb .authHeader = None
15741574 kb .bannerFp = AttribDict ()
1575+ kb .binaryField = False
15751576
15761577 kb .brute = AttribDict ({"tables" : [], "columns" : []})
15771578 kb .bruteMode = False
You can’t perform that action at this time.
0 commit comments