Skip to main content

Popen

14:55:06 Offset 2315MB (0.90%) Done in  2:50:37 at 17:45:43
14:55:11 Offset 2399MB (0.94%) Done in  2:52:46 at 17:47:57
14:55:16 Offset 2483MB (0.97%) Done in  2:55:32 at 17:50:48
14:55:22 Offset 2566MB (1.00%) Done in  3:01:02 at 17:56:24
14:55:27 Offset 2650MB (1.04%) Done in  3:02:49 at 17:58:16
    
#Using Ipconfig as example command
cmd = "ipconfig"
pipe = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE).stdout
global output
output= pipe.read()
# Prints ipconfig command
print(output)

#RegX to find % and the next 2 characters
x = re.findall("%dd", str(output))
print(x)
    
#IPCONFIG
Ip config b'rnWindows IP ConfigurationrnrnrnEthernet adapter Ethernet 5:rnrn   Connection-specific DNS Suffix  . : rn   Link-local IPv6 Address . . . . . : fe80::54a5:f051:24bd:95bf%18rn

#RegX

Regx output  ['%18', '%25']
    
if bulk extractor is running:
 Then True:  
   while True:
       Percent = re.findall("%dd", str(output))
       #update.progressbar but for now lets just print screen
       print("current % =", percent)
       #Loop Again
else:
 break
    
cmd = os.system("%programdata%\bulk_extractor64.exe -o test "\imagefile"")