RDP text is displayed by using glyph caching. Almost immediately, the client builds up the required set of glyphs, and the server needs only transmit a short hash value to display the text.
可能有关的代码:
#define DO_GLYPH(ttext,idx) /
{/
glyph = cache_get_font (font, ttext[idx]);/
if (!(flags & TEXT2_IMPLICIT_X))/
{/
xyoffset = ttext[++idx];/
if ((xyoffset & 0x80))/
{/
if (flags & TEXT2_VERTICAL)/
y += ttext[idx+1] | (ttext[idx+2] << 8);/
else/
x += ttext[idx+1] | (ttext[idx+2] << 8);/
idx += 2;/
}/
else/
{/
if (flags & TEXT2_VERTICAL)/
y += xyoffset;/
else/
x += xyoffset;/
}/
}/
if (glyph != NULL)/
{/
x1 = x + glyph->offset;/
y1 = y + glyph->baseline;/
XSetStipple(g_display, g_gc, (Pixmap) glyph->pixmap);/
XSetTSOrigin(g_display, g_gc, x1, y1);/
FILL_RECTANGLE_BACKSTORE(x1, y1, glyph->width, glyph->height);/
if (flags & TEXT2_IMPLICIT_X)/
x += glyph->width;/
}/
}
然后,又找到了 一处:
4 Rather than using font negotiation, RDP implements a glyph and fragment caching mechanism. A glyph is a bitmap representation of a character and its font information. For example, the character "A" in Times New Roman is represented by a different glyph than the character "A" in Arial. The use of glyphs allows characters to be displayed precisely regardless of the client operating systems and the locally installed fonts. A string of glyphs is called a 'fragment'. Because glyphs and fragments are cached locally at the client, the server improves bandwidth utilization by not resending the same glyphs. Instead, it tells the client to reuse a cached glyph or fragment.
字符串实际传递的还是字型的点阵,点阵实际是一个位图,也就是说,字符串的内容是无法简单识别的.文档中也说明了,文本所以不直接传递纯文本,第一是不安全,文本中可能包含敏感信息而被黑客盗用.第二是使用位图点阵,可以保证不同的操作系统可以得到相同的显示结果.
看来,取得文本内容的努力算是失败了?