我已经使用pyarmor对代码进行了模糊处理,并通过python函数返回了代码,在运行python文件时,我可以在其中运行经过混淆的代码。
# the obfuscated code returned from function to 'msg'
msg = testExtract.getobfcode()
# value returned
# from pytransform import pyarmor_runtime
# pyarmor_runtime()
# __pyarmor__(__name__, __file__, b'\x50\x59\x41...x27', 1) #value is truncated
我尝试使用 os.system 在cmd中运行
os.system('cmd/c "msg"')
还尝试使用 exec 运行,因为代码以字符串形式传递
def execute():
code = msg
exec(code)
execute()
两种方法均无效。如何通过py文件运行这些混淆的代码?