Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # WARNING: DO NOT RUN THIS SCRIPT unless you know what you are doing
- # This script can permanently erase ALL data from your disk
- import os
- import sys
- megs = 4 #MB to write at a time
- size = 10 #Number of GB (total) to write to drive
- f = os.fdopen(os.open('\\\\.\\PhysicalDrive2', os.O_WRONLY|os.O_BINARY), 'wb+') #MAKE SURE YOU CHANGE THIS TO THE CORRECT DRIVE
- a = bytearray(1048576 * megs)
- for x in range(0, 1048576 * megs):
- if x % 4 == 0:
- a[x] = 0xba
- elif x % 4 == 1:
- a[x] = 0xad
- elif x % 4 == 2:
- a[x] = 0xf0
- else:
- a[x] = 0x0d
- for x in range(0, int((size * 1024) / megs)):
- if x % megs == 0:
- sys.stdout.write("\r %s MB written" % (x * megs))
- f.seek(x * 1048576 * megs)
- f.write(a)
- f.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement