Skip to content

Commit 2c270ed

Browse files
committed
One more 2to3 baby step
1 parent 7074365 commit 2c270ed

File tree

10 files changed

+20
-20
lines changed

10 files changed

+20
-20
lines changed

lib/core/bigarray.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ def __getitem__(self, y):
148148
if y < 0:
149149
y += len(self)
150150

151-
index = y / self.chunk_length
151+
index = y // self.chunk_length
152152
offset = y % self.chunk_length
153153
chunk = self.chunks[index]
154154

@@ -159,7 +159,7 @@ def __getitem__(self, y):
159159
return self.cache.data[offset]
160160

161161
def __setitem__(self, y, value):
162-
index = y / self.chunk_length
162+
index = y // self.chunk_length
163163
offset = y % self.chunk_length
164164
chunk = self.chunks[index]
165165

lib/core/common.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2129,7 +2129,7 @@ def average(values):
21292129
0.9
21302130
"""
21312131

2132-
return (sum(values) / len(values)) if values else None
2132+
return (1.0 * sum(values) / len(values)) if values else None
21332133

21342134
@cachedmethod
21352135
def stdev(values):
@@ -3555,7 +3555,7 @@ def _(value):
35553555
retVal = content.replace(payload, REFLECTED_VALUE_MARKER) # dummy approach
35563556

35573557
if len(parts) > REFLECTED_MAX_REGEX_PARTS: # preventing CPU hogs
3558-
regex = _("%s%s%s" % (REFLECTED_REPLACEMENT_REGEX.join(parts[:REFLECTED_MAX_REGEX_PARTS / 2]), REFLECTED_REPLACEMENT_REGEX, REFLECTED_REPLACEMENT_REGEX.join(parts[-REFLECTED_MAX_REGEX_PARTS / 2:])))
3558+
regex = _("%s%s%s" % (REFLECTED_REPLACEMENT_REGEX.join(parts[:REFLECTED_MAX_REGEX_PARTS // 2]), REFLECTED_REPLACEMENT_REGEX, REFLECTED_REPLACEMENT_REGEX.join(parts[-REFLECTED_MAX_REGEX_PARTS // 2:])))
35593559

35603560
parts = filter(None, regex.split(REFLECTED_REPLACEMENT_REGEX))
35613561

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.3.1.63"
22+
VERSION = "1.3.1.64"
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)

lib/takeover/metasploit.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,7 @@ def createMsfShellcode(self, exitfunc, format, extra, encode):
621621
payloadSize = int(match.group(2))
622622

623623
if extra == "BufferRegister=EAX":
624-
payloadSize = payloadSize / 2
624+
payloadSize = payloadSize // 2
625625

626626
debugMsg = "the shellcode size is %d bytes" % payloadSize
627627
logger.debug(debugMsg)

lib/techniques/dns/use.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def dnsUse(payload, expression):
5757
while True:
5858
count += 1
5959
prefix, suffix = ("%s" % randomStr(length=3, alphabet=DNS_BOUNDARIES_ALPHABET) for _ in xrange(2))
60-
chunk_length = MAX_DNS_LABEL / 2 if Backend.getIdentifiedDbms() in (DBMS.ORACLE, DBMS.MYSQL, DBMS.PGSQL) else MAX_DNS_LABEL / 4 - 2
60+
chunk_length = MAX_DNS_LABEL // 2 if Backend.getIdentifiedDbms() in (DBMS.ORACLE, DBMS.MYSQL, DBMS.PGSQL) else MAX_DNS_LABEL // 4 - 2
6161
_, _, _, _, _, _, fieldToCastStr, _ = agent.getFields(expression)
6262
nulledCastedField = agent.nullAndCastField(fieldToCastStr)
6363
extendedField = re.search(r"[^ ,]*%s[^ ,]*" % re.escape(fieldToCastStr), expression).group(0)

lib/techniques/error/use.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def _oneShotErrorUse(expression, field=None, chunkTest=False):
9494
candidate = len(result) - len(kb.chars.stop)
9595
current = candidate if candidate != current else current - 1
9696
else:
97-
current = current / 2
97+
current = current // 2
9898

9999
if kb.errorChunkLength:
100100
hashDBWrite(HASHDB_KEYS.KB_ERROR_CHUNK_LENGTH, kb.errorChunkLength)

lib/techniques/union/test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def _orderByTest(cols):
7474
highCols += ORDER_BY_STEP
7575
else:
7676
while not found:
77-
mid = highCols - (highCols - lowCols) / 2
77+
mid = highCols - (highCols - lowCols) // 2
7878
if _orderByTest(mid):
7979
lowCols = mid
8080
else:

lib/utils/progress.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def __init__(self, minValue=0, maxValue=10, totalWidth=None):
2929

3030
def _convertSeconds(self, value):
3131
seconds = value
32-
minutes = seconds / 60
32+
minutes = seconds // 60
3333
seconds = seconds - (minutes * 60)
3434

3535
return "%.2d:%.2d" % (minutes, seconds)

lib/utils/xrange.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def __len__(self):
5858
return self._len()
5959

6060
def _len(self):
61-
return max(0, int((self.stop - self.start) / self.step))
61+
return max(0, int((self.stop - self.start) // self.step))
6262

6363
def __contains__(self, value):
6464
return (self.start <= value < self.stop) and (value - self.start) % self.step == 0

txt/checksum.md5

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ c4d559a98cfc62b401ef7e0bfab782f0 lib/controller/controller.py
2828
c1da277517c7ec4c23e953a51b51e203 lib/controller/handler.py
2929
fb6be55d21a70765e35549af2484f762 lib/controller/__init__.py
3030
ed7874be0d2d3802f3d20184f2b280d5 lib/core/agent.py
31-
44ac129c1b3b6130b4f1bc7b93036278 lib/core/bigarray.py
32-
981783b71439d82e84b47fb9b9a88164 lib/core/common.py
31+
a932126e7d80e545c5d44af178d0bc0c lib/core/bigarray.py
32+
39860dfb1d1afa51b7ed9d4ddfdb82cd lib/core/common.py
3333
de8d27ae6241163ff9e97aa9e7c51a18 lib/core/convert.py
3434
abcb1121eb56d3401839d14e8ed06b6e lib/core/data.py
3535
db60c6ebb63b72ed119e304b359fc1a6 lib/core/datatype.py
@@ -49,7 +49,7 @@ fe370021c6bc99daf44b2bfc0d1effb3 lib/core/patch.py
4949
7d8a22c582ad201f65b73225e4456170 lib/core/replication.py
5050
3179d34f371e0295dd4604568fb30bcd lib/core/revision.py
5151
d6269c55789f78cf707e09a0f5b45443 lib/core/session.py
52-
9adcbe4eb038933aa8f9ef13f288dde6 lib/core/settings.py
52+
10790114fe549cd3e2eaf035e2594c95 lib/core/settings.py
5353
4483b4a5b601d8f1c4281071dff21ecc lib/core/shell.py
5454
10fd19b0716ed261e6d04f311f6f527c lib/core/subprocessng.py
5555
9c7b5c6397fb3da33e7a4d7876d159c6 lib/core/target.py
@@ -85,7 +85,7 @@ ac482ec52227daf48f523827dd67078f lib/request/pkihandler.py
8585
eafa28e4beb2b7492dfc8036033ac824 lib/takeover/abstraction.py
8686
ac9efea51eba120b667b4b73536d7f1c lib/takeover/icmpsh.py
8787
fb6be55d21a70765e35549af2484f762 lib/takeover/__init__.py
88-
838002e763b071ed6dc334cabf4fffd9 lib/takeover/metasploit.py
88+
d55029a4c048e345fbb07a8f91604d83 lib/takeover/metasploit.py
8989
6b5b841d445b7b973c2e033edfb01b16 lib/takeover/registry.py
9090
ad038ac567f97a4b940b7987792d64a4 lib/takeover/udf.py
9191
915a3fbd557fb136bd0e16c46d993be3 lib/takeover/web.py
@@ -94,12 +94,12 @@ ad038ac567f97a4b940b7987792d64a4 lib/takeover/udf.py
9494
fb6be55d21a70765e35549af2484f762 lib/techniques/blind/__init__.py
9595
fb6be55d21a70765e35549af2484f762 lib/techniques/dns/__init__.py
9696
ea48db4c48276d7d0e71aa467c0c523f lib/techniques/dns/test.py
97-
437786cd2f9c3237614e3cac0220b2a6 lib/techniques/dns/use.py
97+
13a80dfa26c53246d4a353c11c082d5d lib/techniques/dns/use.py
9898
fb6be55d21a70765e35549af2484f762 lib/techniques/error/__init__.py
99-
2c945522ce05c2a1204d1563ae64eff2 lib/techniques/error/use.py
99+
62d64b853bbc9353843376fff3a7f48d lib/techniques/error/use.py
100100
fb6be55d21a70765e35549af2484f762 lib/techniques/__init__.py
101101
fb6be55d21a70765e35549af2484f762 lib/techniques/union/__init__.py
102-
baa3946c23749d898f473dba0f4eecff lib/techniques/union/test.py
102+
9d9a6148f10693aaab5fac1273d981d4 lib/techniques/union/test.py
103103
d32988e13713417286ab83a00856858e lib/techniques/union/use.py
104104
78cd3133349e9cfdcc6b3512c7d5ce36 lib/utils/api.py
105105
544dee96e782560fe4355cbf6ee19b8c lib/utils/brute.py
@@ -112,13 +112,13 @@ d11f7f208ccf3a7753ccc417b4b01901 lib/utils/hashdb.py
112112
17009289bb5c0dc0cceaa483113101e1 lib/utils/htmlentities.py
113113
fb6be55d21a70765e35549af2484f762 lib/utils/__init__.py
114114
833b05c72c9fa60b0a25b0a26f8f31fb lib/utils/pivotdumptable.py
115-
5a8902fd6fa94ea73cf44952f9ed5a57 lib/utils/progress.py
115+
25bbebf0178b106e83ca5e95b51b43f6 lib/utils/progress.py
116116
b79654e49850937ab2dc8e0d73625cab lib/utils/purge.py
117117
503637fbdabaad5bc7f87dfcfbea4dd3 lib/utils/search.py
118118
272a538a3d36186113191f4c543bb34b lib/utils/sqlalchemy.py
119119
68f90f633d812ca428d2f15f016b2d96 lib/utils/timeout.py
120120
164f830baad3e13b226ee57d44d69dfa lib/utils/versioncheck.py
121-
1e5d24f1c629476bdf43363d2c8d8397 lib/utils/xrange.py
121+
a5007113e3cda726e1d131b99b927284 lib/utils/xrange.py
122122
b8656f4785d0945e68257107a171f945 plugins/dbms/access/connector.py
123123
b0e4f4aed8504f97d4044620d3a7d27d plugins/dbms/access/enumeration.py
124124
58d664d680087596965f95b482157320 plugins/dbms/access/filesystem.py

0 commit comments

Comments
 (0)