-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProduct Key File Finder v3
49 lines (49 loc) · 1.32 KB
/
Product Key File Finder v3
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
49
import glob, os, shutil, string
rs = ['%s://' % d for d in string.ascii_uppercase if os.path.exists('%s://' % d)]
print(rs);
print(len(rs));
print('Execute: 10% Local Drive search complete')
i = 0
j = 0
rss=[]
ff = 'Product Key'
print('Execute: 20%')
directory = "rrs"
file_name = "rrs.txt"
print('Execute: 30% Hidden folder named rss is created in second local drive from list')
path = os.path.join(rs[1], directory)
os.mkdir(path)
print('Hidden folder path: ',path)
print('Execute: 40% Hidden file text.txt is created in hidden folder rss')
CN = os.path.join(path, file_name)
print('Hidden file location: ',CN)
file1 = open(CN, "a")
file1.close()
pp = CN
print('Execute: 40% below files are present in system')
while i != len(rs):
os.chdir(rs[i])
for file in glob.glob("**/*.txt", recursive = True):
if ff in file:
print(file)
completeName = os.path.join(rs[i], file)
print('File path: ',completeName)
f = open(completeName,'r')
print(f.read())
f.close()
rss.append(completeName)
i += 1
print('Execute: 100% showing result')
print('scan done')
print(rss)
while j != len(rss):
with open(rss[j]) as trs, open(pp, "a") as rrs:
for line in trs:
rrs.write(line.rstrip("\n") +'\t'+rss[j]+"\n")
#shutil.copy(rss[j],pp)
f = open(pp,'r')
print(f.read())
f.close()
j+=1
f = open(pp,'r')
print(f.read())