Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions sulley/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,17 +57,23 @@ def calculate_four_byte_padding(string, character="\x00"):
return character * ((4 - (len(string) & 3)) & 3)


def crc16(string, value=0):
def crc16(string, value=0xa001):
"""
CRC-16 poly: p(x) = x**16 + x**15 + x**2 + 1
@:param value: CRC-16
P_16 0xa001
P_CCITT 0x1021
P-DNP 0xa6bc
p_KERMIT 0x8408
P_SICK 0x8005
"""
crc16_table = []
for byte in range(256):
crc = 0

for bit in range(8):
if (byte ^ crc) & 1:
crc = (crc >> 1) ^ 0xa001 # polly
crc = (crc >> 1) ^ value # poly
else:
crc >>= 1

Expand Down
2 changes: 1 addition & 1 deletion sulley/sessions.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ def export_file(self):

data = {
"session_filename": self.session_filename,
"skip": self.total_mutant_index,
"skip": self.skip,
"sleep_time": self.sleep_time,
"restart_sleep_time": self.restart_sleep_time,
"proto": self.proto,
Expand Down