Moving back into our fuzz_file() function, we evaluate the provided file to see whether it has any content, and if so, open the file. We store this file size for later use:
122 fsize = os.stat(file_path).st_size123 if fsize == 0:124 logger.warning("File is 0-bytes. Skipping...")125 return ""126 open_file = open(file_path, 'rb')
We now start with our first factor in the hashing algorithm, the reset point. This value is noted as the first value in a signature, as it's used to determine what hashes can be compared. To calculate this number, we start with 3, as selected in the spamsum algorithm as a minimum reset point. We then double the reset point, as shown on line 130, until it's larger than the filesize / 64 ...