70
static uint8 client_handshake[] =
69
static BYTE client_handshake[] =
72
71
0x05, 0x00, 0x08, 0x00, 0xb0, 0x1d, 0x00, 0x00
75
static uint8 client_info_pdu[] =
74
static BYTE client_info_pdu[] =
77
76
0x0b, 0x00, 0x08, 0x00, 0x01, 0x00, 0x00, 0x00
82
81
// WorkingDir: f:\windows\system32
83
82
// Arguments: www.bing.com
85
static uint8 client_execute_pdu[] =
84
static BYTE client_execute_pdu[] =
87
86
0x01,0x00,0x5e,0x00,0x08,0x00,0x14,0x00,0x26,0x00,0x18,0x00,0x7c,0x00,
88
87
0x7c,0x00,0x69,0x00,0x65,0x00,0x78,0x00,0x70,0x00,0x6c,0x00,0x6f,0x00,
126
125
0xc2,0x03 // 0x03c2
129
static uint8 client_sysparam_mousebuttonswap_pdu[] =
128
static BYTE client_sysparam_mousebuttonswap_pdu[] =
133
132
0x21,0x00,0x00,0x00, // SPI_SETMOUSEBUTTONSWAP
138
static uint8 client_sysparam_keyboardpref_pdu[] =
137
static BYTE client_sysparam_keyboardpref_pdu[] =
142
141
0x45,0x00,0x00,0x00, // SPI_SETKEYBOARDPREF
147
static uint8 client_sysparam_dragfullwindow_pdu[] =
146
static BYTE client_sysparam_dragfullwindow_pdu[] =
151
150
0x25,0x00,0x00,0x00, // SPI_SETDRAGFULLWINDOWS
156
static uint8 client_sysparam_keyboardcues_pdu[] =
155
static BYTE client_sysparam_keyboardcues_pdu[] =
160
159
0x0b,0x10,0x00,0x00, //SPI_SETKEYBOARDCUES
164
static uint8 client_sysparam_setworkarea_pdu[] =
163
static BYTE client_sysparam_setworkarea_pdu[] =
212
static uint8 client_langbar_pdu[] =
211
static BYTE client_langbar_pdu[] =
214
213
0x0D,0x00,0x08,0x00,0x01,0x00,0x00,0x00
217
static uint8 client_get_app_id_req_pdu[] =
216
static BYTE client_get_app_id_req_pdu[] =
219
218
0x0E,0x00,0x08,0x00,0x52,0x00,0x02,0x00
222
static uint8 server_handshake[] =
221
static BYTE server_handshake[] =
224
223
0x05, 0x00, 0x08, 0x00, 0xb0, 0x1d, 0x00, 0x00
227
static uint8 server_exec_result_pdu[] =
226
static BYTE server_exec_result_pdu[] =
229
228
0x80,0x00,0x24,0x00,0x08,0x00,0x03,0x00,0x15,0x00,0x00,0x00,0x00,0x00,
230
229
0x14,0x00,0x7c,0x00,0x7c,0x00,0x57,0x00,0x72,0x00,0x6f,0x00,0x6e,0x00,
231
230
0x67,0x00,0x41,0x00,0x70,0x00,0x70,0x00
234
static uint8 server_exec_result_exe_or_file[] =
233
static BYTE server_exec_result_exe_or_file[] =
236
235
0x7c,0x00,0x7c,0x00,0x57,0x00,0x72,0x00,0x6f,0x00,0x6e,0x00,
237
236
0x67,0x00,0x41,0x00,0x70,0x00,0x70,0x00
240
static uint8 server_sysparam1_pdu[] =
239
static BYTE server_sysparam1_pdu[] =
256
static uint8 server_localmovesize_start_pdu[] =
255
static BYTE server_localmovesize_start_pdu[] =
258
257
0x09,0x00,0x10,0x00,0x8e,0x00,0x07,0x00,0x01,0x00,0x09,0x00,0x7e,0x01,
262
static uint8 server_localmovesize_stop_pdu[] =
261
static BYTE server_localmovesize_stop_pdu[] =
264
263
0x09,0x00,0x10,0x00,0x8e,0x00,0x07,0x00,0x00,0x00,0x09,0x00,0xa6,0x00,
268
static uint8 server_minmaxinfo_pdu[] =
267
static BYTE server_minmaxinfo_pdu[] =
270
269
0x0a,0x00,0x18,0x00,0x8e,0x00,0x07,0x00,0x08,0x04,0xd6,0x02,0x00,0x00,
271
270
0x00,0x00,0x70,0x00,0x1b,0x00,0x0c,0x04,0x0c,0x03
274
static uint8 server_langbar_pdu[] =
273
static BYTE server_langbar_pdu[] =
276
275
0x0D,0x00,0x08,0x00,0x01,0x00,0x00,0x00
280
static uint8 server_app_get_resp_pdu[] =
279
static BYTE server_app_get_resp_pdu[] =
282
281
0x0F,0x00,0x08,0x02,0x52,0x00,0x02,0x00,0x6d,0x00,0x69,0x00,0x63,0x00,
283
282
0x72,0x00,0x6f,0x00,0x73,0x00,0x6f,0x00,0x66,0x00,0x74,0x00,0x2e,0x00,
328
327
0x00,0x00,0x00,0x00,0x00,0x00
331
static uint8 server_app_get_resp_app_id[] =
330
static BYTE server_app_get_resp_app_id[] =
333
332
0x6d,0x00,0x69,0x00,0x63,0x00,0x72,0x00,0x6f,0x00,0x73,0x00,0x6f,0x00,
334
333
0x66,0x00,0x74,0x00,0x2e,0x00,0x77,0x00,0x69,0x00,0x6e,0x6f,0x00,0x77,
382
381
#define EMULATE_SERVER_SEND_CHANNEL_DATA(inst, byte_array) \
383
emulate_server_send_channel_data(inst, byte_array, RAIL_ARRAY_SIZE(byte_array))
382
emulate_server_send_channel_data(inst, byte_array, ARRAYSIZE(byte_array))
385
384
#define STREAM_EQUAL_TO_DUMP(stream, dump) \
386
(stream_equal_dump((stream)->data, (stream)->size, dump, RAIL_ARRAY_SIZE(dump)))
385
(stream_equal_dump((stream)->data, (stream)->size, dump, ARRAYSIZE(dump)))
388
387
#define UNICODE_STRING_EQUAL_TO_DUMP(ustring, dump) \
389
(stream_equal_dump((ustring)->string, (ustring)->length, dump, RAIL_ARRAY_SIZE(dump)))
388
(stream_equal_dump((ustring)->string, (ustring)->length, dump, ARRAYSIZE(dump)))
447
446
printf("Stream and dump have different length (%d != %d)\n",
448
447
(int) sizeS, (int) size);
449
448
printf("Stream hexdump:\n");
450
freerdp_hexdump(dataS, sizeS);
449
winpr_HexDump(dataS, sizeS);
452
451
printf("Dump hexdump:\n");
453
freerdp_hexdump(data, size);
452
winpr_HexDump(data, size);
455
454
printf("----------------- stream_equal_dump -----------------\n");
460
459
for (i=0; i < size; i++)
462
if (((uint8*)dataS)[i] != ((uint8*)data)[i])
461
if (((BYTE*)dataS)[i] != ((BYTE*)data)[i])
464
463
printf("----------------- stream_equal_dump -----------------\n");
465
464
printf("Stream and dump have different content from %d offset.\n", (int) i);
466
465
printf("Stream hexdump:\n");
467
freerdp_hexdump(dataS, sizeS);
466
winpr_HexDump(dataS, sizeS);
469
468
printf("Dump hexdump:\n");
470
freerdp_hexdump(data, size);
469
winpr_HexDump(data, size);
471
470
printf("----------------- stream_equal_dump -----------------\n");
514
513
printf("Emulate server packet (%d packet):\n", counter);
515
freerdp_hexdump(data, size);
514
winpr_HexDump(data, size);
517
516
freerdp_channels_data(instance, 0, (char*)data, size,
518
517
CHANNEL_FLAG_FIRST | CHANNEL_FLAG_LAST, size);
521
520
static void save_dump(void* data, size_t size)
523
522
thread_param * p = global_thread_params;
524
if (p->in_streams_number < RAIL_ARRAY_SIZE(p->in_streams))
523
if (p->in_streams_number < ARRAYSIZE(p->in_streams))
526
STREAM* s = &p->in_streams[p->in_streams_number];
527
s->data = malloc(size);
525
wStream* s = &p->in_streams[p->in_streams_number];
526
s->buffer = malloc(size);
530
memcpy(s->data, data, size);
529
memcpy(s->buffer, data, size);
531
530
p->in_streams_number++;
534
533
//-----------------------------------------------------------------------------
535
534
static int emulate_client_send_channel_data(
536
freerdp* freerdp, int channelId, uint8* data, int size
535
freerdp* freerdp, int channelId, BYTE* data, int size
539
538
static int counter = 0;
542
541
printf("Client send to server (%d packet):\n", counter);
543
freerdp_hexdump(data, size);
542
winpr_HexDump(data, size);
545
544
// add to global dumps list
546
545
save_dump(data, size);
717
716
param.out_rail_orders.sysparam.taskbarPos.bottom = 0x03c2;
719
718
param.out_rail_orders.sysparam.params |= SPI_MASK_SET_MOUSE_BUTTON_SWAP;
720
param.out_rail_orders.sysparam.mouseButtonSwap = false;
719
param.out_rail_orders.sysparam.mouseButtonSwap = FALSE;
722
721
param.out_rail_orders.sysparam.params |= SPI_MASK_SET_KEYBOARD_PREF;
723
param.out_rail_orders.sysparam.keyboardPref = false;
722
param.out_rail_orders.sysparam.keyboardPref = FALSE;
725
724
param.out_rail_orders.sysparam.params |= SPI_MASK_SET_DRAG_FULL_WINDOWS;
726
param.out_rail_orders.sysparam.dragFullWindows = true;
725
param.out_rail_orders.sysparam.dragFullWindows = TRUE;
728
727
param.out_rail_orders.sysparam.params |= SPI_MASK_SET_KEYBOARD_CUES;
729
param.out_rail_orders.sysparam.keyboardCues = false;
728
param.out_rail_orders.sysparam.keyboardCues = FALSE;
731
730
param.out_rail_orders.sysparam.params |= SPI_MASK_SET_WORK_AREA;
732
731
param.out_rail_orders.sysparam.workArea.left = 0;
744
743
send_ui_event2plugin(chan_man, RDP_EVENT_TYPE_RAIL_CLIENT_EXEC_REMOTE_APP,
745
744
¶m.plugin_data);
747
param.out_rail_orders.activate.enabled = true;
746
param.out_rail_orders.activate.enabled = TRUE;
748
747
param.out_rail_orders.activate.windowId = 0x0007008e;
749
748
send_ui_event2plugin(chan_man, RDP_EVENT_TYPE_RAIL_CLIENT_ACTIVATE,
750
749
¶m.out_rail_orders.activate);
830
829
CU_ASSERT(en > 2 &&
831
830
ee[ 2].event_type == RDP_EVENT_TYPE_RAIL_CHANNEL_SERVER_SYSPARAM &&
832
ee[ 2].order_info.sysparam.setScreenSaveSecure == false
831
ee[ 2].order_info.sysparam.setScreenSaveSecure == FALSE
835
834
CU_ASSERT(en > 3 &&
836
835
ee[ 3].event_type == RDP_EVENT_TYPE_RAIL_CHANNEL_SERVER_SYSPARAM &&
837
ee[ 3].order_info.sysparam.setScreenSaveActive == false
836
ee[ 3].order_info.sysparam.setScreenSaveActive == FALSE
840
839
CU_ASSERT(en > 4 &&
841
840
ee[ 4].event_type == RDP_EVENT_TYPE_RAIL_CHANNEL_SERVER_LOCALMOVESIZE &&
842
841
ee[ 4].order_info.localmovesize.windowId == 0x0007008e &&
843
ee[ 4].order_info.localmovesize.isMoveSizeStart == true &&
842
ee[ 4].order_info.localmovesize.isMoveSizeStart == TRUE &&
844
843
ee[ 4].order_info.localmovesize.moveSizeType == RAIL_WMSZ_MOVE &&
845
844
ee[ 4].order_info.localmovesize.posX == 0x017e &&
846
845
ee[ 4].order_info.localmovesize.posY == 0x000a
849
848
CU_ASSERT(en > 5 &&
850
849
ee[ 5].event_type == RDP_EVENT_TYPE_RAIL_CHANNEL_SERVER_LOCALMOVESIZE &&
851
850
ee[ 5].order_info.localmovesize.windowId == 0x0007008e &&
852
ee[ 5].order_info.localmovesize.isMoveSizeStart == false &&
851
ee[ 5].order_info.localmovesize.isMoveSizeStart == FALSE &&
853
852
ee[ 5].order_info.localmovesize.moveSizeType == RAIL_WMSZ_MOVE &&
854
853
ee[ 5].order_info.localmovesize.posX == 0x00a6 &&
855
854
ee[ 5].order_info.localmovesize.posY == 0x0044