cleaning a mess with UPX and virus scanners

This commit is contained in:
Miroslav Stampar 2011-04-19 21:57:04 +00:00
parent 44bbef42f8
commit 9a9838f1e6
5 changed files with 9 additions and 8 deletions

Binary file not shown.

BIN
lib/contrib/upx/linux/upx_ Normal file

Binary file not shown.

Binary file not shown.

BIN
lib/contrib/upx/macosx/upx_ Normal file

Binary file not shown.

View File

@ -33,22 +33,23 @@ class UPX:
def __initialize(self, srcFile, dstFile=None):
if PLATFORM == "mac":
self.__upxPath = "%s/upx/macosx/upx" % paths.SQLMAP_CONTRIB_PATH
self.__upxTemp = decloakToMkstemp("%s/upx/macosx/upx_" % paths.SQLMAP_CONTRIB_PATH)
elif PLATFORM in ( "ce", "nt" ):
self.__upxTempExe = decloakToMkstemp("%s\upx\windows\upx.exe_" % paths.SQLMAP_CONTRIB_PATH, suffix=".exe")
self.__upxPath = self.__upxTempExe.name
self.__upxTempExe.close() #needed for execution rights
self.__upxTemp = decloakToMkstemp("%s\upx\windows\upx.exe_" % paths.SQLMAP_CONTRIB_PATH, suffix=".exe")
elif PLATFORM == "posix":
self.__upxPath = "%s/upx/linux/upx" % paths.SQLMAP_CONTRIB_PATH
self.__upxTemp = decloakToMkstemp("%s/upx/linux/upx_" % paths.SQLMAP_CONTRIB_PATH)
else:
warnMsg = "unsupported platform for the compression tool "
warnMsg += "(upx), sqlmap will continue anyway"
logger.warn(warnMsg)
self.__upxPath = "%s/upx/linux/upx" % paths.SQLMAP_CONTRIB_PATH
self.__upxTemp = decloakToMkstemp("%s/upx/linux/upx_" % paths.SQLMAP_CONTRIB_PATH)
self.__upxPath = self.__upxTemp.name
self.__upxTemp.close() #needed for execution rights
self.__upxCmd = "%s -9 -qq %s" % (self.__upxPath, srcFile)
@ -65,8 +66,8 @@ class UPX:
pollProcess(process)
upxStdout, upxStderr = process.communicate()
if hasattr(self, '__upxTempExe'):
os.remove(self.__upxTempExe.name)
if hasattr(self, '__upxTemp'):
os.remove(self.__upxTemp.name)
msg = "failed to compress the file"