cloaked upx for windows (used mkstemp because of execution and file access rights problem)

This commit is contained in:
Miroslav Stampar
2010-01-29 10:12:09 +00:00
parent 200518724c
commit 92817159dc
5 changed files with 25 additions and 1 deletions

View File

@@ -34,6 +34,7 @@ import ntpath
import posixpath
from tempfile import NamedTemporaryFile
from tempfile import mkstemp
from extra.cloak.cloak import decloak
from lib.contrib import magic
@@ -885,3 +886,10 @@ def decloakToNamedTemporaryFile(filepath, name=None):
retVal.old_name = retVal.name
retVal.name = name
return retVal
def decloakToMkstemp(filepath, **kwargs):
name = mkstemp(**kwargs)[1]
retVal = open(name, 'w+b')
retVal.write(decloak(filepath))
retVal.seek(0)
return retVal