I'm developing a small python script to take a base64 encoded zip, decode it, and run an EXE that's inside the zip only in RAM (so no disk writing). This is what I have so far if it makes sense, except I'm getting an issue with subprocess. How can I accomplish running this in RAM? Any help is appreciated!
from StringIO import StringIO
import base64
import zipfile
import subprocess
base64zipped = base64NonsenseHere
zippass = "thisisjustforme123"
zipdata = StringIO()
zipdata.write(base64.decodestring(base64zipped))
myzipfile = zipfile.ZipFile(zipdata)
myzipfile.setpassword(zippass)
subprocess.Popen(myzipfile.open('Application 1.exe'))
Error:
Traceback (most recent call last):
File "C:\Users\user\Desktop\DD\Main.py", line 780, in <module>
subprocess.Popen(myzipfile.open('Application 1.exe'))
File "C:\Python27\lib\subprocess.py", line 679, in __init__
errread, errwrite)
File "C:\Python27\lib\subprocess.py", line 896, in _execute_child
startupinfo)
TypeError: must be string without null bytes or None, not str
>>>