import zipfile
import os

# FILE_DIR = 'G:/dasmalwerk/'
# FILE_DIR = 'G:/unzip_dasmalwerk/zippedMalware'
# SAVE_DIR = 'G:/unzip_dasmalwerk2/'

FILE_DIR = 'G:/malware_part1'
SAVE_DIR = 'G:/malware_part1_unzip'
if not os.path.exists(SAVE_DIR):
    os.mkdir(SAVE_DIR)

files = os.listdir(FILE_DIR)
print(files)

for file in files:
    f = zipfile.ZipFile(os.path.join(FILE_DIR,file), 'r')
    for file in f.namelist():
        f.extract(file, SAVE_DIR, pwd = 'infected'.encode('utf-8'))