import argparse
import sys
from config import *
# from data_utils.extract_pe_features import *
from data_utils.bin_to_img import *
# from data_utils.extract_opcode import *
from data_utils.misc import *
from data_utils.data_loaders import *
from pathlib import Path


def main():
    max_files = 0  # set 0 to process all files or set a specific number

    # if args.extract_pe_features:
    #     extract_pe_features(ORG_DATASET_PE_FEATURES_CSV, ORG_DATASET_COUNT_PE_FEATURES_CSV, ORG_DATASET_PATH,
    #                         max_files=max_files)

    # completed modification for us
    if args.bin_to_img:
        dataset_root = Path(ORG_DATASET_ROOT_PATH).resolve()
        dataset = Path(ORG_DATASET_PATH).resolve()

        list_of_widths = [0, 1, 64, 128, 256, 512, 1024]
        for width in list_of_widths:
            convert_bin_to_img(dataset.__str__(), width, max_files=max_files)

    if args.count_samples:
        count_dataset(ORG_DATASET_PATH, ORG_DATASET_COUNT_CSV)
        count_dataset(ORG_DATASET_OPCODES_PATH, ORG_DATASET_COUNT_OPCODES_PATH)
        count_dataset(get_image_datapath(image_dim=256), ORG_DATASET_COUNT_IMAGES_CSV)


if __name__ == "__main__":
    parser = argparse.ArgumentParser(description='Process the Malware data')

    parser.add_argument('--bin_to_img', action='store_true', help='Generate image files from malware binaries',
                        default=False)
    parser.add_argument('--count_samples', action='store_true', help='Count all sample files for all experiments',
                        default=False)

    args = parser.parse_args()

    if len(sys.argv) < 2:
        parser.print_usage()
        sys.exit(1)

    main()

a5ab72f175cdee773d01d2776ad3c60fa130fdff
<mask token>

<mask token>


def main():
    max_files = 0
    if args.bin_to_img:
        dataset_root = Path(ORG_DATASET_ROOT_PATH).resolve()
        dataset = Path(ORG_DATASET_PATH).resolve()
        list_of_widths = [0, 1, 64, 128, 256, 512, 1024]
        for width in list_of_widths:
            convert_bin_to_img(dataset.__str__(), width, max_files=max_files)
    if args.count_samples:
        count_dataset(ORG_DATASET_PATH, ORG_DATASET_COUNT_CSV)
        count_dataset(ORG_DATASET_OPCODES_PATH, ORG_DATASET_COUNT_OPCODES_PATH)
        count_dataset(get_image_datapath(image_dim=256),
            ORG_DATASET_COUNT_IMAGES_CSV)


<mask token>

<mask token>


def main():
    max_files = 0
    if args.bin_to_img:
        dataset_root = Path(ORG_DATASET_ROOT_PATH).resolve()
        dataset = Path(ORG_DATASET_PATH).resolve()
        list_of_widths = [0, 1, 64, 128, 256, 512, 1024]
        for width in list_of_widths:
            convert_bin_to_img(dataset.__str__(), width, max_files=max_files)
    if args.count_samples:
        count_dataset(ORG_DATASET_PATH, ORG_DATASET_COUNT_CSV)
        count_dataset(ORG_DATASET_OPCODES_PATH, ORG_DATASET_COUNT_OPCODES_PATH)
        count_dataset(get_image_datapath(image_dim=256),
            ORG_DATASET_COUNT_IMAGES_CSV)


if __name__ == '__main__':
    parser = argparse.ArgumentParser(description='Process the Malware data')
    parser.add_argument('--bin_to_img', action='store_true', help=
        'Generate image files from malware binaries', default=False)
    parser.add_argument('--count_samples', action='store_true', help=
        'Count all sample files for all experiments', default=False)
    args = parser.parse_args()
    if len(sys.argv) < 2:
        parser.print_usage()
        sys.exit(1)
    main()

import argparse
import sys
from config import *
from data_utils.bin_to_img import *
from data_utils.misc import *
from data_utils.data_loaders import *
from pathlib import Path


def main():
    max_files = 0
    if args.bin_to_img:
        dataset_root = Path(ORG_DATASET_ROOT_PATH).resolve()
        dataset = Path(ORG_DATASET_PATH).resolve()
        list_of_widths = [0, 1, 64, 128, 256, 512, 1024]
        for width in list_of_widths:
            convert_bin_to_img(dataset.__str__(), width, max_files=max_files)
    if args.count_samples:
        count_dataset(ORG_DATASET_PATH, ORG_DATASET_COUNT_CSV)
        count_dataset(ORG_DATASET_OPCODES_PATH, ORG_DATASET_COUNT_OPCODES_PATH)
        count_dataset(get_image_datapath(image_dim=256),
            ORG_DATASET_COUNT_IMAGES_CSV)


if __name__ == '__main__':
    parser = argparse.ArgumentParser(description='Process the Malware data')
    parser.add_argument('--bin_to_img', action='store_true', help=
        'Generate image files from malware binaries', default=False)
    parser.add_argument('--count_samples', action='store_true', help=
        'Count all sample files for all experiments', default=False)
    args = parser.parse_args()
    if len(sys.argv) < 2:
        parser.print_usage()
        sys.exit(1)
    main()

import argparse
import sys
from config import *
# from data_utils.extract_pe_features import *
from data_utils.bin_to_img import *
# from data_utils.extract_opcode import *
from data_utils.misc import *
from data_utils.data_loaders import *
from pathlib import Path


def main():
    max_files = 0  # set 0 to process all files or set a specific number

    # if args.extract_pe_features:
    #     extract_pe_features(ORG_DATASET_PE_FEATURES_CSV, ORG_DATASET_COUNT_PE_FEATURES_CSV, ORG_DATASET_PATH,
    #                         max_files=max_files)

    # completed modification for us
    if args.bin_to_img:
        dataset_root = Path(ORG_DATASET_ROOT_PATH).resolve()
        dataset = Path(ORG_DATASET_PATH).resolve()

        list_of_widths = [0, 1, 64, 128, 256, 512, 1024]
        for width in list_of_widths:
            convert_bin_to_img(dataset.__str__(), width, max_files=max_files)

    if args.count_samples:
        count_dataset(ORG_DATASET_PATH, ORG_DATASET_COUNT_CSV)
        count_dataset(ORG_DATASET_OPCODES_PATH, ORG_DATASET_COUNT_OPCODES_PATH)
        count_dataset(get_image_datapath(image_dim=256), ORG_DATASET_COUNT_IMAGES_CSV)


if __name__ == "__main__":
    parser = argparse.ArgumentParser(description='Process the Malware data')

    parser.add_argument('--bin_to_img', action='store_true', help='Generate image files from malware binaries',
                        default=False)
    parser.add_argument('--count_samples', action='store_true', help='Count all sample files for all experiments',
                        default=False)

    args = parser.parse_args()

    if len(sys.argv) < 2:
        parser.print_usage()
        sys.exit(1)

    main()
