Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import os
- import re
- import sys
- import subprocess
- import time
- comd = "C:\\Users\\jon\\Desktop\\dd.exe"
- file = "C:\\Users\\jon\\Desktop\\f15v5p.dd"
- devf = "\\\\?\\Device\\Harddisk1\\Partition0"
- indx = 0
- seek = 0
- size = os.path.getsize(file)
- print("size:",size)
- while (indx < size):
- pipe = subprocess.Popen("%s if=%s of=%s bs=512 seek=%d skip=%d count=1" % (comd, file, devf, seek, seek), shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
- pipe.stdout.close()
- pipe.stderr.close()
- indx += 512
- seek += 1
- '''while (1):
- temp = pipe.stdout.read()
- if (not temp):
- break
- print(temp)
- pipe.stdout.close()'''
Add Comment
Please, Sign In to add comment