170 |
{ |
{ |
171 |
flags |= RDP_LOGON_BLOB; |
flags |= RDP_LOGON_BLOB; |
172 |
DEBUG_RDP5(("Sending RDP5-style Logon packet\n")); |
DEBUG_RDP5(("Sending RDP5-style Logon packet\n")); |
173 |
packetlen = 4 + // Unknown uint32 |
packetlen = 4 + // Unknown uint32 |
174 |
4 + // flags |
4 + // flags |
175 |
2 + // len_domain |
2 + // len_domain |
176 |
2 + // len_user |
2 + // len_user |
177 |
(flags & RDP_LOGON_AUTO ? 2 : 0) + // len_password |
(flags & RDP_LOGON_AUTO ? 2 : 0) + // len_password |
178 |
(flags & RDP_LOGON_BLOB ? 2 : 0) + // Length of BLOB |
(flags & RDP_LOGON_BLOB ? 2 : 0) + // Length of BLOB |
179 |
2 + // len_program |
2 + // len_program |
180 |
2 + // len_directory |
2 + // len_directory |
181 |
(0 < len_domain ? len_domain : 2) + // domain |
(0 < len_domain ? len_domain : 2) + // domain |
182 |
len_user + |
len_user + (flags & RDP_LOGON_AUTO ? len_password : 0) + 0 + // We have no 512 byte BLOB. Perhaps we must? |
183 |
(flags & RDP_LOGON_AUTO ? len_password : 0) + |
(flags & RDP_LOGON_BLOB && !(flags & RDP_LOGON_AUTO) ? 2 : 0) + // After the BLOB is a unknown int16. If there is a BLOB, that is. |
184 |
0 + // We have no 512 byte BLOB. Perhaps we must? |
(0 < len_program ? len_program : 2) + (0 < len_directory ? len_directory : 2) + 2 + // Unknown (2) |
185 |
(flags & RDP_LOGON_BLOB && !(flags & RDP_LOGON_AUTO) ? 2 : 0) + // After the BLOB is a unknown int16. If there is a BLOB, that is. |
2 + // Client ip length |
186 |
(0 < len_program ? len_program : 2) + |
len_ip + // Client ip |
187 |
(0 < len_directory ? len_directory : 2) + |
2 + // DLL string length |
188 |
2 + // Unknown (2) |
len_dll + // DLL string |
189 |
2 + // Client ip length |
2 + // Unknown |
190 |
len_ip + // Client ip |
2 + // Unknown |
191 |
2 + // DLL string length |
64 + // Time zone #0 |
192 |
len_dll + // DLL string |
2 + // Unknown |
193 |
2 + // Unknown |
64 + // Time zone #1 |
194 |
2 + // Unknown |
32; // Unknown |
195 |
64 + // Time zone #0 |
|
196 |
2 + // Unknown |
s = sec_init(sec_flags, packetlen); |
|
64 + // Time zone #1 |
|
|
32; // Unknown |
|
|
|
|
|
s = sec_init(sec_flags, packetlen); |
|
197 |
DEBUG_RDP5(("Called sec_init with packetlen %d\n", packetlen)); |
DEBUG_RDP5(("Called sec_init with packetlen %d\n", packetlen)); |
198 |
|
|
199 |
out_uint32(s, 0); // Unknown |
out_uint32(s, 0); // Unknown |
200 |
out_uint32_le(s, flags); |
out_uint32_le(s, flags); |
201 |
out_uint16_le(s, len_domain); |
out_uint16_le(s, len_domain); |
202 |
out_uint16_le(s, len_user); |
out_uint16_le(s, len_user); |
205 |
out_uint16_le(s, len_password); |
out_uint16_le(s, len_password); |
206 |
|
|
207 |
} |
} |
208 |
if (flags & RDP_LOGON_BLOB && !(flags & RDP_LOGON_AUTO)) { |
if (flags & RDP_LOGON_BLOB && !(flags & RDP_LOGON_AUTO)) |
209 |
|
{ |
210 |
out_uint16_le(s, 0); |
out_uint16_le(s, 0); |
211 |
} |
} |
212 |
out_uint16_le(s, len_program); |
out_uint16_le(s, len_program); |
213 |
out_uint16_le(s, len_directory); |
out_uint16_le(s, len_directory); |
214 |
if (0 < len_domain) |
if (0 < len_domain) |
215 |
rdp_out_unistr(s, domain, len_domain); |
rdp_out_unistr(s, domain, len_domain); |
216 |
else |
else |
217 |
out_uint16_le(s, 0); |
out_uint16_le(s, 0); |
218 |
rdp_out_unistr(s, user, len_user); |
rdp_out_unistr(s, user, len_user); |
219 |
if (flags & RDP_LOGON_AUTO) |
if (flags & RDP_LOGON_AUTO) |
220 |
{ |
{ |
221 |
rdp_out_unistr(s, password, len_password); |
rdp_out_unistr(s, password, len_password); |
222 |
} |
} |
223 |
if (flags & RDP_LOGON_BLOB && !(flags & RDP_LOGON_AUTO)) { |
if (flags & RDP_LOGON_BLOB && !(flags & RDP_LOGON_AUTO)) |
224 |
|
{ |
225 |
out_uint16_le(s, 0); |
out_uint16_le(s, 0); |
226 |
} |
} |
227 |
if (0 < len_program) { |
if (0 < len_program) |
228 |
|
{ |
229 |
rdp_out_unistr(s, program, len_program); |
rdp_out_unistr(s, program, len_program); |
230 |
|
|
231 |
} else { |
} |
232 |
|
else |
233 |
|
{ |
234 |
out_uint16_le(s, 0); |
out_uint16_le(s, 0); |
235 |
} |
} |
236 |
if (0 < len_directory) { |
if (0 < len_directory) |
237 |
|
{ |
238 |
rdp_out_unistr(s, directory, len_directory); |
rdp_out_unistr(s, directory, len_directory); |
239 |
} else { |
} |
240 |
|
else |
241 |
|
{ |
242 |
out_uint16_le(s, 0); |
out_uint16_le(s, 0); |
243 |
} |
} |
244 |
out_uint16_le(s, 2); |
out_uint16_le(s, 2); |
245 |
out_uint16_le(s, len_ip+2); // Length of client ip |
out_uint16_le(s, len_ip + 2); // Length of client ip |
246 |
rdp_out_unistr(s, "127.0.0.1", len_ip); |
rdp_out_unistr(s, "127.0.0.1", len_ip); |
247 |
out_uint16_le(s, len_dll+2); |
out_uint16_le(s, len_dll + 2); |
248 |
rdp_out_unistr(s, "C:\\WINNT\\System32\\mstscax.dll", len_dll); |
rdp_out_unistr(s, "C:\\WINNT\\System32\\mstscax.dll", len_dll); |
249 |
out_uint16_le(s, 0xffc4); |
out_uint16_le(s, 0xffc4); |
250 |
out_uint16_le(s, 0xffff); |
out_uint16_le(s, 0xffff); |
251 |
rdp_out_unistr(s, "GTB, normaltid", |
rdp_out_unistr(s, "GTB, normaltid", 2 * strlen("GTB, normaltid")); |
252 |
2*strlen("GTB, normaltid")); |
out_uint8s(s, 62 - 2 * strlen("GTB, normaltid")); |
253 |
out_uint8s(s, 62-2*strlen("GTB, normaltid")); |
|
|
|
|
254 |
|
|
255 |
out_uint32_le(s, 0x0a0000); |
out_uint32_le(s, 0x0a0000); |
256 |
out_uint32_le(s, 0x050000); |
out_uint32_le(s, 0x050000); |
257 |
out_uint32_le(s, 3); |
out_uint32_le(s, 3); |
258 |
out_uint32_le(s, 0); |
out_uint32_le(s, 0); |
259 |
out_uint32_le(s, 0); |
out_uint32_le(s, 0); |
260 |
|
|
261 |
rdp_out_unistr(s, "GTB, sommartid", |
rdp_out_unistr(s, "GTB, sommartid", 2 * strlen("GTB, sommartid")); |
262 |
2*strlen("GTB, sommartid")); |
out_uint8s(s, 62 - 2 * strlen("GTB, sommartid")); |
|
out_uint8s(s, 62-2*strlen("GTB, sommartid")); |
|
263 |
|
|
264 |
out_uint32_le(s, 0x30000); |
out_uint32_le(s, 0x30000); |
265 |
out_uint32_le(s, 0x050000); |
out_uint32_le(s, 0x050000); |
712 |
if (!compress) |
if (!compress) |
713 |
{ |
{ |
714 |
int y; |
int y; |
715 |
bmpdata = (uint8*)xmalloc(width * height * Bpp); |
bmpdata = (uint8 *) xmalloc(width * height * Bpp); |
716 |
for (y = 0; y < height; y++) |
for (y = 0; y < height; y++) |
717 |
{ |
{ |
718 |
in_uint8a(s, &bmpdata[(height - y - 1) * (width * Bpp)], |
in_uint8a(s, &bmpdata[(height - y - 1) * (width * Bpp)], |
735 |
in_uint8s(s, 4); /* line_size, final_size */ |
in_uint8s(s, 4); /* line_size, final_size */ |
736 |
} |
} |
737 |
in_uint8p(s, data, size); |
in_uint8p(s, data, size); |
738 |
bmpdata = (uint8*)xmalloc(width * height * Bpp); |
bmpdata = (uint8 *) xmalloc(width * height * Bpp); |
739 |
if (bitmap_decompress(bmpdata, width, height, data, size, Bpp)) |
if (bitmap_decompress(bmpdata, width, height, data, size, Bpp)) |
740 |
{ |
{ |
741 |
ui_paint_bitmap(left, top, cx, cy, width, height, bmpdata); |
ui_paint_bitmap(left, top, cx, cy, width, height, bmpdata); |
762 |
in_uint16_le(s, map.ncolours); |
in_uint16_le(s, map.ncolours); |
763 |
in_uint8s(s, 2); /* pad */ |
in_uint8s(s, 2); /* pad */ |
764 |
|
|
765 |
map.colours = (COLOURENTRY*)xmalloc(3 * map.ncolours); |
map.colours = (COLOURENTRY *) xmalloc(3 * map.ncolours); |
766 |
|
|
767 |
DEBUG(("PALETTE(c=%d)\n", map.ncolours)); |
DEBUG(("PALETTE(c=%d)\n", map.ncolours)); |
768 |
|
|
884 |
rdp_connect(char *server, uint32 flags, char *domain, char *password, |
rdp_connect(char *server, uint32 flags, char *domain, char *password, |
885 |
char *command, char *directory) |
char *command, char *directory) |
886 |
{ |
{ |
887 |
|
if (use_rdp5) |
888 |
|
channels_init(); |
889 |
|
|
890 |
if (!sec_connect(server, username)) |
if (!sec_connect(server, username)) |
891 |
return False; |
return False; |
892 |
|
|