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

Skip to content

Commit 8a8dc73

Browse files
committed
more fixes
1 parent 1d15c59 commit 8a8dc73

2 files changed

Lines changed: 6 additions & 16 deletions

File tree

extra/cloak/__init__.py

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

33
"""
4-
$Id: $
4+
$Id$
55
66
This file is part of the sqlmap project, http://sqlmap.sourceforge.net.
77

extra/cloak/cloak.py

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

33
"""
4-
cloak.py - Simple file encryption and/or compression utility
4+
cloak.py - Simple file encryption/compression utility
55
Copyright (C) 2010 Miroslav Stampar, Bernardo Damele A. G.
66
77
@@ -20,9 +20,9 @@
2020
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
2121
"""
2222

23+
import bz2
2324
import os
2425
import sys
25-
import bz2
2626

2727
from optparse import OptionError
2828
from optparse import OptionParser
@@ -38,25 +38,17 @@ def hideAscii(data):
3838
return retVal
3939

4040
def cloak(inputFile):
41-
retVal = ""
42-
4341
f = open(inputFile, 'rb')
44-
original = f.read()
42+
data = bz2.compress(f.read())
4543
f.close()
4644

47-
data = bz2.compress(original)
48-
4945
return hideAscii(data)
5046

5147
def decloak(inputFile):
52-
retVal = ""
53-
5448
f = open(inputFile, 'rb')
55-
original = f.read()
49+
data = bz2.decompress(hideAscii(f.read()))
5650
f.close()
5751

58-
data = bz2.decompress(hideAscii(original))
59-
6052
return data
6153

6254
def main():
@@ -76,9 +68,7 @@ def main():
7668
except (OptionError, TypeError), e:
7769
parser.error(e)
7870

79-
if args.inputFile == '*':
80-
pass
81-
elif not os.path.isfile(args.inputFile):
71+
if not os.path.isfile(args.inputFile):
8272
print 'ERROR: the provided input file \'%s\' is not a regular file' % args.inputFile
8373
sys.exit(1)
8474

0 commit comments

Comments
 (0)