@@ -1111,7 +1111,7 @@ def profile(profileOutputFile=None, imageOutputFile=None):
11111111 logger .info (infoMsg )
11121112
11131113 graphScriptPath = os .path .join (paths .SQLMAP_EXTRAS_PATH , 'gprof2dot' , 'gprof2dot.py' )
1114- stderr = subprocess .Popen ('python %s -f pstats %s | dot -Tpng -o %s' % (graphScriptPath , profileOutputFile , imageOutputFile ), shell = True , stderr = subprocess .PIPE ).stderr .read ()
1114+ stderr = subprocess .Popen ('%s %s -f pstats %s | dot -Tpng -o %s' % (sys . executable , graphScriptPath , profileOutputFile , imageOutputFile ), shell = True , stderr = subprocess .PIPE ).stderr .read ()
11151115
11161116 if stderr or not os .path .exists (imageOutputFile ):
11171117 errMsg = "there was an error while converting ('%s')" % stderr .strip ()
@@ -1164,27 +1164,28 @@ def parseXmlFile(xmlFile, handler):
11641164def calculateDeltaSeconds (start , epsilon = 0.05 ):
11651165 return int (time .time () - start + epsilon )
11661166
1167- def getCommonPredictionTables (value , originalTable ):
1168- if not kb .commonTables :
1169- kb .commonTables = {}
1170- fileName = os .path .join (paths .SQLMAP_TXT_PATH , 'common-tables.txt' )
1171- file = open (fileName , 'r' )
1172- key = None
1173- for line in file .xreadlines ():
1174- line = line .strip ()
1175- if len (line ) > 1 :
1176- if line [0 ] == '[' and line [- 1 ] == ']' :
1177- key = line [1 :- 1 ]
1178- elif key :
1179- if key not in kb .commonTables :
1180- kb .commonTables [key ] = []
1181- kb .commonTables [key ].append (line .strip ())
1167+ def initCommonOutputs ():
1168+ kb .commonOutputs = {}
1169+ fileName = os .path .join (paths .SQLMAP_TXT_PATH , 'common-outputs.txt' )
1170+ file = open (fileName , 'r' )
1171+ key = None
1172+ for line in file .xreadlines ():
1173+ line = line .strip ()
1174+ if len (line ) > 1 :
1175+ if line [0 ] == '[' and line [- 1 ] == ']' :
1176+ key = line [1 :- 1 ]
1177+ elif key :
1178+ if key not in kb .commonTables :
1179+ kb .commonTables [key ] = []
1180+ kb .commonTables [key ].append (line .strip ())
1181+
1182+ def getGoodSamaritanCharsets (part , originalCharset ):
1183+ if not kb .commonOutputs :
1184+ initCommonOutputs ()
11821185
11831186 predictionSet = set ()
11841187 wildIndexes = []
11851188
1186- kb .dbms = 'MySQL'
1187-
11881189 if value [- 1 ] != '.' :
11891190 value += '.'
11901191 charIndex = 0
0 commit comments