41
41
guint32 type; /* 0x00000001 */
42
42
guint32 flags; /* 0x0000b203 */
44
short dom_len1; /* domain string length */
45
short dom_len2; /* domain string length */
44
guint16 dom_len1; /* domain string length */
45
guint16 dom_len2; /* domain string length */
46
46
guint32 dom_off; /* domain string offset */
48
short host_len1; /* host string length */
49
short host_len2; /* host string length */
48
guint16 host_len1; /* host string length */
49
guint16 host_len2; /* host string length */
50
50
guint32 host_off; /* host string offset (always 0x00000020) */
59
59
guint8 protocol[8]; /* 'N', 'T', 'L', 'M', 'S', 'S', 'P', '\0'*/
60
60
guint32 type; /* 0x00000002 */
62
short msg_len1; /* target name length */
63
short msg_len2; /* target name length */
64
guint32 msg_off; /* target name offset (always 0x00000048) */
63
guint16 msg_len1; /* target name length */
64
guint16 msg_len2; /* target name length */
66
66
guint32 flags; /* 0x00008201 */
68
68
guint8 nonce[8]; /* nonce */
72
72
struct type3_message {
73
73
guint8 protocol[8]; /* 'N', 'T', 'L', 'M', 'S', 'S', 'P', '\0'*/
74
74
guint32 type; /* 0x00000003 */
76
short lm_resp_len1; /* LanManager response length (always 0x18)*/
77
short lm_resp_len2; /* LanManager response length (always 0x18)*/
76
guint16 lm_resp_len1; /* LanManager response length (always 0x18)*/
77
guint16 lm_resp_len2; /* LanManager response length (always 0x18)*/
78
78
guint32 lm_resp_off; /* LanManager response offset */
80
short nt_resp_len1; /* NT response length (always 0x18) */
81
short nt_resp_len2; /* NT response length (always 0x18) */
80
guint16 nt_resp_len1; /* NT response length (always 0x18) */
81
guint16 nt_resp_len2; /* NT response length (always 0x18) */
82
82
guint32 nt_resp_off; /* NT response offset */
84
short dom_len1; /* domain string length */
85
short dom_len2; /* domain string length */
84
guint16 dom_len1; /* domain string length */
85
guint16 dom_len2; /* domain string length */
86
86
guint32 dom_off; /* domain string offset (always 0x00000040) */
88
short user_len1; /* username string length */
89
short user_len2; /* username string length */
88
guint16 user_len1; /* username string length */
89
guint16 user_len2; /* username string length */
90
90
guint32 user_off; /* username string offset */
92
short host_len1; /* host string length */
93
short host_len2; /* host string length */
92
guint16 host_len1; /* host string length */
93
guint16 host_len2; /* host string length */
94
94
guint32 host_off; /* host string offset */
98
98
guint32 sess_off; /* message length */
100
100
guint32 flags; /* 0x00008201 */
101
101
/* guint32 flags2; */ /* unknown, used in windows messenger */
102
/* guint32 flags3; */
102
/* guint32 flags3; */
105
105
guint8 dom[*]; /* domain string (unicode UTF-16LE) */
132
131
tmsg->protocol[5] = 'S';
133
132
tmsg->protocol[6] = 'P';
134
133
tmsg->protocol[7] = '\0';
135
tmsg->type = 0x00000001;
136
tmsg->flags = 0x0000b203;
137
tmsg->dom_len1 = tmsg->dom_len2 = domainlen;
138
tmsg->dom_off = sizeof(struct type1_message) + hostnamelen;
139
tmsg->host_len1 = tmsg->host_len2 = hostnamelen;
140
tmsg->host_off = sizeof(struct type1_message);
134
tmsg->type = GUINT32_TO_LE(0x00000001);
135
tmsg->flags = GUINT32_TO_LE(0x0000b203);
136
tmsg->dom_len1 = tmsg->dom_len2 = GUINT16_TO_LE(domainlen);
137
tmsg->dom_off = GUINT32_TO_LE(sizeof(struct type1_message) + hostnamelen);
138
tmsg->host_len1 = tmsg->host_len2 = GUINT16_TO_LE(hostnamelen);
139
tmsg->host_off = GUINT32_TO_LE(sizeof(struct type1_message));
141
140
memcpy(msg + tmsg->host_off, hostname, hostnamelen);
142
141
memcpy(msg + tmsg->dom_off, domain, domainlen);
268
267
tmsg->protocol[4] = 'S';
269
268
tmsg->protocol[5] = 'S';
270
269
tmsg->protocol[6] = 'P';
271
tmsg->type = 0x00000003;
272
tmsg->lm_resp_len1 = tmsg->lm_resp_len2 = 0x18;
273
tmsg->lm_resp_off = sizeof(struct type3_message) + domainlen + usernamelen + hostnamelen;
274
tmsg->nt_resp_len1 = tmsg->nt_resp_len2 = 0x18;
275
tmsg->nt_resp_off = sizeof(struct type3_message) + domainlen + usernamelen + hostnamelen + 0x18;
277
tmsg->dom_len1 = tmsg->dom_len2 = domainlen;
278
tmsg->dom_off = sizeof(struct type3_message);
280
tmsg->user_len1 = tmsg->user_len2 = usernamelen;
281
tmsg->user_off = sizeof(struct type3_message) + domainlen;
283
tmsg->host_len1 = tmsg->host_len2 = hostnamelen;
284
tmsg->host_off = sizeof(struct type3_message) + domainlen + usernamelen;
270
tmsg->type = GUINT32_TO_LE(0x00000003);
271
tmsg->lm_resp_len1 = tmsg->lm_resp_len2 = GUINT16_TO_LE(0x18);
272
tmsg->lm_resp_off = GUINT32_TO_LE(sizeof(struct type3_message) + domainlen + usernamelen + hostnamelen);
273
tmsg->nt_resp_len1 = tmsg->nt_resp_len2 = GUINT16_TO_LE(0x18);
274
tmsg->nt_resp_off = GUINT32_TO_LE(sizeof(struct type3_message) + domainlen + usernamelen + hostnamelen + 0x18);
276
tmsg->dom_len1 = tmsg->dom_len2 = GUINT16_TO_LE(domainlen);
277
tmsg->dom_off = GUINT32_TO_LE(sizeof(struct type3_message));
279
tmsg->user_len1 = tmsg->user_len2 = GUINT16_TO_LE(usernamelen);
280
tmsg->user_off = GUINT32_TO_LE(sizeof(struct type3_message) + domainlen);
282
tmsg->host_len1 = tmsg->host_len2 = GUINT16_TO_LE(hostnamelen);
283
tmsg->host_off = GUINT32_TO_LE(sizeof(struct type3_message) + domainlen + usernamelen);
287
tmsg->sess_off = sizeof(struct type3_message) + domainlen + usernamelen + hostnamelen + 0x18 + 0x18;
288
tmsg->sess_len1 = tmsg->sess_len2 = 0x0010;
286
tmsg->sess_off = GUINT32_TO_LE(sizeof(struct type3_message) + domainlen + usernamelen + hostnamelen + 0x18 + 0x18);
287
tmsg->sess_len1 = tmsg->sess_len2 = GUINT16_TO_LE(0x0010);
291
tmsg->flags = 0x00008201;
290
tmsg->flags = GUINT32_TO_LE(0x00008201);
293
292
tmp = (char *)tmsg + sizeof(struct type3_message);