def decodeChallengeMessage(ntlm_data):
 FORMAT = '<8sIHHII8s8sHHI'
 FORMAT_SIZE = struct.calcsize(FORMAT)
 (signature, message_type, targetname_len, targetname_maxlen, targetname_offset, flags, challenge, _, targetinfo_len, targetinfo_maxlen, targetinfo_offset) = struct.unpack(FORMAT, ntlm_data[:FORMAT_SIZE])
 assert (signature == 'NTLMSSP\x00')
 assert (message_type == 2)
 return (challenge, flags, ntlm_data[targetinfo_offset:(targetinfo_offset + targetinfo_len)])

def decodeChallengeMessage ( ntlm_data ) : FORMAT = '<8sIHHII8s8sHHI' FORMAT_SIZE = struct . calcsize ( FORMAT ) ( signature , message_type , targetname_len , targetname_maxlen , targetname_offset , flags , challenge , _ , targetinfo_len , targetinfo_maxlen , targetinfo_offset ) = struct . unpack ( FORMAT , ntlm_data [ : FORMAT_SIZE ] ) assert ( signature == 'NTLMSSP\x00' ) assert ( message_type == 2 ) return ( challenge , flags , ntlm_data [ targetinfo_offset : ( targetinfo_offset + targetinfo_len ) ] )
references: - [ms-nlmp]: 2 .