import os
from malware import utils


def get_pcap_list(path):
    pcap_list = []
    dirs = os.listdir(path)
    dirs.sort()
    for item in dirs:
        if item.split('.')[-1] == 'pcap':
            pcap_list.append(item)
    return pcap_list

if __name__ == '__main__':
    pcap_list = get_pcap_list('./')
    for pcap in pcap_list:
        connection = utils.follow_tcp_stream(pcap)
        utils.dump_tcp_stream_content(connection)

import os
import sys
from malware import utils


def get_pcap_list(path):
    pcap_list = []
    dirs = os.listdir(path)
    dirs.sort()
    for item in dirs:
        if item.split('.')[-1] == 'pcap':
            pcap_list.append(item)
    return pcap_list

if __name__ == '__main__':
    pcap_list = get_pcap_list(sys.argv[1])
    for pcap in pcap_list:
        connection = utils.follow_tcp_stream(pcap)
        utils.dump_tcp_stream_content(connection)

Add sys argv