def bytes_frequency(payload, min_length=1, max_length=3, min_count=10):
    possible_keys = {}
    start_index = 0

    payload_size = len(payload)

    for keylength in range(min_length, max_length):
        possible_keys[keylength] = {}

    while start_index < payload_size:

        for slice_length in range(min_length, max_length):
            end_index = start_index + slice_length

            key_value = payload[start_index:end_index]
            key_length = len(key_value)

            if key_value == key_length * chr(key_value[0]).encode():
                pass
            elif key_value in possible_keys[key_length]:
                possible_keys[key_length][key_value] += 1
            else:
                possible_keys[key_length][key_value] = 1

        start_index += 1

    for keylength in range(min_length, max_length):
        for byte_value, count in possible_keys[keylength].items():
            if count >= min_count:
                yield (byte_value, count,
                       float("{:.2f}".format(100 * float(count) / float(payload_size))))
Main function for specchio
dataset/ETHPy150Open PUNCH-Cyber/stoq/stoq-framework/scan.py/bytes_frequency--crossover with--dataset/ETHPy150Open brickgao/specchio/specchio/main.py/main