mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-04-27 12:23:46 +03:00
i was on some heavy drugs (sys.stdout = fpOut)
This commit is contained in:
parent
0387654166
commit
a883316e22
|
@ -35,7 +35,12 @@ def cloak(inputFile):
|
||||||
|
|
||||||
def decloak(inputFile):
|
def decloak(inputFile):
|
||||||
f = open(inputFile, 'rb')
|
f = open(inputFile, 'rb')
|
||||||
|
try:
|
||||||
data = bz2.decompress(hideAscii(f.read()))
|
data = bz2.decompress(hideAscii(f.read()))
|
||||||
|
except:
|
||||||
|
print 'ERROR: the provided input file \'%s\' does not contain valid cloaked content' % inputFile
|
||||||
|
sys.exit(1)
|
||||||
|
finally:
|
||||||
f.close()
|
f.close()
|
||||||
|
|
||||||
return data
|
return data
|
||||||
|
@ -58,7 +63,7 @@ def main():
|
||||||
parser.error(e)
|
parser.error(e)
|
||||||
|
|
||||||
if not os.path.isfile(args.inputFile):
|
if not os.path.isfile(args.inputFile):
|
||||||
print 'ERROR: the provided input file \'%s\' is not a regular file' % args.inputFile
|
print 'ERROR: the provided input file \'%s\' is non existent' % args.inputFile
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
if not args.decrypt:
|
if not args.decrypt:
|
||||||
|
@ -72,10 +77,9 @@ def main():
|
||||||
else:
|
else:
|
||||||
args.outputFile = args.inputFile[:-1]
|
args.outputFile = args.inputFile[:-1]
|
||||||
|
|
||||||
fpOut = open(args.outputFile, 'wb')
|
f = open(args.outputFile, 'wb')
|
||||||
sys.stdout = fpOut
|
f.write(data)
|
||||||
sys.stdout.write(data)
|
f.close()
|
||||||
sys.stdout.close()
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
main()
|
main()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user