synched to Impacket r1107 and r1145