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

Skip to content

Commit 9b72545

Browse files
committed
Some more DREI stuff
1 parent 4b020c4 commit 9b72545

76 files changed

Lines changed: 95 additions & 258 deletions

Some content is hidden

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

extra/beep/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python2
1+
#!/usr/bin/env python
22

33
"""
44
Copyright (c) 2006-2019 sqlmap developers (http://sqlmap.org/)

extra/beep/beep.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python2
1+
#!/usr/bin/env python
22

33
"""
44
beep.py - Make a beep sound
@@ -8,19 +8,18 @@
88
"""
99

1010
import os
11-
import subprocess
1211
import sys
1312
import wave
1413

1514
BEEP_WAV_FILENAME = os.path.join(os.path.dirname(__file__), "beep.wav")
1615

1716
def beep():
1817
try:
19-
if subprocess.mswindows:
18+
if sys.platform == "nt":
2019
_win_wav_play(BEEP_WAV_FILENAME)
2120
elif sys.platform == "darwin":
2221
_mac_beep()
23-
elif sys.platform == "linux2":
22+
elif sys.platform.startswith("linux"):
2423
_linux_wav_play(BEEP_WAV_FILENAME)
2524
else:
2625
_speaker_beep()

extra/cloak/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python2
1+
#!/usr/bin/env python
22

33
"""
44
Copyright (c) 2006-2019 sqlmap developers (http://sqlmap.org/)

extra/cloak/cloak.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python2
1+
#!/usr/bin/env python
22

33
"""
44
cloak.py - Simple file encryption/compression utility
@@ -10,6 +10,7 @@
1010
from __future__ import print_function
1111

1212
import os
13+
import struct
1314
import sys
1415
import zlib
1516

@@ -20,12 +21,10 @@
2021
xrange = range
2122

2223
def hideAscii(data):
23-
retVal = ""
24+
retVal = b""
2425
for i in xrange(len(data)):
25-
if ord(data[i]) < 128:
26-
retVal += chr(ord(data[i]) ^ 127)
27-
else:
28-
retVal += data[i]
26+
value = data[i] if isinstance(data[i], int) else ord(data[i])
27+
retVal += struct.pack('B', value ^ (127 if value < 128 else 0))
2928

3029
return retVal
3130

@@ -42,7 +41,8 @@ def decloak(inputFile=None, data=None):
4241
data = f.read()
4342
try:
4443
data = zlib.decompress(hideAscii(data))
45-
except:
44+
except Exception as ex:
45+
print(ex)
4646
print('ERROR: the provided input file \'%s\' does not contain valid cloaked content' % inputFile)
4747
sys.exit(1)
4848
finally:

extra/dbgtool/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python2
1+
#!/usr/bin/env python
22

33
"""
44
Copyright (c) 2006-2019 sqlmap developers (http://sqlmap.org/)

extra/dbgtool/dbgtool.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python2
1+
#!/usr/bin/env python
22

33
"""
44
dbgtool.py - Portable executable to ASCII debug script converter
@@ -34,7 +34,7 @@ def convert(inputFile):
3434
fileContent = fp.read()
3535

3636
for fileChar in fileContent:
37-
unsignedFileChar = struct.unpack("B", fileChar)[0]
37+
unsignedFileChar = fileChar if sys.version_info.major > 2 else ord(fileChar)
3838

3939
if unsignedFileChar != 0:
4040
counter2 += 1

extra/shutils/duplicates.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python2
1+
#!/usr/bin/env python
22

33
# Copyright (c) 2006-2019 sqlmap developers (http://sqlmap.org/)
44
# See the file 'LICENSE' for copying permission
@@ -10,7 +10,7 @@
1010
import sys
1111

1212
if __name__ == "__main__":
13-
if len(sys.argv) > 0:
13+
if len(sys.argv) > 1:
1414
items = list()
1515

1616
with open(sys.argv[1], 'r') as f:

extra/shutils/newlines.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
#! /usr/bin/env python2
2-
3-
# Runs pylint on all python scripts found in a directory tree
4-
# Reference: http://rowinggolfer.blogspot.com/2009/08/pylint-recursively.html
1+
#! /usr/bin/env python
52

63
from __future__ import print_function
74

@@ -11,9 +8,10 @@
118
def check(filepath):
129
if filepath.endswith(".py"):
1310
content = open(filepath, "rb").read()
11+
pattern = "\n\n\n".encode("ascii")
1412

15-
if "\n\n\n" in content:
16-
index = content.find("\n\n\n")
13+
if pattern in content:
14+
index = content.find(pattern)
1715
print(filepath, repr(content[index - 30:index + 30]))
1816

1917
if __name__ == "__main__":

extra/shutils/pylint.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#! /usr/bin/env python2
1+
#! /usr/bin/env python
22

33
# Runs pylint on all python scripts found in a directory tree
44
# Reference: http://rowinggolfer.blogspot.com/2009/08/pylint-recursively.html

extra/shutils/regressiontest.py

Lines changed: 0 additions & 166 deletions
This file was deleted.

0 commit comments

Comments
 (0)