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 See the file 'doc/COPYING' for copying permission
""" """
import bz2
import os import os
import sys import sys
@ -25,6 +24,8 @@ def hideAscii(data):
return retVal return retVal
def cloak(inputFile): def cloak(inputFile):
import bz2
f = open(inputFile, 'rb') f = open(inputFile, 'rb')
data = bz2.compress(f.read()) data = bz2.compress(f.read())
f.close() f.close()
@ -32,6 +33,8 @@ def cloak(inputFile):
return hideAscii(data) return hideAscii(data)
def decloak(inputFile): def decloak(inputFile):
import bz2
f = open(inputFile, 'rb') f = open(inputFile, 'rb')
try: try:
data = bz2.decompress(hideAscii(f.read())) data = bz2.decompress(hideAscii(f.read()))