Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e5968ca

Browse files
committed
Fixes --profile
1 parent 2b55ae3 commit e5968ca

4 files changed

Lines changed: 36 additions & 29 deletions

File tree

lib/core/profiling.py

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -80,15 +80,20 @@ def profile(profileOutputFile=None, dotOutputFile=None, imageOutputFile=None):
8080
if isinstance(pydotGraph, list):
8181
pydotGraph = pydotGraph[0]
8282

83-
pydotGraph.write_png(imageOutputFile)
84-
85-
infoMsg = "displaying interactive graph with xdot library"
86-
logger.info(infoMsg)
87-
88-
# Display interactive Graphviz dot file by using extra/xdot/xdot.py
89-
# http://code.google.com/p/jrfonseca/wiki/XDot
90-
win = xdot.DotWindow()
91-
win.connect('destroy', gtk.main_quit)
92-
win.set_filter("dot")
93-
win.open_file(dotOutputFile)
94-
gtk.main()
83+
try:
84+
pydotGraph.write_png(imageOutputFile)
85+
except OSError:
86+
errMsg = "profiling requires graphviz installed "
87+
errMsg += "(Hint: 'sudo apt-get install graphviz')"
88+
logger.error(errMsg)
89+
else:
90+
infoMsg = "displaying interactive graph with xdot library"
91+
logger.info(infoMsg)
92+
93+
# Display interactive Graphviz dot file by using extra/xdot/xdot.py
94+
# http://code.google.com/p/jrfonseca/wiki/XDot
95+
win = xdot.DotWindow()
96+
win.connect('destroy', gtk.main_quit)
97+
win.set_filter("dot")
98+
win.open_file(dotOutputFile)
99+
gtk.main()

lib/core/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from lib.core.enums import OS
2020

2121
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
22-
VERSION = "1.2.6.28"
22+
VERSION = "1.2.6.29"
2323
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
2424
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
2525
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)

sqlmap.py

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -143,26 +143,28 @@ def main():
143143

144144
if not conf.updateAll:
145145
# Postponed imports (faster start)
146-
if conf.profile:
147-
from lib.core.profiling import profile
148-
profile()
149-
elif conf.smokeTest:
146+
if conf.smokeTest:
150147
from lib.core.testing import smokeTest
151148
smokeTest()
152149
elif conf.liveTest:
153150
from lib.core.testing import liveTest
154151
liveTest()
155152
else:
156153
from lib.controller.controller import start
157-
try:
158-
start()
159-
except thread.error as ex:
160-
if "can't start new thread" in getSafeExString(ex):
161-
errMsg = "unable to start new threads. Please check OS (u)limits"
162-
logger.critical(errMsg)
163-
raise SystemExit
164-
else:
165-
raise
154+
if conf.profile:
155+
from lib.core.profiling import profile
156+
globals()["start"] = start
157+
profile()
158+
else:
159+
try:
160+
start()
161+
except thread.error as ex:
162+
if "can't start new thread" in getSafeExString(ex):
163+
errMsg = "unable to start new threads. Please check OS (u)limits"
164+
logger.critical(errMsg)
165+
raise SystemExit
166+
else:
167+
raise
166168

167169
except SqlmapUserQuitException:
168170
errMsg = "user quit"

txt/checksum.md5

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,12 @@ cada93357a7321655927fc9625b3bfec lib/core/exception.py
4343
e9e32e5afe49ecd644b3a0ca9c9a36fc lib/core/optiondict.py
4444
d2672b24ffa985523066613138fccbbd lib/core/option.py
4545
c8c386d644d57c659d74542f5f57f632 lib/core/patch.py
46-
7cfd04e583cca782b843f6f6d973981a lib/core/profiling.py
46+
945b313b8bb9713f570f5ebb05416799 lib/core/profiling.py
4747
6f654e1715571eff68a0f8af3d62dcf8 lib/core/readlineng.py
4848
0c3eef46bdbf87e29a3f95f90240d192 lib/core/replication.py
4949
a7db43859b61569b601b97f187dd31c5 lib/core/revision.py
5050
fcb74fcc9577523524659ec49e2e964b lib/core/session.py
51-
eceda1743cad3fb421344c19ab4148ed lib/core/settings.py
51+
e5a223ce6a904c33c896cc6a6161eb01 lib/core/settings.py
5252
0dfc2ed40adf72e302291f6ecd4406f6 lib/core/shell.py
5353
a7edc9250d13af36ac0108f259859c19 lib/core/subprocessng.py
5454
36bd2dc292c0e10e39bd9c43b77fe1bc lib/core/target.py
@@ -226,7 +226,7 @@ ec2ba8c757ac96425dcd2b97970edd3a shell/stagers/stager.asp_
226226
0c48ddb1feb7e38a951ef05a0d48e032 shell/stagers/stager.jsp_
227227
2f9e459a4cf6a58680978cdce5ff7971 shell/stagers/stager.php_
228228
4eaeef94314956e4517e5310a28d579a sqlmapapi.py
229-
c5ecca109867f7ce4d325f487cf7badd sqlmap.py
229+
b6e9d67cafb85ff2c3fde165fc577a8d sqlmap.py
230230
1a1e3a78ded58b240c9dbb1b17996acf tamper/0x2char.py
231231
4c3b8a7daa4bff52e01d4168be0eedbe tamper/apostrophemask.py
232232
4115a55b8aba464723d645b7d3156b6e tamper/apostrophenullencode.py

0 commit comments

Comments
 (0)