import os
import pandas as pd

sample_folder = "/malware/samples"

## rename md5 filenames to sha256
df = pd.read_csv("sample_report_large.csv")

os.chdir(sample_folder)
os.getcwd()
for filename in os.listdir('.'):
    if df[df['md5']==filename]['sha256'].any():
      os.rename(filename,df[df['md5']==filename]['sha256'].iloc[0]) 
