Moving bz2 into the cloak functions itself as it's not available by default in custom built Python installations (if not pre-installed libbz2-dev)

This commit is contained in:
Miroslav Stampar 2013-07-13 11:50:03 +02:00
parent dc1623a40f
commit 89d8512edc

5
extra/cloak/cloak.py Normal file → Executable file
View File

@ -7,7 +7,6 @@ Copyright (c) 2006-2013 sqlmap developers (http://sqlmap.org/)
See the file 'doc/COPYING' for copying permission
"""
import bz2
import os
import sys
@ -25,6 +24,8 @@ def hideAscii(data):
return retVal
def cloak(inputFile):
import bz2
f = open(inputFile, 'rb')
data = bz2.compress(f.read())
f.close()
@ -32,6 +33,8 @@ def cloak(inputFile):
return hideAscii(data)
def decloak(inputFile):
import bz2
f = open(inputFile, 'rb')
try:
data = bz2.decompress(hideAscii(f.read()))