Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- import os, sys, pefile
- def corrupt(path):
- try:
- pe = pefile.PE(path)
- except:
- return True
- highest = 0
- for section in pe.sections:
- tmp = section.PointerToRawData + section.SizeOfRawData
- if tmp > highest:
- highest = tmp
- if os.path.getsize(path) < highest:
- return True
- return False
- if len(sys.argv) == 2:
- for i in os.listdir(sys.argv[1]):
- file = sys.argv[1] + '\\' + i
- if corrupt(file):
- print 'del ' + file
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement