Facebook
From Sharp Agouti, 1 Year ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 85
  1. from threading import *
  2. from tkinter import *
  3. from tkinter.filedialog import askopenfilename
  4. from tkinter.messagebox import showerror
  5. import tkinter
  6. import tkinter.scrolledtext
  7. import threading
  8. import os
  9. import sys
  10. import urllib.request
  11. import glob
  12. import time
  13. import hashlib
  14. import socket
  15. import subprocess
  16. # self-made
  17. import quarantaene
  18. import SystemFileScanner
  19.  
  20. from tkinter import END
  21.  
  22.  
  23. os_name = sys.platform
  24. verzeichnisse = []
  25. files = []
  26. partitionen = []
  27. terminations = []
  28.  
  29. #if we are using Windows OS, th file paths will be using backlask,
  30. #but if we are using MAC/Unix OS, the file paths will be using forward slash.
  31. if "win" in os_name:  # gives info on OS
  32.     if not os.path.exists("AntiVirus\\Quarantine\\"):
  33.         os.makedirs("AntiVirus\\Quarantine\\")
  34.     if not os.path.exists("AntiVirus\\sf\\"):
  35.         os.makedirs("AntiVirus\\sf\\")
  36.     if not os.path.exists("AntiVirus\\Large_Update_File\\"):
  37.         os.makedirs("AntiVirus\\Large_Update_File")
  38.  
  39.     quarantine_folder = "AntiVirus\\Quarantine\\*"
  40.     file_to_quarantine = "AntiVirus\\Quarantine\\"
  41.     partitionen_folder = "AntiVirus\\sf\\sf.txt"
  42.     links_current = "AntiVirus\\Large_Update_File\\links_current.txt"
  43.     links_downloaded = "AntiVirus\\Large_Update_File\\links_downloaded.txt"
  44.     large_signatures = "AntiVirus\\Large_Update_File\\signatures.txt"
  45.     f = open(partitionen_folder, "a")
  46.     f.close()
  47.     f = open(links_current, "a")
  48.     f.close()
  49.     f = open(links_downloaded, "a")
  50.     f.close()
  51.     f = open(large_signatures, "a")
  52.     f.close()
  53. else:  #In case user is using MAC/Unix OS
  54.  
  55.     if not os.path.exists("AntiVirus//Quarantine//"):
  56.         os.makedirs("AntiVirus//Quarantine//")
  57.     if not os.path.exists("AntiVirus//sf//"):
  58.         os.makedirs("AntiVirus//sf//")
  59.     if not os.path.exists("AntiVirus//Large_Update_File//"):
  60.         os.makedirs("AntiVirus//Large_Update_File//")
  61.  
  62.     quarantine_folder = "AntiVirus//Quarantine//*"
  63.     file_to_quarantine = "AntiVirus//Quarantine//"
  64.     partitionen_folder = "AntiVirus//sf//sf.txt"
  65.     links_current = "AntiVirus//Large_Update_File//links_current.txt"
  66.     links_downloaded = "AntiVirus//Large_Update_File//links_downloaded.txt"
  67.     large_signatures = "AntiVirus//arge_Update_File//signatures.txt"
  68.     f = open(partitionen_folder, "a")
  69.     f.close()
  70.     f = open(links_current, "a")
  71.     f.close()
  72.     f = open(links_downloaded, "a")
  73.     f.close()
  74.     f = open(large_signatures, "a")
  75.     f.close()
  76.  
  77. files_len = counter = 0
  78. main = None
  79. update_button = None
  80. scan_button = None
  81. fullscan_button = None
  82. quit_button = None
  83. b_delete = None
  84. b_delete_all = None
  85. b_restore = None
  86. b_restore_all = None
  87. b_add_file = None
  88. text_box = None
  89. e = None
  90. li = None
  91. rb1 = None
  92. rb2 = None
  93. method = None
  94. bgc = None
  95. fgc = None
  96. special = None
  97. special_text = None
  98. t_time = None
  99.  
  100.  
  101. # def clock_thread():
  102. #     global e
  103. #     months = ["January", "February", "March", "April", "May", "June", "Juli", "August",
  104. #               "September", "October", "November", "December"]
  105. #     while True:
  106. #        string_time = "%H:%M:%S o'clock, on %d.{0}.%Y"
  107. #        month_name = time.strftime("%B", time.localtime())
  108. #        for i in range(len(months)):
  109. #           if (months.index(month_name)) < 10:
  110. #              month_name = "0" + month_name
  111. #              break
  112. #        string_time = string_time.format(month_name)
  113. #        current_time = time.strftime(string_time, time.localtime())
  114. #        e.delete(0, len(e.get()))
  115. #        e.update()
  116. #        e.insert(0, current_time)
  117. #        e.update()
  118. #        time.sleep(1)
  119.  
  120.  
  121. def ScanSystemFiles():
  122.     global files
  123.     global text_box
  124.     global files_len
  125.     text_box.insert(END, "[ * ] Scanning system for files...\n")
  126.     text_box.see(END)
  127.     text_box.update()
  128.     time.sleep(3)
  129.     text_box.see(END)
  130.     text_box.update()
  131.     # SystemFileScanner.partitions(partitionen_folder)
  132.     f = open(partitionen_folder, "r")
  133.     content = f.read()
  134.     f.close()
  135.     content = content.splitlines()
  136.     files = content
  137.     files_len = len(files)
  138.     text_box.insert(END, "[ + ] System successfully prepared\n", 'positive')
  139.     text_box.tag_config("positive", foreground="green")
  140.     text_box.see(END)
  141.     text_box.update()
  142.  
  143.  
  144. def full_scan(part):
  145.     global verzeichnisse
  146.     global files
  147.     global text_box
  148.     global e
  149.     global full_scan
  150.     global files_len
  151.     global lock
  152.     global t_time
  153.     global counter
  154.     start = time.time()
  155.     if part == 1:  # Thread-1
  156.       i = int(len(files)*0.125)
  157.     tmp = 0
  158.     if part == 2:  # Thread-2
  159.       i = int(len(files)*0.25)
  160.     tmp = int(len(files)*0.125)
  161.     if part == 3:  # Thread-3
  162.       i = int(len(files)*0.375)
  163.     tmp = int(len(files)*0.25)
  164.     if part == 4:  # Thread-4
  165.       i = int(len(files)*0.5)
  166.       tmp = int(len(files)*0.375)
  167.     if part == 5:  # Thread-5
  168.       i = int(len(files)*0.625)
  169.       tmp = int(len(files)*0.5)
  170.     if part == 6:  # Thread-6
  171.       i = int(len(files)*0.75)
  172.       tmp = int(len(files)*0.625)
  173.     if part == 7:  # Thread-7
  174.       i = int(len(files)*0.875)
  175.       tmp = int(len(files)*0.75)
  176.     if part == 8:  # Thread-8
  177.       i = int(len(files))
  178.       tmp = int(len(files)*0.875)
  179.     if len(files) == 0:
  180.       return ScanSystemFiles()
  181.    
  182.     text_box.tag_config('positive', foreground="green")
  183.     text_box.see(END)
  184.     text_box.update()
  185.     counter = 0
  186.     st = 0
  187.     while i >= tmp:
  188.       try:
  189.          f = open(files[i], "rb")
  190.          file_content = f.read()
  191.          f.close()
  192.       except:
  193.         continue
  194.    
  195.     ret = scan_auto(files[i])
  196.     if ret == True:
  197.         text_box.insert(END, "[ ! ] Program: " + files[i] +
  198.                     " might be dangerous\n", "important")
  199.         text_box.tag_config("important", foreground="red")
  200.         text_box.see(END)
  201.         text_box.update()
  202.         quarantaene.encode_base64(files[i])
  203.         files_len -= 1
  204.         i -= 1
  205.         runtime = int(time.time() - start)
  206.         text_box.insert(END, "[ + ] Scan ended after\n " +
  207.                     str(runtime/60) + " minutes.\n", "positive")
  208.         text_box.tag_config("positive", foreground="green")
  209.     if files_len == 0:
  210.        full_scan["state"] = "normal"
  211.     if len(terminations) == 0:
  212.        text_box.insert(END, "[ +++ ] Your PC is safe" + "\n", 'important')
  213.     else:
  214.        text_box.insert(
  215.         END, "[ !!! ] Found {0} Threats on your PC\n".format(len(terminations)))
  216.     text_box.tag_config("important", background="red")
  217.     text_box.see(END)
  218.     text_box.update()
  219.  
  220.  
  221. def quarantine():
  222.     global text_box
  223.     global terminations
  224.     global li
  225.     global b_delete
  226.     global b_delete_all
  227.     global b_restore
  228.     global b_restore_all
  229.     global b_add_file
  230.     k = 0
  231.     while True:
  232.       tmp = len(li.get(k))
  233.       if tmp == 0:
  234.         break
  235.       else:
  236.        li.delete(0, tmp)
  237.        k += 1
  238.        li.update()
  239.        terminations = glob.glob(quarantine_folder)
  240.        if terminations == []:
  241.         text_box.insert(END, "[ + ] No files in quarantine\n", "positive")
  242.         text_box.tag_config('positive', foreground="green")
  243.         text_box.see(END)
  244.         text_box.update()
  245.        else:
  246.         text_box.insert(END, "[ + ] Files in quarantine:\n", "positive")
  247.         text_box.tag_config('positive', foreground="green")
  248.         text_box.see(END)
  249.         text_box.update()
  250.       for i in terminations:
  251.         text_box.insert(END, "[ * ] " + i + "\n", "info")
  252.         text_box.tag_config("info", background="red")
  253.         text_box.see(END)
  254.         text_box.update()
  255.         li.insert(END, i)
  256.         li.update()
  257.         b_delete_all["command"] = lambda: button_action_handler("delete_all")
  258.         b_delete["command"] = lambda: button_action_handler("delete")
  259.         b_restore["command"] = lambda: button_action_handler("restore")
  260.         b_restore_all["command"] = lambda: button_action_handler("restore_all")
  261.         b_add_file["command"] = lambda: button_action_handler("add_file")
  262.  
  263.  
  264. def delete(file, ALL):  # ALL = 1 => deletes all objects in quarantine
  265.     global li
  266.     global text_box
  267.     global terminations
  268.     if len(terminations) != 0:
  269.       if ALL == 1:
  270.         for i in range(len(terminations)):
  271.           os.remove(terminations[i])
  272.           text_box.insert(END, "[ + ] Deletion successful: \n" + terminations[i] + "\n",
  273.                     "positive")
  274.           text_box.tag_config("positive", foreground="green")
  275.           text_box.see(END)
  276.           text_box.update()
  277.           li.delete(0, len(terminations[i]))
  278.           li.update()
  279.       elif ALL == 0:
  280.          os.remove(file)
  281.          li.delete(ACTIVE, len(file))
  282.          li.update()
  283.          text_box.insert(END, "[ + ] Deletion successful:\n" +
  284.                     file + "\n", "positive")
  285.          text_box.tag_config("positive", foreground="green")
  286.          text_box.see(END)
  287.          text_box.update()
  288.          terminations = glob.glob(quarantine_folder)
  289.          for i in terminations:
  290.           li.insert(END, i)
  291.           li.update()
  292.       else:
  293.          text_box.insert(END, "[ - ] Unable to locate any files\n", "negative")
  294.          text_box.tag_config("negative", foreground="red")
  295.          text_box.see(END)
  296.          text_box.update()
  297.  
  298.  
  299. def restore(file, ALL):
  300.     global li
  301.     global text_box
  302.     global terminations
  303.     if len(terminations) != 0:
  304.        if ALL == 1:
  305.           for i in range(len(terminations)):
  306.              quarantaene.decode_base64(terminations[i])
  307.              text_box.insert(END, "[ + ] Successfully restored\n" +
  308.                     terminations[i] + "\n", 'positive')
  309.              text_box.tag_config('positive', foreground="green")
  310.              text_box.see(END)
  311.              text_box.update()
  312.              li.delete(0, len(terminations[i]))
  313.              li.update()
  314.        elif ALL == 0:
  315.              quarantaene.decode_base64(file)
  316.              li.delete(ACTIVE, len(file))
  317.              text_box.insert(
  318.                 END, "[ + ] Successfully restored\n" + file + "\n", "positive")
  319.              text_box.tag_config("positive", foreground="green")
  320.              text_box.see(END)
  321.              text_box.update()
  322.              terminations = glob.glob(quarantine_folder)
  323.              for i in terminations:
  324.                  li.insert(END, i)
  325.                  li.update()
  326.        else:
  327.               text_box.insert(END, "[ - ] Unable to locate any files\n", "negative")
  328.               text_box.tag_config("negative", foreground="red")
  329.               text_box.see(END)
  330.               text_box.update()
  331.  
  332.  
  333. def add_file_to_quarantine():
  334.     global li
  335.     global terminations
  336.     file = askopenfilename()
  337.     file = file.replace("/", "\\")
  338.     quarantaene.encode_base64(file, file_to_quarantine)
  339.     text_box.insert(END, "[ + ] Moved to quarantine:\n" +
  340.                     file + "\n", "positive")
  341.     text_box.tag_config("positive", foreground="green")
  342.     text_box.see(END)
  343.     text_box.update()
  344.     li.update()
  345.     k = 0
  346.     while True:
  347.        tmp = len(li.get(k))
  348.        if tmp == 0:
  349.          break
  350.        else:
  351.          li.delete(0, tmp)
  352.          k += 1
  353.          li.update()
  354.          terminations = glob.glob(quarantine_folder)
  355.          for i in terminations:
  356.             li.insert(END, i)
  357.             li.update()
  358.  
  359.  
  360. def scan_auto(file):
  361.     time.sleep(3)
  362.     try:
  363.         f = open(file, "rb")
  364.         content = f.read()
  365.         f.close()
  366.         content = create_md5(content)
  367.     except MemoryError:
  368.         f.close()
  369.         return False
  370.     except:
  371.        f.close()
  372.        return False
  373.     signatures = open(large_signatures, "rb")
  374.  
  375.     try:
  376.        if content in signatures.read():  # fastest solution
  377.          signatures.close()
  378.          return True
  379.        else:
  380.          signatures.close()
  381.          return False
  382.     except MemoryError:
  383.       try:
  384.         signatures.close()
  385.         signatures = open(large_signatures, "rb")
  386.         if content in signatures.readlines():  # again fast, but around 4 times slower than the fastest
  387.           signatures.close()
  388.           return True
  389.         else:
  390.          signatures.close()
  391.          return False
  392.       except MemoryError:
  393.         signatures.close()
  394.         signatures = open(large_signatures, "rb")
  395.         while True:  # slowest solution, but can read files sized over 2 GB
  396.            tmp = signatures.readline()
  397.            if tmp == b"":
  398.               signatures.close()
  399.               break
  400.            if tmp == content:
  401.              signatures.close()
  402.              return True
  403.            return False
  404.       except:
  405.           return False
  406.  
  407.  
  408. def scan():
  409.     global text_box
  410.     match = False
  411.     file = askopenfilename()
  412.     start = time.time()
  413.     text_box.insert(END, "[ * ] Scanning " + file + "\n")
  414.     text_box.see(END)
  415.     text_box.update()
  416.     try:
  417.       f = open(file, "rb")
  418.       content = f.read()
  419.       f.close()
  420.       content = create_md5(content)
  421.       text_box.insert(END, "MD5-Hash: " + content.decode("utf-8") + "\n")
  422.       text_box.see(END)
  423.       text_box.update()
  424.     except MemoryError:
  425.       text_box.insert(END, "[ - ] Unable to create MD5-Hash:\n----->MemoryError!\n",
  426.                     'negative')
  427.       text_box.insert(END, "[ ! ] Only select files under 1 GB\n", "negative")
  428.       text_box.tag_config('negative', foreground="red")
  429.       text_box.see(END)
  430.       text_box.update()
  431.       return None
  432.     except Exception as e:
  433.       text_box.insert(END, "[!] Unable to handle problem\n[!] Try again/file might be corrupted\n", "negative")
  434.       text_box.tag_config('negative', foreground="red")
  435.       text_box.see(END)
  436.       text_box.update()
  437.       return None
  438.     signatures = open(large_signatures, "rb")
  439.     # runtime of a scan varies from system to system(time on the systems tested: 1s <= t <= 20s)
  440.     try:
  441.       if content in signatures.read():  # fastest solution
  442.         signatures.close()
  443.         match = True
  444.       else:
  445.         match = False
  446.         signatures.close()
  447.     except MemoryError:
  448.       try:
  449.         signatures.close()
  450.         signatures = open(large_signatures, "rb")
  451.         if content in signatures.readlines():  # again fast, but around 4 times slower than the fastest
  452.           f.close()
  453.           match = True
  454.         else:
  455.           signatures.close()
  456.           match = False
  457.       except MemoryError:
  458.          signatures.close()
  459.          signatures = open(large_signatures, "rb")
  460.          while True:  # slowest solution, but can read files sized over 2 GB
  461.            tmp = signatures.readline()
  462.            if tmp == b"":
  463.              signatures.close()
  464.              break
  465.            if tmp == content:
  466.              match = True
  467.              signatures.close()
  468.       except:
  469.           text_box.insert(END, "[ - ] Something bad happened while performing the task\n",
  470.                     "negative")
  471.           text_box.tag_config("negative", foreground="red")
  472.           text_box.see(END)
  473.           text_box.update()
  474.           return None
  475.       text_box.insert(
  476.         END, "[ * ] Scan duration: {0}\n".format(round(time.time()-start, 2)))
  477.       text_box.see(END)
  478.       text_box.update()
  479.       if match:
  480.          quarantaene.encode_base64(file, file_to_quarantine)
  481.          text_box.insert(END, "[ ! ] Threat found: {0}\n[ ! ] File was moved into quarantine",
  482.                     "important")
  483.          text_box.tag_config("important", foreground="red")
  484.          text_box.see(END)
  485.          text_box.update()
  486.          if not match:
  487.            text_box.insert(END, "[ + ] No threat was found\n", "positive")
  488.            text_box.tag_config("positive", foreground="green")
  489.            text_box.see(END)
  490.            text_box.update()
  491.  
  492.  
  493. def create_md5(content):
  494.     md = hashlib.md5()
  495.     md.update(content)
  496.     return bytes(md.hexdigest(), "utf-8")
  497.  
  498.  
  499. def link_collector():  # gets Links to refresh update-site;short spider
  500.     global text_box
  501.     u_list = []
  502.     text_box.insert(END, "[ * ] Searching for update...\n")
  503.     text_box.see(END)
  504.     text_box.update()
  505.     u = urllib.request.urlopen(
  506.         "http://virusshare.com/hashes").read().decode("utf-8").splitlines()
  507.     f = open(links_current, "w")
  508.     for i in u:
  509.       if "href='" in i:
  510.          first = i.find("href='") + len("href='")
  511.          i = i[first:]
  512.          last = i.find("'")
  513.          i = i[:last]
  514.       if 'href="' in i:
  515.          first = i.find('href="') + len('href="')
  516.          i = i[first:]
  517.          last = i.find('"')
  518.          i = i[:last]
  519.       if "VirusShare" in i:
  520.          f.write("http://virusshare.com/hashes/" + i + "\n")
  521.          f.close()
  522.          return update()
  523.  
  524.  
  525. def update():
  526.     global text_box
  527.     zaehler = 0
  528.     f = open(links_current, "r")
  529.     f2 = open(links_downloaded, "r")
  530.     files_downloaded = f2.read()
  531.     f2.close()
  532.     f2 = open(links_downloaded, "r")
  533.     for i in f.read().splitlines():
  534.       f2 = open(links_downloaded, "r")
  535.       con = f2.read()
  536.       f2.close()
  537.       f2 = open(links_downloaded, "a")
  538.       if i not in con:
  539.         zaehler += 1
  540.         f2.write(i + "\n")
  541.         f2.close()
  542.         text_box.insert(END, "[ * ] Download of:\n"+i)
  543.         text_box.see(END)
  544.         text_box.update()
  545.         signatures = open(large_signatures, "a")
  546.         url = i
  547.         tmp = urllib.request.urlopen(url).read().decode("utf-8").splitlines()
  548.         for j in tmp:
  549.          if j[0] != '#':
  550.            signatures.write(j + "\n")
  551.            signatures.close()
  552.          if zaehler == 0:
  553.            text_box.insert(END, "[ * ] No new updates were found\n")
  554.            text_box.see(END)
  555.            text_box.update()
  556.          else:
  557.            text_box.insert(
  558.               END, "[ + ] {0} new updates were made\n".formate(zaehler), "positive")
  559.            text_box.tag_config("positive", foreground="green")
  560.            text_box.see(END)
  561.            text_box.update()
  562.  
  563.  
  564. def closing():
  565.     main.destroy()
  566.     sys.exit()
  567.  
  568.  
  569. def button_action_handler(s):
  570.     global files_len
  571.     global text_box
  572.     global t_time
  573.     global fullscan_button
  574.     global b_delete
  575.     global b_delete_all
  576.     global b_restore
  577.     global b_restore_all
  578.     global b_add_file
  579.     global li
  580.     global rb1
  581.     global rb2
  582.     global method
  583.     if s == "rb1":
  584.        method = 1
  585.        rb1.place_forget()
  586.        rb2.place_forget()
  587.     if s == "rb2":
  588.       method = 2
  589.       rb2.place_forget()
  590.       rb1.place_forget()
  591.     if s == "delete":
  592.       tb = Thread(target=delete, args=(li.get(ACTIVE), 0))
  593.       tb.start()
  594.     if s == "delete_all":
  595.       tb = Thread(target=delete, args=(0, 1))
  596.       tb.start()
  597.     if s == "restore":
  598.       tb = Thread(target=restore, args=(li.get(ACTIVE), 0))
  599.       tb.start()
  600.     if s == "restore_all":
  601.       tb = Thread(target=restore, args=(0, 1))
  602.       tb.start()
  603.     if s == "add_file":
  604.       tb = Thread(target=add_file_to_quarantine)
  605.       tb.start()
  606.     if s == "update_button":
  607.       tb = Thread(target=link_collector)
  608.       tb.start()
  609.     if s == "scan_button":
  610.       tb = Thread(target=scan)
  611.       tb.start()
  612.     if s == "fullscan_button":
  613.       if files_len == 0:
  614.         text_box.insert(END, "[ ! ] Preparing program\n", "important")
  615.         text_box.see(END)
  616.         text_box.update()
  617.       elif files_len < len(files):
  618.         text_box.insert(END, "[ ! ] One scan is already in action\n", "important")
  619.         text_box.see(END)
  620.         text_box.update()
  621.       else:
  622.         fullscan_button["state"] = "disabled"
  623.         t_time = time.time()
  624.         text_box.insert(END, "[ ! ] Got {0} files to scan\n".format(
  625.         files_len), 'important')
  626.         text_box.tag_config("important", foreground="red")
  627.         text_box.update()
  628.         text_box.insert(END, "[ * ] Scan might last for hours...\n")
  629.         text_box.see(END)
  630.         text_box.update()
  631.         tb1 = Thread(target=full_scan, args=(1,))
  632.         tb1.start()
  633.         time.sleep(1)
  634.         tb2 = Thread(target=full_scan, args=(2,))
  635.         tb2.start()
  636.         time.sleep(1)
  637.         tb3 = Thread(target=full_scan, args=(3,))
  638.         tb3.start()
  639.         time.sleep(1)
  640.         tb4 = Thread(target=full_scan, args=(4,))
  641.         tb4.start()
  642.         time.sleep(1)
  643.         tb5 = Thread(target=full_scan, args=(5,))
  644.         tb5.start()
  645.         time.sleep(1)
  646.         tb6 = Thread(target=full_scan, args=(6,))
  647.         tb6.start()
  648.         time.sleep(1)
  649.         tb7 = Thread(target=full_scan, args=(7,))
  650.         tb7.start()
  651.         time.sleep(1)
  652.         tb8 = Thread(target=full_scan, args=(8,))
  653.         tb8.start()
  654.     if s == "quarantine_button":
  655.        if li.winfo_viewable() == 0:
  656.         b_delete.place(x=570, y=70)
  657.         b_delete_all.place(x=570, y=95)
  658.         b_restore.place(x=570, y=120)
  659.         b_restore_all.place(x=570, y=145)
  660.         b_add_file.place(x=570, y=170)
  661.         li.place(x=570, y=18.5)
  662.         tb = Thread(target=quarantine)
  663.         tb.start()
  664.     if li.winfo_viewable() == 1:
  665.         b_delete.place_forget()
  666.         b_delete_all.place_forget()
  667.         b_restore.place_forget()
  668.         b_restore_all.place_forget()
  669.         b_add_file.place_forget()
  670.         li.place_forget()
  671.     if s == "quit_button":
  672.        tb = Thread(target=closing)
  673.        tb.start()
  674.  
  675.  
  676. def gui_thread():
  677.     global main
  678.     global update_button
  679.     global scan_button
  680.     global fullscan_button
  681.     global quit_button
  682.     global text_box
  683.     global e
  684.     global files_len
  685.     global files
  686.     global li
  687.     global b_delete
  688.     global b_delete_all
  689.     global b_restore
  690.     global b_restore_all
  691.     global b_add_file
  692.     global rb1
  693.     global rb2
  694.     global method
  695.     global bgc
  696.     global fgc
  697.     global special_text
  698.     main = tkinter.Tk()
  699.     main.title("AntiVirus")
  700.     main.wm_iconbitmap("")
  701.     main.configure(bg=bgc)
  702.     main.geometry("750x205")  # width x height
  703.     main.resizable(False, False)
  704.     # main.overrideredirect(1)
  705.     hoehe = 2
  706.     breite = 20
  707.  
  708.     # Buttons
  709.     update_button = tkinter.Button(main, bg=bgc, fg=fgc, text="Update",
  710.                                    command=lambda: button_action_handler("update_button"), height=hoehe, width=breite)
  711.     update_button.grid(row=0, column=0)
  712.     scan_button = tkinter.Button(main, bg=bgc, fg=fgc, text="Scan",
  713.                                  command=lambda: button_action_handler("scan_button"), height=hoehe, width=breite)
  714.     scan_button.grid(row=1, column=0)
  715.     fullscan_button = tkinter.Button(main, bg=bgc, fg=fgc, text="Full scan",
  716.                                      command=lambda: button_action_handler("fullscan_button"), height=hoehe, width=breite)
  717.     fullscan_button.grid(row=2, column=0)
  718.     quarantine_button = tkinter.Button(main, bg=bgc, fg=fgc, text="Quarantine",
  719.                                        command=lambda: button_action_handler("quarantine_button"), height=hoehe, width=breite)
  720.     quarantine_button.grid(row=3, column=0)
  721.     quit_button = tkinter.Button(main, bg=bgc, fg=fgc, text="Close",
  722.                                  command=lambda: button_action_handler("quit_button"), height=hoehe, width=breite)
  723.     quit_button.grid(row=4, column=0, sticky="w")
  724.     b_delete = tkinter.Button(
  725.         main, bg=bgc, fg=fgc, text="Remove current", height=0, width=25, justify=CENTER)
  726.     b_delete_all = tkinter.Button(
  727.         main, bg=bgc, fg=fgc, text="Remove all", height=0, width=25, justify=CENTER)
  728.     b_restore = tkinter.Button(
  729.         main, bg=bgc, fg=fgc, text="Restore current", height=0, width=25, justify=CENTER)
  730.     b_restore_all = tkinter.Button(
  731.         main, bg=bgc, fg=fgc, text="Restore all", height=0, width=25, justify=CENTER)
  732.     b_add_file = tkinter.Button(main, bg=bgc, fg=fgc, text="Add file", height=0, width=25,
  733.                                 justify=CENTER)
  734.     b_delete.place(x=570, y=70)
  735.     b_delete_all.place(x=570, y=95)
  736.     b_restore.place(x=570, y=120)
  737.     b_restore_all.place(x=570, y=145)
  738.     b_add_file.place(x=570, y=170)
  739.     b_delete.place_forget()
  740.     b_delete_all.place_forget()
  741.     b_restore.place_forget()
  742.     b_restore_all.place_forget()
  743.     b_add_file.place_forget()
  744.     # Text
  745.     text_box = tkinter.scrolledtext.ScrolledText(main)
  746.     text_box.configure(bg=bgc)
  747.     text_box.configure(fg=fgc)
  748.     text_box.place(height=205, width=419, x=150, y=0)
  749.     # Listbox
  750.     li = tkinter.Listbox(main, height=3, width=29)
  751.     li.place(x=570, y=18.5)
  752.     li.place_forget()
  753.     # Entries
  754.     e = tkinter.Entry(main, width=30)
  755.     e.place(x=570, y=0)
  756.     e["justify"] = CENTER
  757.     e.insert(0, "")
  758.     e["bg"] = bgc
  759.     e["fg"] = fgc
  760.     # Intro
  761.     text_box.insert(END, "VIP")
  762.     text_box.tag_config("VIP", background=special)
  763.     text_box.insert(END, "[ + ] Preparing the program\n", 'positive')
  764.     text_box.tag_config('positive', foreground='green')
  765.     text_box.see(END)
  766.     text_box.update()
  767.     text_box.insert(
  768.         END, "[ ! ] You might have to wait for a bit\n", 'important')
  769.     text_box.tag_config('important', foreground="red")
  770.     text_box.see(END)
  771.     text_box.update()
  772.     # row_counter += 3
  773.     main.mainloop()
  774.  
  775.  
  776. # Executing Threads
  777. t_main = Thread(target=gui_thread)  # Main Thread
  778. t_files = Thread(target=ScanSystemFiles)
  779. # t_clock = Thread(target=clock_thread)
  780. t_main.start()
  781. time.sleep(1)
  782. # t_clock.start()
  783. # time.sleep(5)
  784. # print(t_main.isAlive())
  785. t_files.start()
  786.