Skip to content

Commit f56d135

Browse files
committed
Minor code restyling
1 parent 983546d commit f56d135

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+813
-813
lines changed

extra/chardet/mbcssm.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@
129129

130130
# EUC-KR
131131

132-
EUCKR_cls = ( \
132+
EUCKR_cls = ( \
133133
1,1,1,1,1,1,1,1, # 00 - 07
134134
1,1,1,1,1,1,0,0, # 08 - 0f
135135
1,1,1,1,1,1,1,1, # 10 - 17
@@ -371,7 +371,7 @@
371371
0,0,0,0,0,0,0,0, # f0 - f7
372372
0,0,0,0,0,0,4,5) # f8 - ff
373373

374-
UCS2BE_st = ( \
374+
UCS2BE_st = ( \
375375
5, 7, 7,eError, 4, 3,eError,eError,#00-07
376376
eError,eError,eError,eError,eItsMe,eItsMe,eItsMe,eItsMe,#08-0f
377377
eItsMe,eItsMe, 6, 6, 6, 6,eError,eError,#10-17

extra/cloak/cloak.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def decloak(inputFile):
4747

4848
def main():
4949
usage = '%s [-d] -i <input file> [-o <output file>]' % sys.argv[0]
50-
parser = OptionParser(usage=usage, version='0.1')
50+
parser = OptionParser(usage=usage, version='0.1')
5151

5252
try:
5353
parser.add_option('-d', dest='decrypt', action="store_true", help='Decrypt')

extra/dbgtool/dbgtool.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ def convert(inputFile):
2424
print "ERROR: the provided input file '%s' is too big for debug.exe" % inputFile
2525
sys.exit(1)
2626

27-
script = "n %s\nr cx\n" % os.path.basename(inputFile.replace(".", "_"))
28-
script += "%x\nf 0100 ffff 00\n" % fileSize
29-
scrString = ""
30-
counter = 256
31-
counter2 = 0
27+
script = "n %s\nr cx\n" % os.path.basename(inputFile.replace(".", "_"))
28+
script += "%x\nf 0100 ffff 00\n" % fileSize
29+
scrString = ""
30+
counter = 256
31+
counter2 = 0
3232

33-
fp = open(inputFile, "rb")
33+
fp = open(inputFile, "rb")
3434
fileContent = fp.read()
3535

3636
for fileChar in fileContent:
@@ -40,20 +40,20 @@ def convert(inputFile):
4040
counter2 += 1
4141

4242
if not scrString:
43-
scrString = "e %0x %02x" % (counter, unsignedFileChar)
43+
scrString = "e %0x %02x" % (counter, unsignedFileChar)
4444
else:
4545
scrString += " %02x" % unsignedFileChar
4646
elif scrString:
47-
script += "%s\n" % scrString
47+
script += "%s\n" % scrString
4848
scrString = ""
49-
counter2 = 0
49+
counter2 = 0
5050

5151
counter += 1
5252

5353
if counter2 == 20:
54-
script += "%s\n" % scrString
55-
scrString = ""
56-
counter2 = 0
54+
script += "%s\n" % scrString
55+
scrString = ""
56+
counter2 = 0
5757

5858
script += "w\nq\n"
5959

@@ -67,7 +67,7 @@ def main(inputFile, outputFile):
6767
script = convert(inputFile)
6868

6969
if outputFile:
70-
fpOut = open(outputFile, "w")
70+
fpOut = open(outputFile, "w")
7171
sys.stdout = fpOut
7272
sys.stdout.write(script)
7373
sys.stdout.close()
@@ -76,7 +76,7 @@ def main(inputFile, outputFile):
7676

7777
if __name__ == "__main__":
7878
usage = "%s -i <input file> [-o <output file>]" % sys.argv[0]
79-
parser = OptionParser(usage=usage, version="0.1")
79+
parser = OptionParser(usage=usage, version="0.1")
8080

8181
try:
8282
parser.add_option("-i", dest="inputFile", help="Input binary file")
@@ -91,7 +91,7 @@ def main(inputFile, outputFile):
9191
except (OptionError, TypeError), e:
9292
parser.error(e)
9393

94-
inputFile = args.inputFile
94+
inputFile = args.inputFile
9595
outputFile = args.outputFile
9696

9797
main(inputFile, outputFile)

extra/gprof2dot/gprof2dot.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -657,8 +657,8 @@ def __init__(self, fp, skip_ws = True):
657657
self.character_data = ''
658658

659659
self.parser = xml.parsers.expat.ParserCreate()
660-
self.parser.StartElementHandler = self.handle_element_start
661-
self.parser.EndElementHandler = self.handle_element_end
660+
self.parser.StartElementHandler = self.handle_element_start
661+
self.parser.EndElementHandler = self.handle_element_end
662662
self.parser.CharacterDataHandler = self.handle_character_data
663663

664664
def handle_element_start(self, name, attributes):

extra/mssqlsig/update.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,16 @@ def updateMSSQLXML():
3838
mssqlVersionsHtmlString = f.read()
3939
f.close()
4040
except urllib2.URLError:
41-
__mssqlPath = urlparse.urlsplit(MSSQL_VERSIONS_URL)
41+
__mssqlPath = urlparse.urlsplit(MSSQL_VERSIONS_URL)
4242
__mssqlHostname = __mssqlPath[1]
4343

44-
warnMsg = "[WARNING] sqlmap was unable to connect to %s," % __mssqlHostname
44+
warnMsg = "[WARNING] sqlmap was unable to connect to %s," % __mssqlHostname
4545
warnMsg += " check your Internet connection and retry"
4646
print warnMsg
4747

4848
return
4949

50-
releases = re.findall("class=\"BCC_DV_01DarkBlueTitle\">SQL Server ([\d\.]+) Builds", mssqlVersionsHtmlString, re.I | re.M)
50+
releases = re.findall("class=\"BCC_DV_01DarkBlueTitle\">SQL Server ([\d\.]+) Builds", mssqlVersionsHtmlString, re.I | re.M)
5151
releasesCount = len(releases)
5252

5353
# Create the minidom document
@@ -73,9 +73,9 @@ def updateMSSQLXML():
7373
startIdx = mssqlVersionsHtmlString.index("SQL Server %s Builds" % releases[index])
7474

7575
if index == releasesCount - 1:
76-
stopIdx = len(mssqlVersionsHtmlString)
76+
stopIdx = len(mssqlVersionsHtmlString)
7777
else:
78-
stopIdx = mssqlVersionsHtmlString.index("SQL Server %s Builds" % releases[index + 1])
78+
stopIdx = mssqlVersionsHtmlString.index("SQL Server %s Builds" % releases[index + 1])
7979

8080
mssqlVersionsReleaseString = mssqlVersionsHtmlString[startIdx:stopIdx]
8181
servicepackVersion = re.findall("</td><td>[7\.0|2000|2005|2008]*(.*?)</td><td.*?([\d\.]+)</td>[\r]*\n", mssqlVersionsReleaseString, re.I | re.M)
@@ -133,7 +133,7 @@ def updateMSSQLXML():
133133
doc.writexml(writer=mssqlXml, addindent=" ", newl="\n")
134134
mssqlXml.close()
135135

136-
infoMsg = "[INFO] done. retrieved data parsed and saved into '%s'" % MSSQL_XML
136+
infoMsg = "[INFO] done. retrieved data parsed and saved into '%s'" % MSSQL_XML
137137
print infoMsg
138138

139139
if __name__ == "__main__":

extra/safe2bin/safe2bin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def safechardecode(value):
7575

7676
def main():
7777
usage = '%s -i <input file> [-o <output file>]' % sys.argv[0]
78-
parser = OptionParser(usage=usage, version='0.1')
78+
parser = OptionParser(usage=usage, version='0.1')
7979

8080
try:
8181
parser.add_option('-i', dest='inputFile', help='Input file')

extra/sqlharvest/sqlharvest.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@
1919

2020
def main():
2121

22-
TIMEOUT = 10
23-
CONFIG_FILE = 'sqlharvest.cfg'
24-
TABLES_FILE = 'tables.txt'
25-
USER_AGENT = 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; AskTB5.3)'
26-
SEARCH_URL = 'http://www.google.com/m?source=mobileproducts&dc=gorganic'
27-
MAX_FILE_SIZE = 2*1024*1024 # if a result (.sql) file for downloading is more than 2MB in size just skip it
28-
QUERY = 'CREATE TABLE ext:sql'
29-
REGEX_URLS = r';u=([^"]+)'
30-
REGEX_RESULT = r'CREATE TABLE\s*(/\*.*\*/)?\s*(IF NOT EXISTS)?\s*(?P<result>[^\(;]+)'
22+
TIMEOUT = 10
23+
CONFIG_FILE = 'sqlharvest.cfg'
24+
TABLES_FILE = 'tables.txt'
25+
USER_AGENT = 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; AskTB5.3)'
26+
SEARCH_URL = 'http://www.google.com/m?source=mobileproducts&dc=gorganic'
27+
MAX_FILE_SIZE = 2*1024*1024 # if a result (.sql) file for downloading is more than 2MB in size just skip it
28+
QUERY = 'CREATE TABLE ext:sql'
29+
REGEX_URLS = r';u=([^"]+)'
30+
REGEX_RESULT = r'CREATE TABLE\s*(/\*.*\*/)?\s*(IF NOT EXISTS)?\s*(?P<result>[^\(;]+)'
3131

3232
tables = dict()
3333
refiles = re.compile(REGEX_URLS)

lib/controller/action.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def action():
3434
if not Backend.getDbms() or not conf.dbmsHandler:
3535
htmlParsed = Format.getErrorParsedDBMSes()
3636

37-
errMsg = "sqlmap was not able to fingerprint the "
37+
errMsg = "sqlmap was not able to fingerprint the "
3838
errMsg += "back-end database management system"
3939

4040
if htmlParsed:

lib/controller/checks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ def genCmpPayload():
356356
injectable = True
357357

358358
except sqlmapConnectionException, msg:
359-
debugMsg = "problem occured most likely because the "
359+
debugMsg = "problem occured most likely because the "
360360
debugMsg += "server hasn't recovered as expected from the "
361361
debugMsg += "error-based payload used ('%s')" % msg
362362
logger.debug(debugMsg)

lib/controller/controller.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ def start():
174174
kb.targetUrls.add(( conf.url, conf.method, conf.data, conf.cookie ))
175175

176176
if conf.configFile and not kb.targetUrls:
177-
errMsg = "you did not edit the configuration file properly, set "
177+
errMsg = "you did not edit the configuration file properly, set "
178178
errMsg += "the target url, list of targets or google dork"
179179
logger.error(errMsg)
180180
return False
@@ -183,15 +183,15 @@ def start():
183183
infoMsg = "sqlmap got a total of %d targets" % len(kb.targetUrls)
184184
logger.info(infoMsg)
185185

186-
hostCount = 0
187-
cookieStr = ""
186+
hostCount = 0
187+
cookieStr = ""
188188
setCookieAsInjectable = True
189189

190190
for targetUrl, targetMethod, targetData, targetCookie in kb.targetUrls:
191191
try:
192-
conf.url = targetUrl
192+
conf.url = targetUrl
193193
conf.method = targetMethod
194-
conf.data = targetData
194+
conf.data = targetData
195195
conf.cookie = targetCookie
196196

197197
initTargetEnv()
@@ -289,15 +289,15 @@ def start():
289289
if not conf.dropSetCookie and conf.cj:
290290
for _, cookie in enumerate(conf.cj):
291291
cookie = getUnicode(cookie)
292-
index = cookie.index(" for ")
292+
index = cookie.index(" for ")
293293

294294
cookieStr += "%s;" % cookie[8:index]
295295

296296
if cookieStr:
297297
cookieStr = cookieStr[:-1]
298298

299299
if PLACE.COOKIE in conf.parameters:
300-
message = "you provided an HTTP Cookie header value. "
300+
message = "you provided an HTTP Cookie header value. "
301301
message += "The target url provided its own Cookie within "
302302
message += "the HTTP Set-Cookie header. Do you want to "
303303
message += "continue using the HTTP Cookie values that "

0 commit comments

Comments
 (0)