当前位置:   article > 正文

RDP协议简介与通讯数据加密等级及设置说明

rdp数据包解析 加密算法
RDP协议简介
RDP是一个多层多虚通道通讯协议,它在一个TCP连接中虚拟出若干个通道,分别进行各种信息的传输。
各个层次数据包说明:
RDP层:RDP客户端任何的用户操作,都将形成RDP数据包,并以数据包类型形成RDP包头,然后将数据包传给Secure Connection层,由Secure Connection负责将数据往下传递。
Secure Connection层:该层再收到RDP层数据包后,在RDP数据包中添加Sec层的包头,将对RDP数据进行加密,然后传给MCS层。
MCS层:在收到Sec层传来的数据包后,在该数据包中添加MCS层数据包包头信息,然后将数据包传给ISO层。
ISO层:收到MCS层的数据后,在该数据包中添加ISO包头,并将数据包传给TCP层,由TCP层负责将数据通过网络发送出去。
TCP层:这是我们常说的传输层,在收到ISO层传输过来的数据后,将通过原建立好的SOCK将数据发送出去。
注:(a)、以上所述是数据的发送过程,是一层一层往下进行处理,接收过程则相反,一层一层往上对数据组合并上传。
(b)、初始化数据包时,是从下往上先调用TCP_init开辟空间并初始化,然后再由ISO层对ISO层的内容进行初始化,依此往上类推。
首先在建立连接时,会与服务器之间建立一条TCP连接,再在该TCP连接中虚拟出若干条通道。这些虚通道主要有:
全局通道。
剪贴板通道。
声音映射通道。
其它设备通道(如Serial、Disk、Print、Parallel等)等等。


RDP数据包的类型:
接收端在接收到数据包,并经过各层的处理后最终形成明文RDP数据包后,在每个数据包的包头都含有数据包的类型说明字段,该字段指明本数据包是什么类型,如:
终端服务传向客户端的数据包类型举例:
显示区域更新包;
鼠标指针位置变动包;
剪站板操作数据包;
声音数据包;
RDP打印数据包;
磁盘读写请求包及写数据包;
串口读写请求包及写数据包;
并口读写请求包及写数据包等等
客户端传向终端服务器的数据包类型举例:
按键信息数据包;
鼠标操作数据包;
用户登录用户名及密码数据包;
外设输入数据包;
从本地磁盘及外设读出的数据包等等。
各种类型数据包的处理:
客户端在接收到终端服务器发送下来的数据包后,将从包头中解释出数据包类型,并根据包类型进行不同的操作,如收到串口操作数据包,则将该数据包交给串口数据处理程序进行处理。
当RDP客户端程序收到终端输入信息(如按键信息)后,会将该信息组成数据包并发给服务器(如将按键扫描码发给终端服务器,由服务器进行相应的操作)。

RDP通讯数据加密级别设置说明
Window终端通过RDP协议与终端服务器连接时,所有在网络中传输的数据都将经过加密,具体加密等级的设置有两种方法:
通过终端服务配置进行配置:
可以在"管理工具"—》"终端服配置"—》"连接"—》"右击"并选择属性—》在其中的"常规"选项卡中的"加密级别"进行设置,具体选项说明如下:


通过组策略进行设置:
打开组策略并在"计算机配置"—》"管理模板"—》"Windows 组件"—》"终端服务"—》"加密与安全性"上,双击"设置客户端连接加密级别"设置,然后单击"已启用"。

加密级别说明:
对于其中的加密级别,在这里简单给予说明。
"符合 FIPS 标准"级别通过使用 Microsoft 加密模块的联邦信息处理标准(FIPS)加密算法,对客户端和服务器之间相互发送的数据进行加密和解密。 对于终端服务,它只支持 Triple DES 加密算法,以便对终端服务网络通信加密。
<wbr>要点:如果通过系统加密:使用FIPS兼容的算法来加密、哈希和签名组策略或终端服务"设置客户端连接加密级别"组策略,已经启用了 FIPS 兼容算法,就不能使用终端服务配置更改加密级别。</wbr><wbr style="line-height:25px; color:rgb(71,59,52); font-family:Arial,Helvetica,simsun,u5b8bu4f53; font-size:14px; background-color:rgb(246,244,243)"><br style="line-height:25px; color:rgb(71,59,52); font-family:Arial,Helvetica,simsun,u5b8bu4f53; font-size:14px; background-color:rgb(246,244,243)"><p><span style="color:rgb(71,59,52); font-family:Arial,Helvetica,simsun,u5b8bu4f53; font-size:14px; line-height:25px; background-color:rgb(246,244,243)">"高"级别使用 128 位的强加密RC4算法,对客户端和服务器之间发送的数据进行加密。当终端服务器运行在仅包含 128 位客户端(例如运行 Windows Server 2003 家族操作系统之一的客户端)的环境中时,才使用该级别。不支持该加密级别的客户端将无法进行连接。 "客户端兼容"级别以客户端所支持的最大密钥强度来加密客户端和服务器之间发送的数据。如果终端服务器的运行环境包含混合或旧的客户端,请使用此级别。 "低"级别将使用 56 位加密对从客户端传输到服务器的数据进行加密。</span><span style="line-height:25px; color:rgb(71,59,52); font-family:Arial,Helvetica,simsun,u5b8bu4f53; font-size:14px; background-color:rgb(246,244,243)"><strong><wbr>对从服务器传输到客户端的数据不进行加密</wbr></strong></span><wbr style="line-height:25px; color:rgb(71,59,52); font-family:Arial,Helvetica,simsun,u5b8bu4f53; font-size:14px; background-color:rgb(246,244,243)"><span style="color:rgb(71,59,52); font-family:Arial,Helvetica,simsun,u5b8bu4f53; font-size:14px; line-height:25px; background-color:rgb(246,244,243)">。</span><span style="line-height:25px; color:rgb(71,59,52); font-family:Arial,Helvetica,simsun,u5b8bu4f53; font-size:14px; background-color:rgb(246,244,243)"><strong><wbr>需要抓包分析时请将加密级别设置为"低"。</wbr></strong></span><wbr style="line-height:25px; color:rgb(71,59,52); font-family:Arial,Helvetica,simsun,u5b8bu4f53; font-size:14px; background-color:rgb(246,244,243)"><span style="color:rgb(71,59,52); font-family:Arial,Helvetica,simsun,u5b8bu4f53; font-size:14px; line-height:25px; background-color:rgb(246,244,243)"></span></wbr></wbr></p> <p><span style="color:rgb(71,59,52); font-family:Arial,Helvetica,simsun,u5b8bu4f53; font-size:14px; line-height:25px; background-color:rgb(246,244,243)"><br></span></p> <p><span style="color:rgb(71,59,52); font-family:Arial,Helvetica,simsun,u5b8bu4f53; font-size:14px; line-height:25px; background-color:rgb(246,244,243)"><br></span></p> <p><span style="color:rgb(71,59,52); font-family:Arial,Helvetica,simsun,u5b8bu4f53; font-size:14px; line-height:25px; background-color:rgb(246,244,243)"></span></p> <div class="bct fc05 fc11 nbw-blog ztag js-fs2" style="line-height:25px; font-size:14px; word-wrap:break-word; color:rgb(71,59,52); margin:15px 0px; padding:5px 0px; overflow:hidden; font-family:Arial,Helvetica,simsun,u5b8bu4f53; background-color:rgb(246,244,243)"> <p style="margin-top:0px; margin-bottom:10px; padding-top:0px; padding-bottom:0px"> 本文立足于rdesktop的架构层次进行解析,算是抛砖引玉,国内对RDP协议深入解析的资料到本文发布时为空白!</p> <div> <p style="margin-top:0px; margin-bottom:10px; padding-top:0px; padding-bottom:0px"> 调用层次:</p> <p style="margin-top:0px; margin-bottom:10px; padding-top:0px; padding-bottom:0px"> rdp_---&gt;sec_---&gt;mcs_---&gt;iso_---&gt;tcp_</p> <p style="margin-top:0px; margin-bottom:10px; padding-top:0px; padding-bottom:0px"> 协议包编解码层次:</p> <p style="margin-top:0px; margin-bottom:10px; padding-top:0px; padding-bottom:0px"> rdp_hdr-&gt;sec_hdr-&gt;mcs_hdr-&gt;iso_hdr-&gt;data,所有这些指针组成一个STREAM.</p> <p style="margin-top:0px; margin-bottom:10px; padding-top:0px; padding-bottom:0px"> view plaincopy to clipboardprint?<br> 01./* Parser state */<br> 02.typedef struct stream<br> 03.{<br> 04. unsigned char *p;<br> 05. unsigned char *end;<br> 06. unsigned char *data;<br> 07. unsigned int size;<br> 08. /* Offsets of various headers */<br> 09. unsigned char *iso_hdr;<br> 10. unsigned char *mcs_hdr;<br> 11. unsigned char *sec_hdr;<br> 12. unsigned char *rdp_hdr;<br> 13.}<br> 14. *STREAM;<br> /* Parser state */<br> typedef struct stream<br> {<br> unsigned char *p;<br> unsigned char *end;<br> unsigned char *data;<br> unsigned int size;<br> /* Offsets of various headers */<br> unsigned char *iso_hdr;<br> unsigned char *mcs_hdr;<br> unsigned char *sec_hdr;<br> unsigned char *rdp_hdr;<br> }<br> *STREAM;</p> <p style="margin-top:0px; margin-bottom:10px; padding-top:0px; padding-bottom:0px"> 主过程:</p> <p style="margin-top:0px; margin-bottom:10px; padding-top:0px; padding-bottom:0px"> 1.rdp_connect: 按照调用层次依次调用sec_connect……,然后调用rdp_send_logon_info发送登录请求验证信息.其中rdp_send_logon_info调用sec_init初始化数据包,调用sec_send发送数据包,根据flags(包含加密标识)调用加密处理逻辑.<br> 2.然后进入rdp_main_loop循环,调用rdp_recv,根据触发的事件类型做相应处理。<br> 3.rdp_disconnect,按照调用层次依次调用sec_disconnect……断开。特殊的,在iso_disconnect中首先调用iso_send_msg(ISO_PDU_DR)发送PDU消息包,然后再调用tcp_disconnect 断开连接。<br> view plaincopy to clipboardprint?<br> 01./* ISO PDU codes */<br> 02.enum ISO_PDU_CODE<br> 03.{<br> 04. ISO_PDU_CR = 0xE0, /* Connection Request */<br> 05. ISO_PDU_CC = 0xD0, /* Connection Confirm */<br> 06. ISO_PDU_DR = 0x80, /* Disconnect Request */<br> 07. ISO_PDU_DT = 0xF0, /* Data */<br> 08. ISO_PDU_ER = 0x70 /* Error */<br> 09.};<br> 10./* MCS PDU codes */<br> 11.enum MCS_PDU_TYPE<br> 12.{<br> 13. MCS_EDRQ = 1, /* Erect Domain Request */<br> 14. MCS_DPUM = 8, /* Disconnect Provider Ultimatum */<br> 15. MCS_AURQ = 10, /* Attach User Request */<br> 16. MCS_AUCF = 11, /* Attach User Confirm */<br> 17. MCS_CJRQ = 14, /* Channel Join Request */<br> 18. MCS_CJCF = 15, /* Channel Join Confirm */<br> 19. MCS_SDRQ = 25, /* Send Data Request */<br> 20. MCS_SDIN = 26 /* Send Data Indication */<br> 21.};<br> /* ISO PDU codes */<br> enum ISO_PDU_CODE<br> {<br> ISO_PDU_CR = 0xE0,/* Connection Request */<br> ISO_PDU_CC = 0xD0,/* Connection Confirm */<br> ISO_PDU_DR = 0x80,/* Disconnect Request */<br> ISO_PDU_DT = 0xF0,/* Data */<br> ISO_PDU_ER = 0x70/* Error */<br> };<br> /* MCS PDU codes */<br> enum MCS_PDU_TYPE<br> {<br> MCS_EDRQ = 1,/* Erect Domain Request */<br> MCS_DPUM = 8,/* Disconnect Provider Ultimatum */<br> MCS_AURQ = 10,/* Attach User Request */<br> MCS_AUCF = 11,/* Attach User Confirm */<br> MCS_CJRQ = 14,/* Channel Join Request */<br> MCS_CJCF = 15,/* Channel Join Confirm */<br> MCS_SDRQ = 25,/* Send Data Request */<br> MCS_SDIN = 26/* Send Data Indication */<br> };<br><br> protocal interface(协议接口):</p> <p style="margin-top:0px; margin-bottom:10px; padding-top:0px; padding-bottom:0px"> view plaincopy to clipboardprint?<br> 01./* rdp.c */<br> 02.void rdp_out_unistr(STREAM s, char *string, int len);<br> 03.void rdp_send_input(uint32 time, uint16 message_type, uint16 device_flags, uint16 param1,<br> 04. uint16 param2);<br> 05.void rdp_main_loop(void);<br> 06.BOOL rdp_connect(char *server, uint32 flags, char *domain, char *password, char *command,<br> 07. char *directory);<br> 08.void rdp_disconnect(void);<br> 09./* secure.c */<br> 10.void sec_hash_48(uint8 * out, uint8 * in, uint8 * salt1, uint8 * salt2, uint8 salt);<br> 11.void sec_hash_16(uint8 * out, uint8 * in, uint8 * salt1, uint8 * salt2);<br> 12.void buf_out_uint32(uint8 * buffer, uint32 value);<br> 13.void sec_sign(uint8 * signature, int siglen, uint8 * session_key, int keylen, uint8 * data,<br> 14. int datalen);<br> 15.STREAM sec_init(uint32 flags, int maxlen);<br> 16.void sec_send(STREAM s, uint32 flags);<br> 17.STREAM sec_recv(void);<br> 18.BOOL sec_connect(char *server);<br> 19.void sec_disconnect(void);<br> 20./* mcs.c */<br> 21.STREAM mcs_init(int length);<br> 22.void mcs_send(STREAM s);<br> 23.STREAM mcs_recv(void);<br> 24.BOOL mcs_connect(char *server, STREAM mcs_data);<br> 25.void mcs_disconnect(void);<br> 26./* iso.c */<br> 27.STREAM iso_init(int length);<br> 28.void iso_send(STREAM s);<br> 29.STREAM iso_recv(void);<br> 30.BOOL iso_connect(char *server);<br> 31.void iso_disconnect(void);<br> 32./* tcp.c */<br> 33.STREAM tcp_init(int maxlen);<br> 34.void tcp_send(STREAM s);<br> 35.STREAM tcp_recv(int length);<br> 36.BOOL tcp_connect(char *server);<br> 37.void tcp_disconnect(void);<br> /* rdp.c */<br> void rdp_out_unistr(STREAM s, char *string, int len);<br> void rdp_send_input(uint32 time, uint16 message_type, uint16 device_flags, uint16 param1,<br> uint16 param2);<br> void rdp_main_loop(void);<br> BOOL rdp_connect(char *server, uint32 flags, char *domain, char *password, char *command,<br> char *directory);<br> void rdp_disconnect(void);<br> /* secure.c */<br> void sec_hash_48(uint8 * out, uint8 * in, uint8 * salt1, uint8 * salt2, uint8 salt);<br> void sec_hash_16(uint8 * out, uint8 * in, uint8 * salt1, uint8 * salt2);<br> void buf_out_uint32(uint8 * buffer, uint32 value);<br> void sec_sign(uint8 * signature, int siglen, uint8 * session_key, int keylen, uint8 * data,<br> int datalen);<br> STREAM sec_init(uint32 flags, int maxlen);<br> void sec_send(STREAM s, uint32 flags);<br> STREAM sec_recv(void);<br> BOOL sec_connect(char *server);<br> void sec_disconnect(void);<br> /* mcs.c */<br> STREAM mcs_init(int length);<br> void mcs_send(STREAM s);<br> STREAM mcs_recv(void);<br> BOOL mcs_connect(char *server, STREAM mcs_data);<br> void mcs_disconnect(void);<br> /* iso.c */<br> STREAM iso_init(int length);<br> void iso_send(STREAM s);<br> STREAM iso_recv(void);<br> BOOL iso_connect(char *server);<br> void iso_disconnect(void);<br> /* tcp.c */<br> STREAM tcp_init(int maxlen);<br> void tcp_send(STREAM s);<br> STREAM tcp_recv(int length);<br> BOOL tcp_connect(char *server);<br> void tcp_disconnect(void);</p> <p style="margin-top:0px; margin-bottom:10px; padding-top:0px; padding-bottom:0px"> </p> <p style="margin-top:0px; margin-bottom:10px; padding-top:0px; padding-bottom:0px"> ui interface(UI接口)</p> <p style="margin-top:0px; margin-bottom:10px; padding-top:0px; padding-bottom:0px"> view plaincopy to clipboardprint?<br> 01./* xkeymap.c */<br> 02.void xkeymap_init(void);<br> 03.BOOL handle_special_keys(uint32 keysym, unsigned int state, uint32 ev_time, BOOL pressed);<br> 04.key_translation xkeymap_translate_key(uint32 keysym, unsigned int keycode, unsigned int state);<br> 05.uint16 xkeymap_translate_button(unsigned int button);<br> 06.char *get_ksname(uint32 keysym);<br> 07.void ensure_remote_modifiers(uint32 ev_time, key_translation tr);<br> 08.void reset_modifier_keys(unsigned int state);<br> 09.void rdp_send_scancode(uint32 time, uint16 flags, uint8 scancode);<br> 10./* xwin.c */<br> 11.void mwm_hide_decorations(void);<br> 12.BOOL get_key_state(unsigned int state, uint32 keysym);<br> 13.BOOL ui_init(void);<br> 14.void ui_deinit(void);<br> 15.BOOL ui_create_window(void);<br> 16.void ui_destroy_window(void);<br> 17.void xwin_toggle_fullscreen(void);<br> 18.int ui_select(int rdp_socket);<br> 19.void ui_move_pointer(int x, int y);<br> 20.HBITMAP ui_create_bitmap(int width, int height, uint8 * data);<br> 21.void ui_paint_bitmap(int x, int y, int cx, int cy, int width, int height, uint8 * data);<br> 22.void ui_destroy_bitmap(HBITMAP bmp);<br> 23.HGLYPH ui_create_glyph(int width, int height, uint8 * data);<br> 24.void ui_destroy_glyph(HGLYPH glyph);<br> 25.HCURSOR ui_create_cursor(unsigned int x, unsigned int y, int width, int height, uint8 * andmask,<br> 26. uint8 * xormask);<br> 27.void ui_set_cursor(HCURSOR cursor);<br> 28.void ui_destroy_cursor(HCURSOR cursor);<br> 29.HCOLOURMAP ui_create_colourmap(COLOURMAP * colours);<br> 30.void ui_destroy_colourmap(HCOLOURMAP map);<br> 31.void ui_set_colourmap(HCOLOURMAP map);<br> 32.void ui_set_clip(int x, int y, int cx, int cy);<br> 33.void ui_reset_clip(void);<br> 34.void ui_bell(void);<br> 35.void ui_destblt(uint8 opcode, int x, int y, int cx, int cy);<br> 36.void ui_patblt(uint8 opcode, int x, int y, int cx, int cy, BRUSH * brush, int bgcolour,<br> 37. int fgcolour);<br> 38.void ui_screenblt(uint8 opcode, int x, int y, int cx, int cy, int srcx, int srcy);<br> 39.void ui_memblt(uint8 opcode, int x, int y, int cx, int cy, HBITMAP src, int srcx, int srcy);<br> 40.void ui_triblt(uint8 opcode, int x, int y, int cx, int cy, HBITMAP src, int srcx, int srcy,<br> 41. BRUSH * brush, int bgcolour, int fgcolour);<br> 42.void ui_line(uint8 opcode, int startx, int starty, int endx, int endy, PEN * pen);<br> 43.void ui_rect(int x, int y, int cx, int cy, int colour);<br> 44.void ui_draw_glyph(int mixmode, int x, int y, int cx, int cy, HGLYPH glyph, int srcx, int srcy,<br> 45. int bgcolour, int fgcolour);<br> 46.void ui_draw_text(uint8 font, uint8 flags, int mixmode, int x, int y, int clipx, int clipy,<br> 47. int clipcx, int clipcy, int boxx, int boxy, int boxcx, int boxcy, int bgcolour,<br> 48. int fgcolour, uint8 * text, uint8 length);<br> 49.void ui_desktop_save(uint32 offset, int x, int y, int cx, int cy);<br> 50.void ui_desktop_restore(uint32 offset, int x, int y, int cx, int cy);<br> /* xkeymap.c */<br> void xkeymap_init(void);<br> BOOL handle_special_keys(uint32 keysym, unsigned int state, uint32 ev_time, BOOL pressed);<br> key_translation xkeymap_translate_key(uint32 keysym, unsigned int keycode, unsigned int state);<br> uint16 xkeymap_translate_button(unsigned int button);<br> char *get_ksname(uint32 keysym);<br> void ensure_remote_modifiers(uint32 ev_time, key_translation tr);<br> void reset_modifier_keys(unsigned int state);<br> void rdp_send_scancode(uint32 time, uint16 flags, uint8 scancode);<br> /* xwin.c */<br> void mwm_hide_decorations(void);<br> BOOL get_key_state(unsigned int state, uint32 keysym);<br> BOOL ui_init(void);<br> void ui_deinit(void);<br> BOOL ui_create_window(void);<br> void ui_destroy_window(void);<br> void xwin_toggle_fullscreen(void);<br> int ui_select(int rdp_socket);<br> void ui_move_pointer(int x, int y);<br> HBITMAP ui_create_bitmap(int width, int height, uint8 * data);<br> void ui_paint_bitmap(int x, int y, int cx, int cy, int width, int height, uint8 * data);<br> void ui_destroy_bitmap(HBITMAP bmp);<br> HGLYPH ui_create_glyph(int width, int height, uint8 * data);<br> void ui_destroy_glyph(HGLYPH glyph);<br> HCURSOR ui_create_cursor(unsigned int x, unsigned int y, int width, int height, uint8 * andmask,<br> uint8 * xormask);<br> void ui_set_cursor(HCURSOR cursor);<br> void ui_destroy_cursor(HCURSOR cursor);<br> HCOLOURMAP ui_create_colourmap(COLOURMAP * colours);<br> void ui_destroy_colourmap(HCOLOURMAP map);<br> void ui_set_colourmap(HCOLOURMAP map);<br> void ui_set_clip(int x, int y, int cx, int cy);<br> void ui_reset_clip(void);<br> void ui_bell(void);<br> void ui_destblt(uint8 opcode, int x, int y, int cx, int cy);<br> void ui_patblt(uint8 opcode, int x, int y, int cx, int cy, BRUSH * brush, int bgcolour,<br> int fgcolour);<br> void ui_screenblt(uint8 opcode, int x, int y, int cx, int cy, int srcx, int srcy);<br> void ui_memblt(uint8 opcode, int x, int y, int cx, int cy, HBITMAP src, int srcx, int srcy);<br> void ui_triblt(uint8 opcode, int x, int y, int cx, int cy, HBITMAP src, int srcx, int srcy,<br> BRUSH * brush, int bgcolour, int fgcolour);<br> void ui_line(uint8 opcode, int startx, int starty, int endx, int endy, PEN * pen);<br> void ui_rect(int x, int y, int cx, int cy, int colour);<br> void ui_draw_glyph(int mixmode, int x, int y, int cx, int cy, HGLYPH glyph, int srcx, int srcy,<br> int bgcolour, int fgcolour);<br> void ui_draw_text(uint8 font, uint8 flags, int mixmode, int x, int y, int clipx, int clipy,<br> int clipcx, int clipcy, int boxx, int boxy, int boxcx, int boxcy, int bgcolour,<br> int fgcolour, uint8 * text, uint8 length);<br> void ui_desktop_save(uint32 offset, int x, int y, int cx, int cy);<br> void ui_desktop_restore(uint32 offset, int x, int y, int cx, int cy);<br></p> <p style="margin-top:0px; margin-bottom:10px; padding-top:0px; padding-bottom:0px"> 其中,ui_select是整个UI的核心,负责UI调度。</p> <p style="margin-top:0px; margin-bottom:10px; padding-top:0px; padding-bottom:0px"> cache interface(缓存接口)</p> <p style="margin-top:0px; margin-bottom:10px; padding-top:0px; padding-bottom:0px"> view plaincopy to clipboardprint?<br> 01./* bitmap.c */<br> 02.BOOL bitmap_decompress(unsigned char *output, int width, int height, unsigned char *input,<br> 03. int size);<br> 04./* cache.c */<br> 05.HBITMAP cache_get_bitmap(uint8 cache_id, uint16 cache_idx);<br> 06.void cache_put_bitmap(uint8 cache_id, uint16 cache_idx, HBITMAP bitmap);<br> 07.FONTGLYPH *cache_get_font(uint8 font, uint16 character);<br> 08.void cache_put_font(uint8 font, uint16 character, uint16 offset, uint16 baseline, uint16 width,<br> 09. uint16 height, HGLYPH pixmap);<br> 10.DATABLOB *cache_get_text(uint8 cache_id);<br> 11.void cache_put_text(uint8 cache_id, void *data, int length);<br> 12.uint8 *cache_get_desktop(uint32 offset, int cx, int cy, int bytes_per_pixel);<br> 13.void cache_put_desktop(uint32 offset, int cx, int cy, int scanline, int bytes_per_pixel,<br> 14. uint8 * data);<br> 15.HCURSOR cache_get_cursor(uint16 cache_idx);<br> 16.void cache_put_cursor(uint16 cache_idx, HCURSOR cursor);<br> 17./* ewmhints.c */<br> 18.int get_current_workarea(uint32 * x, uint32 * y, uint32 * width, uint32 * height);<br> /* bitmap.c */<br> BOOL bitmap_decompress(unsigned char *output, int width, int height, unsigned char *input,<br> int size);<br> /* cache.c */<br> HBITMAP cache_get_bitmap(uint8 cache_id, uint16 cache_idx);<br> void cache_put_bitmap(uint8 cache_id, uint16 cache_idx, HBITMAP bitmap);<br> FONTGLYPH *cache_get_font(uint8 font, uint16 character);<br> void cache_put_font(uint8 font, uint16 character, uint16 offset, uint16 baseline, uint16 width,<br> uint16 height, HGLYPH pixmap);<br> DATABLOB *cache_get_text(uint8 cache_id);<br> void cache_put_text(uint8 cache_id, void *data, int length);<br> uint8 *cache_get_desktop(uint32 offset, int cx, int cy, int bytes_per_pixel);<br> void cache_put_desktop(uint32 offset, int cx, int cy, int scanline, int bytes_per_pixel,<br> uint8 * data);<br> HCURSOR cache_get_cursor(uint16 cache_idx);<br> void cache_put_cursor(uint16 cache_idx, HCURSOR cursor);<br> /* ewmhints.c */<br> int get_current_workarea(uint32 * x, uint32 * y, uint32 * width, uint32 * height);</p> <p style="margin-top:0px; margin-bottom:10px; padding-top:0px; padding-bottom:0px"> licence证书处理</p> <p style="margin-top:0px; margin-bottom:10px; padding-top:0px; padding-bottom:0px"> view plaincopy to clipboardprint?<br> 01./* licence.c */<br> 02.void licence_process(STREAM s);<br> /* licence.c */<br> void licence_process(STREAM s);</p> <p style="margin-top:0px; margin-bottom:10px; padding-top:0px; padding-bottom:0px"> 主进程函数</p> <p style="margin-top:0px; margin-bottom:10px; padding-top:0px; padding-bottom:0px"> view plaincopy to clipboardprint?<br> 01./* rdesktop.c */<br> 02.int main(int argc, char *argv[]);<br> 03.void generate_random(uint8 * random);<br> 04.void *xmalloc(int size);<br> 05.void *xrealloc(void *oldmem, int size);<br> 06.void xfree(void *mem);<br> 07.void error(char *format, ...);<br> 08.void warning(char *format, ...);<br> 09.void unimpl(char *format, ...);<br> 10.void hexdump(unsigned char *p, unsigned int len);<br> /* rdesktop.c */<br> int main(int argc, char *argv[]);<br> void generate_random(uint8 * random);<br> void *xmalloc(int size);<br> void *xrealloc(void *oldmem, int size);<br> void xfree(void *mem);<br> void error(char *format, ...);<br> void warning(char *format, ...);<br> void unimpl(char *format, ...);<br> void hexdump(unsigned char *p, unsigned int len);</p> <p style="margin-top:0px; margin-bottom:10px; padding-top:0px; padding-bottom:0px"> 次序处理:</p> <p style="margin-top:0px; margin-bottom:10px; padding-top:0px; padding-bottom:0px"> view plaincopy to clipboardprint?<br> 01./* orders.c */<br> 02.void process_orders(STREAM s);<br> 03.void reset_order_state(void);<br> /* orders.c */<br> void process_orders(STREAM s);<br> void reset_order_state(void);</p> <p style="margin-top:0px; margin-bottom:10px; padding-top:0px; padding-bottom:0px"> 协议数据包:</p> <p style="margin-top:0px; margin-bottom:10px; padding-top:0px; padding-bottom:0px"> view plaincopy to clipboardprint?<br> 01.128-bit encryption enabled<br> 02.Sending encrypted packet:<br> 03.0000 00 00 00 00 33 00 00 00 00 00 1a 00 00 00 00 00 ....3...........<br> 04.0010 00 00 00 00 41 00 64 00 6d 00 69 00 6e 00 69 00 ....A.d.m.i.n.i.<br> 05.0020 73 00 74 00 72 00 61 00 74 00 6f 00 72 00 00 00 s.t.r.a.t.o.r...<br> 06.0030 00 00 00 00 00 00 ......<br> 07.Connection successful.<br> 08.Sending encrypted packet:<br> 09.0000 22 00 17 00 ec 03 00 00 00 00 00 01 14 00 1c 00 "...............<br> 10.0010 00 00 01 00 00 00 11 4e 7a 4b 01 80 00 08 cf 01 .......NzK......<br> 11.0020 91 00 ..<br> 12.Sending encrypted packet:<br> 13.0000 22 00 17 00 ec 03 00 00 00 00 00 01 14 00 1c 00 "...............<br> 14.0010 00 00 01 00 00 00 12 4e 7a 4b 01 80 00 08 cf 01 .......NzK......<br> 15.0020 91 00 ..<br> 16.RDP packet (type 1):<br> 17.0000 67 01 11 00 ea 03 ea 03 01 00 04 00 51 01 52 44 g...........Q.RD<br> 18.0010 50 00 0d 00 00 00 09 00 08 00 ea 03 65 e3 01 00 P...........e...<br> 19.0020 18 00 01 00 03 00 00 02 00 00 00 00 1d 04 00 00 ................<br> 20.0030 00 00 00 00 01 01 14 00 08 00 02 00 00 00 16 00 ................<br> 21.0040 28 00 01 00 00 00 6c 96 33 b7 01 00 00 00 95 a4 (.....l.3.......<br> 22.0050 84 80 b0 7d 38 84 b8 5b c4 e1 f4 96 33 b7 ea e8 ...}8..[....3...<br> 23.0060 84 80 20 02 c9 85 0e 00 04 00 02 00 1c 00 08 00 .. .............<br> 24.0070 01 00 01 00 01 00 c0 03 e9 02 00 00 01 00 01 00 ................<br> 25.0080 00 00 01 00 00 00 03 00 58 00 00 00 00 00 00 00 ........X.......<br> 26.0090 00 00 00 00 00 00 00 00 00 00 40 42 0f 00 01 00<a rel="nofollow" href="mailto:..........@B" style="color:rgb(71,59,52); text-decoration:none"><span style="color:rgb(0,0,0)">..........@B</span></a>....<br> 27.00a0 14 00 00 00 01 00 00 00 22 00 01 01 01 01 01 00 ........".......<br> 28.00b0 00 01 01 01 01 01 00 00 00 01 01 01 01 01 01 01 ................<br> 29.00c0 01 00 01 01 01 01 00 00 00 00 a1 06 00 00 40 42<a rel="nofollow" href="mailto:..............@B" style="color:rgb(71,59,52); text-decoration:none"><span style="color:rgb(0,0,0)">..............@B</span></a><br> 30.00d0 0f 00 40 42 0f 00 01 00 00 00 00 00 00 00 0a 00<a rel="nofollow" href="mailto:..@B" style="color:rgb(71,59,52); text-decoration:none"><span style="color:rgb(0,0,0)">..@B</span></a>............<br> 31.00e0 08 00 06 00 00 00 12 00 08 00 01 00 00 00 08 00 ................<br> 32.00f0 0a 00 01 00 19 00 19 00 0d 00 58 00 35 00 00 00 ..........X.5...<br> 33.0100 a1 06 00 00 40 42 0f 00 0c 96 33 b7 75 7a 6f b7<a rel="nofollow" href="mailto:....@B....3.uzo" style="color:rgb(71,59,52); text-decoration:none"><span style="color:rgb(0,0,0)">....@B....3.uzo</span></a>.<br> 34.0110 00 40 43 e1 48 3c 70 b7 40 96 33 b7 04 00 00 00<a rel="nofollow" href="mailto:.@C.H%3Cp.@.3" style="color:rgb(71,59,52); text-decoration:none"><span style="color:rgb(0,0,0)">.@C.H&lt;p.@.3</span></a>.....<br> 35.0120 4c 34 65 e3 08 30 65 e3 01 00 00 00 08 30 65 e3 L4e..0e......0e.<br> 36.0130 00 00 00 00 38 96 33 b7 42 25 70 b7 08 30 65 e3 ....8.3.B%p..0e.<br> 37.0140 2c 96 33 b7 00 00 00 00 08 00 0a 00 01 00 19 00 ,.3.............<br> 38.0150 17 00 08 00 00 00 00 00 18 00 0b 00 00 00 00 00 ................<br> 39.0160 00 00 00 00 00 00 00 .......<br> 40.DEMAND_ACTIVE(id=0x103ea)<br> 41.Sending encrypted packet:<br> 42.0000 9a 01 13 00 ec 03 ea 03 01 00 ea 03 06 00 84 01 ................<br> 43.0010 4d 53 54 53 43 00 0d 00 00 00 01 00 18 00 01 00 MSTSC...........<br> 44.0020 03 00 00 02 00 00 00 00 00 00 00 00 00 00 00 00 ................<br> 45.0030 00 00 02 00 1c 00 08 00 01 00 01 00 01 00 20 03 .............. .<br> 46.0040 58 02 00 00 00 00 01 00 00 00 01 00 00 00 03 00 X...............<br> 47.0050 58 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 X...............<br> 48.0060 00 00 00 00 00 00 01 00 14 00 00 00 01 00 47 01 ..............G.<br> 49.0070 2a 00 01 01 01 01 00 00 00 00 01 01 01 01 00 01 *...............<br> 50.0080 01 00 00 00 00 00 00 00 01 00 00 00 00 01 00 00 ................<br> 51.0090 00 00 a1 06 00 00 00 00 00 00 00 84 03 00 00 00 ................<br> 52.00a0 00 00 e4 04 00 00 04 00 28 00 00 00 00 00 00 00 ........(.......<br> 53.00b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................<br> 54.00c0 00 00 58 02 00 01 2c 01 00 04 06 01 00 10 0a 00 ..X...,.........<br> 55.00d0 08 00 06 00 00 00 07 00 0c 00 00 00 00 00 00 00 ................<br> 56.00e0 00 00 05 00 0c 00 00 00 00 00 02 00 02 00 08 00 ................<br> 57.00f0 08 00 00 00 14 00 09 00 08 00 00 00 00 00 0d 00 ................<br> 58.0100 58 00 01 00 00 00 09 04 00 00 04 00 00 00 00 00 X...............<br> 59.0110 00 00 0c 00 00 00 00 00 00 00 00 00 00 00 00 00 ................<br> 60.0120 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................<br> 61.0130 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................<br> 62.0140 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................<br> 63.0150 00 00 00 00 00 00 0c 00 08 00 01 00 00 00 0e 00 ................<br> 64.0160 08 00 01 00 00 00 10 00 34 00 fe 00 04 00 fe 00 ........4.......<br> 65.0170 04 00 fe 00 08 00 fe 00 08 00 fe 00 10 00 fe 00 ................<br> 66.0180 20 00 fe 00 40 00 fe 00 80 00 fe 00 00 01 40 00 ...@.........@.<br> 67.0190 00 08 00 01 00 01 02 00 00 00 ..........<br> 68.RDP packet (type 7):<br> 69.0000 6d 00 17 00 ea 03 ea 03 01 00 3b 02 6d 00 02 00 m.........;.m...<br> 70.0010 00 00 00 00 75 20 08 00 bb 3e 15 4a 01 50 21 44 ....u ...&gt;.J.P!D<br> 71.0020 21 23 01 00 00 15 4a 01 50 3f 40 3f 01 ff 01 00 !#....J.P?@?....<br> 72.0030 15 02 01 50 40 40 40 02 00 15 02 01 50 40 40 40<a rel="nofollow" href="mailto:...P@@@.....P" style="color:rgb(71,59,52); text-decoration:none"><span style="color:rgb(0,0,0)">...P@@@.....P</span></a>@@@<br> 73.0040 03 00 15 02 01 50 40 40 40 01 00 15 0a 01 50 40<a rel="nofollow" href="mailto:.....P@@@.....P" style="color:rgb(71,59,52); text-decoration:none"><span style="color:rgb(0,0,0)">.....P@@@.....P</span></a>@<br> 74.0050 2f 40 ef 04 00 45 4a 05 12 01 22 01 12 01 11 00<a rel="nofollow">/@...EJ</a>...".....<br> 75.0060 2f 00 15 4a 01 50 11 1c 11 0b d1 05 00 /..J.P.......<br> 76.MEMBLT(op=0xcc,x=319,y=297,cx=63,cy=5,id=1,idx=0)<br> 77.MEMBLT(op=0xcc,x=382,y=297,cx=64,cy=5,id=1,idx=1)<br> 78.MEMBLT(op=0xcc,x=446,y=297,cx=64,cy=5,id=1,idx=2)<br> 79.MEMBLT(op=0xcc,x=510,y=297,cx=64,cy=5,id=1,idx=3)<br> 80.MEMBLT(op=0xcc,x=574,y=297,cx=64,cy=5,id=1,idx=1)<br> 81.MEMBLT(op=0xcc,x=638,y=297,cx=47,cy=5,id=1,idx=4)<br> 82.MEMBLT(op=0xcc,x=274,y=297,cx=17,cy=5,id=1,idx=4)<br> 83.MEMBLT(op=0xcc,x=291,y=297,cx=28,cy=5,id=1,idx=5)<br> 84.RDP packet (type 7):<br> 85.0000 1e 00 17 00 ea 03 ea 03 01 00 04 02 1e 00 02 00 ................<br> 86.0010 00 00 00 00 85 7e 01 00 d5 f5 19 0b 20 01 .....~...... .<br> 87.DESKSAVE(l=271,t=200,r=687,b=343,off=0,op=1)<br> 88.RDP packet (type 6):<br> 89.0000 0d 00 16 00 ea 03 ea 03 01 00 01 00 00 .............<br> 90.Disconnecting...</p> </div> </div> <div class="nbw-blog-end" style="color:rgb(71,59,52); font-family:Arial,Helvetica,simsun,u5b8bu4f53; background-color:rgb(246,244,243)"> </div> <div style="color:rgb(71,59,52); font-family:Arial,Helvetica,simsun,u5b8bu4f53; background-color:rgb(246,244,243)"> </div> <div style="color:rgb(71,59,52); font-family:Arial,Helvetica,simsun,u5b8bu4f53; background-color:rgb(246,244,243)"> </div> <div style="color:rgb(71,59,52); font-family:Arial,Helvetica,simsun,u5b8bu4f53; background-color:rgb(246,244,243)"> <div class="wumii-hook"></div> </div> <div class="nbw-act tbar fc03 clearfix" style="zoom:1; margin:5px 0px; padding:10px 10px 10px 0px; text-align:right; color:rgb(71,59,52); line-height:20px; font-family:Arial,Helvetica,simsun,u5b8bu4f53; background-color:rgb(246,244,243)"> <div style="height:24px; line-height:24px"> <div class="pleft rdif" style="float:left; height:24px"><br></div> </div> </div> <br><p></p> <p><span style="color:rgb(71,59,52); font-family:Arial,Helvetica,simsun,u5b8bu4f53; font-size:14px; line-height:25px; background-color:rgb(246,244,243)"><br></span></p> </wbr>
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小蓝xlanll/article/detail/651458
推荐阅读
相关标签
  

闽ICP备14008679号