mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-02-16 19:40:37 +03:00
Removal of leftovers
This commit is contained in:
parent
974407396e
commit
1028afce37
|
@ -9,7 +9,6 @@ import doctest
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
import shutil
|
import shutil
|
||||||
import string
|
|
||||||
import sys
|
import sys
|
||||||
import tempfile
|
import tempfile
|
||||||
import time
|
import time
|
||||||
|
@ -46,36 +45,13 @@ def smokeTest():
|
||||||
continue
|
continue
|
||||||
|
|
||||||
for ifile in files:
|
for ifile in files:
|
||||||
if os.path.splitext(ifile)[1].lower() == ".py":
|
if os.path.splitext(ifile)[1].lower() == ".py" and ifile != "__init__.py":
|
||||||
content = None
|
|
||||||
with open(os.path.join(root, ifile), "r+b") as f:
|
|
||||||
content = f.read()
|
|
||||||
active = content
|
|
||||||
active = re.sub(r"(?s)\"\"\".+?\"\"\"", "", active)
|
|
||||||
active = re.sub(r"\".+?\"", "", active)
|
|
||||||
active = re.sub(r"\'.+?\'", "", active)
|
|
||||||
active = re.sub(r"#.+", "", active)
|
|
||||||
for ss in re.findall(r"\b_*?[a-z]+[A-Z].*?\b", active):
|
|
||||||
original = ss
|
|
||||||
if ss.startswith("sqlmap") and any(_ in ss.lower() for _ in ("exception", "sqlmapmissing", "sqlmapundefinedmethod")):
|
|
||||||
ss = "S" + ss[1:]
|
|
||||||
if ss.startswith("_"):
|
|
||||||
ss = "_" + ss.lstrip("_")
|
|
||||||
content = content.replace(original, ss)
|
|
||||||
if content:
|
|
||||||
with open(os.path.join(root, ifile), "w+b") as f:
|
|
||||||
f.write(content)
|
|
||||||
path = os.path.join(root, os.path.splitext(ifile)[0])
|
path = os.path.join(root, os.path.splitext(ifile)[0])
|
||||||
path = path.replace(paths.SQLMAP_ROOT_PATH, '.')
|
path = path.replace(paths.SQLMAP_ROOT_PATH, '.')
|
||||||
path = path.replace(os.sep, '.').lstrip('.')
|
path = path.replace(os.sep, '.').lstrip('.')
|
||||||
try:
|
try:
|
||||||
__import__(path)
|
__import__(path)
|
||||||
module = sys.modules[path]
|
module = sys.modules[path]
|
||||||
#for name in dir(module):
|
|
||||||
#_ = getattr(module, name)
|
|
||||||
#if type(_) == type(lambda x: x):
|
|
||||||
#if re.match(r"\b_*?[a-z]+[A-Z]", name):
|
|
||||||
#print name
|
|
||||||
except Exception, msg:
|
except Exception, msg:
|
||||||
retVal = False
|
retVal = False
|
||||||
dataToStdout("\r")
|
dataToStdout("\r")
|
||||||
|
@ -90,7 +66,7 @@ def smokeTest():
|
||||||
|
|
||||||
count += 1
|
count += 1
|
||||||
status = '%d/%d (%d%s) ' % (count, length, round(100.0*count/length), '%')
|
status = '%d/%d (%d%s) ' % (count, length, round(100.0*count/length), '%')
|
||||||
#dataToStdout("\r[%s] [INFO] complete: %s" % (time.strftime("%X"), status))
|
dataToStdout("\r[%s] [INFO] complete: %s" % (time.strftime("%X"), status))
|
||||||
|
|
||||||
clearConsoleLine()
|
clearConsoleLine()
|
||||||
if retVal:
|
if retVal:
|
||||||
|
@ -235,4 +211,4 @@ def replaceVars(item, vars_):
|
||||||
for var in re.findall("\$\{([^}]+)\}", item):
|
for var in re.findall("\$\{([^}]+)\}", item):
|
||||||
if var in vars_:
|
if var in vars_:
|
||||||
retVal = retVal.replace("${%s}" % var, vars_[var])
|
retVal = retVal.replace("${%s}" % var, vars_[var])
|
||||||
return retVal
|
return retVal
|
||||||
|
|
Loading…
Reference in New Issue
Block a user