我正在尝试将脚本解码或解密到内存(RAM)中并运行它。(我的代码已加密或解码了 {该代码属于可执行文件} )
这些python代码是在Windows编译后运行的
Encoded:
import base64
outF=open("client2-enc.pyc","r")
my_file = open("client2.py","r+")
line = outF.read()
#encoded = (base64.b64encode(line.encode('ascii')))
decoded=base64.b64decode("Encrypted code")
exec(str(decoded))# in this situation only I can run python file but my file is exe
-----------------------------------------------------------
encrypted:
import pyAesCrypt,os
# encryption/decryption buffer size - 64K
bufferSize = 64 * 1024
password = "12345"
# encrypt
#pyAesCrypt.encryptFile("test.exe", "test.aes", password, bufferSize)
# decrypt
pyAesCrypt.decryptFile("test.aes", "test.exe", password, bufferSize)
os.system("test.exe")#in this situation it runs the test.exe file that created in hard but I want it to decrypt in memory and run