<?xml version="1.0" encoding="utf-8" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<atom:link href="http://icylife.net/yunshu/rss.php" rel="self" type="application/rss+xml" />
		<title>心路</title>
		<link>http://www.icylife.net/yunshu</link>
		<description>心路</description>
		<language>zh-cn</language>
		<item>
			<title><![CDATA[蒲松龄论Gay]]></title>
			<category>八卦</category>
			<author>wustyunshu@yahoo.com.cn(云舒)</author>
			<link>http://www.icylife.net/yunshu/show.php?id=627</link>
			<guid>http://www.icylife.net/yunshu/show.php?id=627</guid>
			<description>
				<![CDATA[
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;摘要：《画皮》炒得火热，我也发一段狐狸精的，有狐女，有gay，有双性恋，比《画皮》要精彩吧？更何况，后面还有蒲松龄的点评。小说较长，就发点评部分，文采飞扬啊，而且用了大量的隐喻，翻译出来是要走味的，看得懂的就看。看不懂，google一下吧。</p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 这篇小说是《黄九郎》，下面摘录蒲松龄评Gay：</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;男女居室，为夫妇之大伦；燥湿互通，乃阴阳之正窍。迎风待月，尚有荡检之讥；断袖分桃，难免掩鼻之丑。人必力士，鸟道乃敢生开；洞非桃源，渔篙宁许误人？ 今某从下流而忘返，舍正路而不由。云雨未兴，辄尔上下其手；阴阳反背，居然表里为奸。华池置无用之乡，谬说老僧入定；蛮洞乃不毛之地，遂使眇帅称戈。系赤 兔于辕门，如将射戟；探大弓于国库，直欲斩关。或是监内黄鳣，访知交于昨夜；分明王家朱李，索钻报于来生。彼黑松林戎马顿来，固相安矣；设黄龙府潮水忽 至，何以御之？宜断其钻刺之恨，兼塞其送迎之路。</p>
				]]>
			</description>
			<pubDate>Thu, 09 Oct 2008 13:27:15 +0800</pubDate>
		</item>
		<item>
			<title><![CDATA[《国家健康报告》之国家责任指数]]></title>
			<category>八卦</category>
			<author>wustyunshu@yahoo.com.cn(云舒)</author>
			<link>http://www.icylife.net/yunshu/show.php?id=626</link>
			<guid>http://www.icylife.net/yunshu/show.php?id=626</guid>
			<description>
				<![CDATA[
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;转自网易新闻，地址为<a target="_blank" href="http://news.163.com/08/1008/00/4NMMLK7M0001124J.html">http://news.163.com/08/1008/00/4NMMLK7M0001124J.html</a></p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 摘要：中国科学院7日发布世界首个《国家健康报告》，其全球&ldquo;国家责任指数&rdquo;排行榜显示，在全球四十五个样本国家中，中国以零点七四名列第一，美国以零点三二居倒数第一位。此外，除北欧国家外，发达国家的国家责任排名普遍靠后。</p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;中新社北京十月七日电 <span style="color: rgb(255,0,0)">中国科学院国家健康研究课题组</span>七日在北京正式发布世界首个《<span style="color: rgb(255,0,0)">国家健康报告</span>》，其全球&ldquo;<span style="color: rgb(255,0,0)">国家责任指数</span>&rdquo;排行榜显示，在全球四十五个样本国家中，<span style="color: rgb(255,0,0)">中国以零点七四名列第一，美国以零点三二居倒数第一位。</span><br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;一个健康的国家，必然是一个负责任的国家。在全球化时代，一个国家不仅要为其国民的生存、发展、安全、健康、幸福生活和可持续发展承担和履行责任，同时，国家作为国际社会中的一员，出于道义和社会责任，应为全人类的安全、健康、幸福和可持续发展承担和履行责任，这两方面即构成国家责任。<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;中科院《国家健康报告》从裁减军备、消除贫困、发展援助、资源节约和保护环境等方面，对全球四十五个样本国家的国家责任进行评估，结果中国、墨西哥、巴西、泰国、菲律宾居前五名，排最后五位的分别是英国、意大利、以色列、新加坡、美国。<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;在全球&ldquo;国家责任指数&rdquo;排行榜中，除北欧国家外，发达国家的国家责任排名普遍靠后。中科院国家健康课题组指出，发达国家不负责任导致联合国&ldquo;千年发展目标&rdquo;难以实现，因此，各国尤其是发达国家，应切实履行相应国家责任，更好地加强合作，推动并保证&ldquo;千年发展目标&rdquo;得以如期实现。<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;中科院国家健康课题组组长杨多贵还特别提出，当今世界，美国在国家财富和国家力量两个方面都是名符其实的&ldquo;大哥大&rdquo;，但由于其贪婪地追求经济利益和国家霸权，忽视国家道德、责任和信用，招来&ldquo;次贷危机&rdquo;之祸。随着次贷危机由金融系统向美国实体经济系统传递，将不可避免地导致美国国家健康持续恶化。</p>
				]]>
			</description>
			<pubDate>Wed, 08 Oct 2008 12:27:49 +0800</pubDate>
		</item>
		<item>
			<title><![CDATA[时光]]></title>
			<category>琐记</category>
			<author>wustyunshu@yahoo.com.cn(云舒)</author>
			<link>http://www.icylife.net/yunshu/show.php?id=625</link>
			<guid>http://www.icylife.net/yunshu/show.php?id=625</guid>
			<description>
				<![CDATA[
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 国庆回家了一趟，可惜时间太紧，没有和爸爸一起回老家去，而爸爸也仅仅在老家呆了5个小时，不过他还记得帮我去看了我想看的东西。</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1990年的时候，我在我家的稻田边种了三棵桃树，长大之后我每年都有很多桃可以吃。不过最后一次见它们，是大四毕业的那年。那时候它们已经有两棵枯萎了，还有最后一棵，在挣扎着活着。这次爸爸回来告诉我，那里已经没有一点桃树的痕迹了，和未种之前一样。也许等到我也消逝了，就不会有人知道在那快普通的土地上，也曾经有过那么茂盛那么有生命力的桃树。</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 还好我95年种下的一棵四季青，依旧葱绿，比我高得太多。当年我在大冬天的把它挖出来种到我家旁边，现在就扎根在那里了。记得当初挖这棵小树苗的时候，还挖出了一条冬眠的小蛇。要是没死的话，现在该快幻化成人形了吧？那时候我养的三条狗，现在也转世成人了么？</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 希望明年国庆，能够回老家一趟，看看我家的老板栗树。比我年龄还大的板栗树，从我小时候就陪伴着我。我知道，它应该也已经时日无多了吧&hellip;&hellip;</p>
				]]>
			</description>
			<pubDate>Tue, 07 Oct 2008 20:08:24 +0800</pubDate>
		</item>
		<item>
			<title><![CDATA[CCProxy 6.61栈溢出？]]></title>
			<category>技术</category>
			<author>wustyunshu@yahoo.com.cn(云舒)</author>
			<link>http://www.icylife.net/yunshu/show.php?id=624</link>
			<guid>http://www.icylife.net/yunshu/show.php?id=624</guid>
			<description>
				<![CDATA[
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;绿盟的漏洞公告，<a href="http://www.nsfocus.net/vulndb/12436" target="_blank">http://www.nsfocus.net/vulndb/12436</a>，今天抽空看了一下。似乎不是一个常规的栈溢出漏洞，超长的主机名并没有覆盖到RET或者SEH之类的东西，不过可以控制到EAX，仔细调整往下走或许能够找到call的地方。</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 这个漏洞跟起来有点烦，我也没细细看。主要是有两个地方比较有意思，第一个是超长主机名传过去之后，CCProxy会解析成IP地址，这个肯定是解析不到的，因此会抛出一个异常。这个异常是程序自己抛出自己接管的，所以F8走下去就可以了，不用担心。第二个是EAX被控制之后，第一次会尝试读，内存没有映射读不到，所以会引发异常。这个异常由系统处理，但是在处理的时候，又会写EAX，同样写是写不到的，出现无法处理的异常，程序当掉。</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 也就是说，可能会有两次机会来执行指令。找一个可读的地址，或者可写的EAX都可以。在读EAX失败异常之后，会跳到写EAX的地方，还有最后一次机会。至于是不是真的可以，我就不知道了。</p>
				]]>
			</description>
			<pubDate>Tue, 07 Oct 2008 17:16:33 +0800</pubDate>
		</item>
		<item>
			<title><![CDATA[流水账一个]]></title>
			<category>琐记</category>
			<author>wustyunshu@yahoo.com.cn(云舒)</author>
			<link>http://www.icylife.net/yunshu/show.php?id=623</link>
			<guid>http://www.icylife.net/yunshu/show.php?id=623</guid>
			<description>
				<![CDATA[
<p>摘要：听了几首钢琴曲之后，困得很，来一首《英雄的黎明》振奋一下，顺便写点流水账。</p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;昨天又做了一件糗事。下班了有些累，打车回家。结果到小区门口下车的时候，一摸口袋，没钱&hellip;&hellip;上次这样还是05年在绿盟的时候。只能让司机接着往前开，找到路边的ATM取款付账。下次打车之前一定要先摸摸口袋，唉。</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 另外的事情，就是游戏了。因为国庆节要回家，我弟弟提前就告诉我把红警下好，回去和他打。好几年没玩过了，下载回来安装，破解，汉化，升级，都搞定之后，忍不住找电脑练练手。当年大学的时候实力还是很强的，在网吧无敌，无战网上也是胜多败少。以至后来网吧老板宣称红警1 vs 1能胜过我的，免费上网一个小时。毕业之后有了笔记本，偶尔打打电脑玩，就不用鼠标了，用小红点或者触摸板都能对付2家冷酷的电脑，因此昨天决定不用鼠标打一家电脑恢复一下状态。谁知道打了2-3分钟，就感觉不对劲了。结果打到10分钟的时候就落了下风，干脆退出不打了&hellip;&hellip;郁闷啊。</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 后来决定同事联机，结果我们不在同一个网段，IPX/SPX协议没法用。奇怪的是，和我同一个网段的suddy同学，也和我连接不上。他进入红色警戒之后能看到我的游戏，但是一点参与就卡住不能动了。查阅了多方资料之后解决了，是IPX/SPX协议的内部网络号相同的原因，改成不一样就可以了。还好suddy的水平不负众望，很快被我蹂躏了。</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 鉴于不同网段红警联机的迫切愿望，我就开始做战网服务器了。一开始用的FSGS（Free Standard Game Server），结果配置好之后启动会报错download of versions.dat failed然后退出，无法解决。一番搜索之后找到了新的战网服务器，PvPGN（Player vs Player Game Net），官网为<a href="http://pvpgn.berlios.de/" target="_blank">http://pvpgn.berlios.de/</a>，免费开源，文档详尽，支持Linux/Mac/Windows多种平台，支持魔兽，星际，暗黑，红警等多种游戏，实在是居家旅行，杀人灭口必备的软件啊。另外插一句题外话，当年年轻的时候入侵服务器，做FSGS战网和同学们假期连星际就是最大的推动力之一，自己鄙视一下。</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 今天战网做好了，不过由于国庆的原因，还没有对打一把，同事们就都各自回家，做鸟兽散了&hellip;&hellip;还是国庆回家和我弟弟他们打局域网吧。很期待这次国庆回家，如果能回老家一行，更是好上加好&mdash;&mdash;因为那里有我90年种下的三棵桃树，我已经多年没有回去看它们了，还有活着的么？</p>
				]]>
			</description>
			<pubDate>Sat, 27 Sep 2008 17:43:57 +0800</pubDate>
		</item>
		<item>
			<title><![CDATA[浙江卫视的《涛出心里话》是在演戏？]]></title>
			<category>琐记</category>
			<author>wustyunshu@yahoo.com.cn(云舒)</author>
			<link>http://www.icylife.net/yunshu/show.php?id=622</link>
			<guid>http://www.icylife.net/yunshu/show.php?id=622</guid>
			<description>
				<![CDATA[
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 晚上和我家ICY一起看浙江卫视的节目，《涛出心里话》，讲一对要离婚的夫妻，可是越看越不对劲，觉得很眼熟。最终想起，是很久之前看过的一篇小说&mdash;&mdash;《老公房里传出轻微的呻吟》，有兴趣的可以去搜索一下，这是一篇2005年之前就在网络流传的小说。这个看起来貌似是实话实话的电视节目，居然只是找人演戏拍出来的？</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 看来电视里面的东西，除了天气预报，真的没什么好信的了。</p>
				]]>
			</description>
			<pubDate>Wed, 24 Sep 2008 22:05:37 +0800</pubDate>
		</item>
		<item>
			<title><![CDATA[使用安全的C#代码跳出CLR沙箱]]></title>
			<category>技术</category>
			<author>wustyunshu@yahoo.com.cn(云舒)</author>
			<link>http://www.icylife.net/yunshu/show.php?id=621</link>
			<guid>http://www.icylife.net/yunshu/show.php?id=621</guid>
			<description>
				<![CDATA[
<p>摘要：分析 介绍使用安全的C#代码跳出CLR沙箱的办法，原文是老外的《 Writing a .NET Security Exploit POC》，我做了修改，并介绍了原理以及跟踪过程。</p><p>Our Team：http://www.ph4nt0m.org<br />
Author：云舒(wustyunshu@hotmail.com)</p>
<p>本文可以任意转载，但请保持完整，并保留原始出处，谢谢。</p>
<p><strong>起因</strong></p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;一个老外写了一篇文章&lt;&lt;Writing a .NET Security Exploit POC&gt;&gt;，他给出的代码地址为<a href="http://www.frijters.net/TypeSafetyExploitPoC.cs.txt" target="_blank">http://www.frijters.net/TypeSafetyExploitPoC.cs.txt</a>。KJ看到后觉得可以用在SQL Server 2005里面，通过加载C#代码绕过沙箱的限制来获取shell。他测试之后代码无法运行，我就进行了一些初步调试，发现那段代码在内存中暴力搜索WinExec函数的地址时失败，返回为0，因此无法顺利执行。</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;这时候刺也加了进来，我们分头同时想到不需要在C#里面做内存搜索，既然可以写入机器码，那么直接写入一段shellcode就可以了。于是我在<a target="_blank" href="http://metasploit.com">http://metasploit.com</a>找了一段shellcode，修改原始POC，刺也同时作出了可以成功运行的修改版POC代码。</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;晚上KJ拿回家在SQL Server 2005中测试，确实可以，但是限制条件还是比较多，所以基本上是鸡肋了，可以参看他的文章，地址为<a href="http://blog.csdn.net/kj021320/archive/2008/09/17/2944371.aspx" target="_blank">http://blog.csdn.net/kj021320/archive/2008/09/17/2944371.aspx</a>。但是事情没有完，这个代码不复杂，但是原理是什么？他们都不太熟悉C#，因此责任就落在我身上了，开始了痛苦的虚拟机中运行的代码的调试之旅。至于这段POC代码，我发到我们的邮件列表了，地址是<a target="_blank" href="http://groups.google.com/group/ph4nt0m/browse_thread/thread/1ee957d07b33931f/6a0e158cb1deb078?show_docid=6a0e158cb1deb078">http://groups.google.com/group/ph4nt0m/browse_thread/thread/1ee957d07b33931f/6a0e158cb1deb078?show_docid=6a0e158cb1deb078</a>，在我的回复里面，这里就不写出来了。</p>
<p><strong>原理</strong></p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;要了解这个POC的原理，首先需要知道一些CLR的基础。这些没找到文档资料，是我跟踪分析出来的，不一定对，姑妄听之吧。在C#中直接定义数组，是在栈中保存元素的。但是如果数组是一个类中的成员，那么实例化这个类并且初始化这个数组的时候，在栈中仅仅保存一个指针，这个指针指向真正存放元素的地方。被指向的内存，第一个四字节保存着MethodTable，第二个四字节保存着元素的个数，第三个四字节才开始是保存着真实的数组元素。</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;在POC里，类Union2中有一个arr数组作为其成员，另一个o成员在后面被一个委托赋值，其实就是一个函数指针，4字节。而拥有u1和u2实例的UnsafeUnion结构体，申明了[StructLayout(LayoutKind.Explicit)]和[FieldOffset(0)]，表示u1和u2在内存中的偏移都是0字节。由于u1是两个int，均是4字节，而u2的o成员和arr都是指针，也都是4字节。因此，u1的i元素和u2的o元素在内存中重合，u1的j元素和u2的arr元素在内存中重合，u1和u2本身在内存中也完全融合。</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;POC中的del委托指向DummyMethod函数，在CLR语言中无法通过安全的代码来获取函数指针，因此只能通过将del赋值给object o来间接的传递函数地址。最终通过修改int型j的值，间接的修改了arr指向的地址，将arr指向了DummyMethod函数中。最终导致修改arr，其实是修改了函数DummyMethod的代码，通过委托执行函数的时候就执行了我们自定义的shellcode，跳出了sandbox了。</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;那个POC的作者熟悉C#而不太熟悉安全，所以代码长而且不够可靠，修改了下就好了。原理说得有些绕，下面我来用动态跟踪证实这一点。</p>
<p><strong>调试</strong></p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;C#代码是在CLR虚拟机里面运行的，因此基本无法用OllyDBG来做调试，如果有人有办法，还请指点一下。经过在微软一番搜索，使用了Visual Studio 2008加载SOS.dll来做动态跟踪，具体的文档可以搜索SOS.dll就行了。下面简单介绍一下我的调试过程，因为觉得这个很有意思。当然这个是摸索过后的情形，所以看起来很顺利，其实我从学习SOS.dll到跟踪分析完成花了两天多时间。</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;首先在加载我修改过的代码工程，在Main函数的第一行下断点，并打开Memory窗口，再在右下角的Immediate Window窗口中输入命令.load sos加载sos.dll模块，整个界面如下图所示，希望这是唯一的一个截图。</p>
<p><img height="469" width="800" alt="" src="/userfiles/image/DebugCSPOC.JPG" /></p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.load sos<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;extension C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\sos.dll loaded</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;可以看到，成功的加载了sos.dll，可以使用!help命令查看sos模块提供的调试命令帮助信息，更多的请自己翻阅手册。<br />
单步走一步，查看CLR虚拟机的栈信息，结果如下：<br />
!clrstack -a<br />
OS Thread Id: 0x8f4 (2292)<br />
ESP&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; EIP&nbsp;&nbsp;&nbsp;&nbsp; <br />
0012f418 00e500e4 TypeSafetyExploitPoC.Main(System.String[])<br />
&nbsp;&nbsp;&nbsp; PARAMETERS:<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; args = 0x01301628<br />
&nbsp;&nbsp;&nbsp; LOCALS:<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0x0012f440 = 0x00000000<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0x0012f43c = 0x01301664<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0x0012f438 = 0x00000000<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0x0012f434 = 0x00000000<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0x0012f430 = 0x00000000<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0x0012f42c = 0x00000000<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0x0012f428 = 0x00000000<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0x0012f424 = 0x00000000<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0x0012f420 = 0x00000000<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0x0012f41c = 0x00000000<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0x0012f418 = 0x00000000<br />
0012f69c 79e7c74b [GCFrame: 0012f69c]</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;可以看到，变量u2已经被定义了，在栈里面的地址为0x01301664。再单步走到u2.o = del上面的语句，查看一下栈，会发现u1，u2，以及del都定义了，而且u1和u2指向的内存和我上面说的一样，是重合的，都是0x01301664&mdash;&mdash;当然，具体的内存地址取决于机器。Del的值为0x01301674。</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;在Memory窗口，查看0x01301664地址处的内存，单步走完u2.o = del这条语句，再查看内存，会发现0x01301664 + 4处的内存变成了del的值，即0x01301674，需要注意的是，u1和u2在内存上完全重合，因此u1.i的值就也变成了0x01301674。为什么是0x01301664 + 4处的内存而不是0x01301664处？查看一下u2的结构，如下：</p>
<p>!dumpobj 0x01301664<br />
Name: Union2<br />
MethodTable: 009830fc<br />
EEClass: 00981344<br />
Size: 16(0x10) bytes<br />
&nbsp;(E:\TestExp\bin\Debug\TestExp.exe)<br />
Fields:<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MT&nbsp;&nbsp;&nbsp; Field&nbsp;&nbsp; Offset&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Type VT&nbsp;&nbsp;&nbsp;&nbsp; Attr&nbsp;&nbsp;&nbsp; Value Name<br />
790fd0f0&nbsp; 4000003&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 4&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.Object&nbsp; 0 instance 01301674 o<br />
7912d7c0&nbsp; 4000004&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 8&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.Int32[]&nbsp; 0 instance 00000000 arr</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;可以看到，u2的第一个元素偏移量确实是4，偏移为0的地方，是存放着MethodTable的地址，记录了一些内部信息。<br />
单步走过u1.j = u1.i，可以看到内存0x01301664 + 8处的值改变了。还是由于u1和u2内存重合的原因，u1.i，u1.j，以及u2.o，u2.arr都变成了相同的值，即del的值，也就是那个函数指针的值了。</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;下面的一条指令u1.j = u2.arr[2] &ndash; 12是POC最关键的一条，还是由于内存重合，这一条改变u1.j的值的指令，间接的修改了arr指向的地址，使arr指向了函数指针指向的内存。因此在后面对arr进行修改的时候，其实是修改了函数指针指向的内存，也就是修改了委托del指向的函数DummyMethod的指令。这条代码执行后查看arr的值，如下：<br />
!dumpobj 0x01301664<br />
&lt;Note: this object has an invalid CLASS field&gt;<br />
Name: Union2<br />
MethodTable: 009830fc<br />
EEClass: 00981344<br />
Size: 16(0x10) bytes<br />
&nbsp;(E:\TestExp\bin\Debug\TestExp.exe)<br />
Fields:<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MT&nbsp;&nbsp;&nbsp; Field&nbsp;&nbsp; Offset&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Type VT&nbsp;&nbsp;&nbsp;&nbsp; Attr&nbsp;&nbsp;&nbsp; Value Name<br />
790fd0f0&nbsp; 4000003&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 4&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.Object&nbsp; 0 instance 01301674 o<br />
7912d7c0&nbsp; 4000004&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 8&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.Int32[]&nbsp; 0 instance 0098c054 arr</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;可以看到，数组的数据已经是保存在地址0x0098c054处了。我们看一下函数指针0x01301674的内容。</p>
<p>!dumpobj 0x01301674<br />
Name: System.Threading.ThreadStart<br />
MethodTable: 791249e8<br />
EEClass: 790c57b8<br />
Size: 32(0x20) bytes<br />
&nbsp;(C:\WINDOWS\assembly\GAC_32\mscorlib\2.0.0.0__b77a5c561934e089\mscorlib.dll)<br />
Fields:<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MT&nbsp;&nbsp;&nbsp; Field&nbsp;&nbsp; Offset&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Type VT&nbsp;&nbsp;&nbsp;&nbsp; Attr&nbsp;&nbsp;&nbsp; Value Name<br />
790fd0f0&nbsp; 40000ff&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 4&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.Object&nbsp; 0 instance 01301674 _target<br />
7910ebc8&nbsp; 4000100&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 8 ...ection.MethodBase&nbsp; 0 instance 0130182c _methodBase<br />
791016bc&nbsp; 4000101&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; c&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.IntPtr&nbsp; 1 instance 003B20C4 _methodPtr<br />
791016bc&nbsp; 4000102&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 10&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.IntPtr&nbsp; 1 instance 0098C060 _methodPtrAux<br />
790fd0f0&nbsp; 400010c&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 14&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.Object&nbsp; 0 instance 00000000 _invocationList<br />
791016bc&nbsp; 400010d&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 18&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.IntPtr&nbsp; 1 instance 00000000 _invocationCount</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;注意其中的_methodPtrAux的值，对比一下上文的arr指向的内存，发现确实落在其中了。其实上面的arr[2]取到的值就是这个_methodPtrAux的内容。后面的事情就简单了，将shellcode拷贝到arr中，也就是拷贝到了DummyMethod函数的内存中，改写了DummyMethod函数。最后调用del委托间接的调用DummyMethod，就执行了我们的shellcode，突破sandbox了。</p>
				]]>
			</description>
			<pubDate>Sat, 20 Sep 2008 01:03:19 +0800</pubDate>
		</item>
		<item>
			<title><![CDATA[淘宝卖黄瓜]]></title>
			<category>八卦</category>
			<author>wustyunshu@yahoo.com.cn(云舒)</author>
			<link>http://www.icylife.net/yunshu/show.php?id=620</link>
			<guid>http://www.icylife.net/yunshu/show.php?id=620</guid>
			<description>
				<![CDATA[
<p>摘要：很久以前，我写过一篇<a href="http://www.icylife.net/yunshu/show.php?id=567" target="_blank">《关于黄瓜》</a>的文章，想不到今天在淘宝上面看到一个异常强悍的黄瓜广告，特地转载一下。</p><p>淘宝地址为地址为<a href="http://auction1.taobao.com/auction/item_detail-0db1-c3151f3ca54ee4aea1a7e2cd53cc68bd.jhtml" target="_blank">http://auction1.taobao.com/auction/item_detail-0db1-c3151f3ca54ee4aea1a7e2cd53cc68bd.jhtml</a>。</p>
<p>大家好，我们是来自绿色农庄的精品小黄瓜！<br />
<br />
我们生长在青山绿水之间，朝饮木兰之坠露，夕餐秋菊之落英，吐纳天地之灵气，吸收日月之精华...不喝农药，不吃化肥，更是保证没有掺杂苏丹红、柠檬黄、孔雀石绿、三聚氰胺...绝对新鲜，以头顶的小黄花为证！<br />
<br />
我们全都健壮挺拔，身高均在16-20CM间，腰围胸围臀围均在15CM左右，误差不超过5MM。<br />
<br />
我们放很多天都不会软；<br />
我们永远不会嫌累；<br />
我们不会又急又紧张；<br />
我们可以永远保持在六点而不是六点半；<br />
我们天生就有颗粒；<br />
我们用力啃下去都不会叫痛；<br />
我们保证不会在重要关头突然变小；<br />
<br />
我们绝对不会有外遇；<br />
我们绝对安全，不需要穿雨衣工作；<br />
我们不用劳驾您煮饭给我们吃；<br />
我们不计较你的年纪容貌；<br />
我们不会在乎您是A还是A-；<br />
我们不会在乎您赚的钱比我们多；<br />
我们不会在乎今天是这个月的第几天；<br />
用完我们您不需要跑药房；<br />
当您饿的时候可以把我们吃下去；<br />
你可以很容易地把我们加热或放到冰箱；<br />
您不需要对我们说&ldquo;我很抱歉&rdquo;.当然我们也不会对您说&ldquo;我很抱歉&rdquo;；<br />
我们从来不问：&ldquo;怎么样?&rdquo;&ldquo;我的表现还好吗?&rdquo;&ldquo;有没有来?&rdquo;&hellip;<br />
<br />
我们真正绿色环保，不需要电池，可以放心快递！</p>
				]]>
			</description>
			<pubDate>Fri, 19 Sep 2008 19:46:47 +0800</pubDate>
		</item>
		<item>
			<title><![CDATA[婴幼儿奶粉事件扩大至22个品牌]]></title>
			<category>八卦</category>
			<author>wustyunshu@yahoo.com.cn(云舒)</author>
			<link>http://www.icylife.net/yunshu/show.php?id=619</link>
			<guid>http://www.icylife.net/yunshu/show.php?id=619</guid>
			<description>
				<![CDATA[
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;中新网9月16日电 据中央电视台新闻联播报道，国家质检总局近日紧急在全国开展了婴幼儿奶粉三聚氰胺含量专项检查。阶段性检查结果显示，有22家婴幼儿奶粉生产企业的69批次产品检出了含量不同的三聚氰胺,被要求立即下架，涉及品牌包括三鹿、伊利、蒙牛、雅士利、熊猫、圣元、古城、光明、惠民、可淇、南山、齐宁、金必氏、施恩、金鼎、澳美多、爱可丁、御宝、磊磊、宝安力、聪尔壮等。</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2028年,世界上爆发第三次世界大战.可恶的美帝国主义向我朝投下几万枚有毒化学炸弹,妄图摧毁我朝.可是,我朝士兵毫无伤亡,反而更加英勇!美军司令 被我朝俘获后懊恼的吼道:&quot;我们都下了毒手往你们那投下生化武器了,为什么你们没事呢!&quot;我朝一士兵哈哈笑道:&quot;你丫懂个屁,我朝人民从小都是吃有毒食物 长大的,还怕你个生化武器不成!&quot;</p>
				]]>
			</description>
			<pubDate>Tue, 16 Sep 2008 21:51:42 +0800</pubDate>
		</item>
		<item>
			<title><![CDATA[三聚氰胺奶粉事件]]></title>
			<category>八卦</category>
			<author>wustyunshu@yahoo.com.cn(云舒)</author>
			<link>http://www.icylife.net/yunshu/show.php?id=618</link>
			<guid>http://www.icylife.net/yunshu/show.php?id=618</guid>
			<description>
				<![CDATA[
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;摘要：这次的三聚氰胺奶粉事件，不知道会如何收场。难道人类真的是庄子说的有机巧之器，就有机巧之事，就有机巧之心？活着真是无奈啊，宁愿退回到老子推崇的小国寡民时代。</p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;大致介绍一下三聚氰胺奶粉吧，大家有小孩子了一定要小心，我现在就为以后有孩子了怎么照顾而担心啊。小孩子又不会描述，等发现问题，可能已经晚了&hellip;&hellip;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;下面是引用：</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 三聚氰胺，是一种很常见的塑料化工原料，其分子最大的特点，就是含氮原子很多。我们知道，食品工业中常常需要检查蛋白质含量，但是直接测量蛋白质含量技术上比较复杂，成本也比较高，不适合大范围推广，所以业界常常使用一种叫做&ldquo;凯氏 定氮法（Kjeldahl method）&rdquo;的方法，通过食品中氮原子的含量来间接推算蛋白质的含量。也就是说，食品中氮原子含量越高，这蛋白质含量就越高。这样一来，这名不见经传 的三聚氰胺的由于其分子中含氮原子比较多，于是就派上大用场了。</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 三聚氰胺最早被中国的造假者用在家畜饲料生产中，饲料中添加了这玩意，仪器一检测，氮原子很多啊，一推算，蛋白质含量也很高，生产者顺理成章地就省下昂贵 的蛋白粉开支了。三聚氰胺虽然有毒，但是牛羊体积都比较大，肾功能强，能顺利代谢毒素，吃了，好像也没啥死牛死羊的事情发生，于是也没人去关注。顺理成 章，造假者扩大应用范围，顺便把三聚氰胺用于出口美国的宠物饲料中，当然不幸的是，猫狗等宠物体积比牛羊小多了，代谢能力差，这三聚氰胺的毒性的影响也就 大了，结果毒死了猫狗，惊动了美国洋老太爷，最后三聚氰胺这种东西也进入美国的FDA的视线。</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 当时美国人发现三聚氰胺后百思不得其解，不知道为啥添加这玩意，还以为是老鼠药污染造成的。记得当时美国新闻媒体报道都是怀疑中国粮食仓库看管不严， 造成老鼠药污染。后来终于有知情的中国人忍不住，偷偷告诉美国人这食品中添加三聚氰胺的奥秘，这高手云集的美国学术界这才恍然大悟，明白过来这复杂的高科 技造假过程。</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 这次三鹿奶粉事件，受&ldquo;污染&rdquo;的都是最便宜的18块钱一袋的婴儿奶粉，显然，三鹿为了占领农村奶粉市场这块最后的肥肉采取了低价倾销战略，但是卖这18块 钱一袋的奶粉连本钱都不够，大量生产岂不亏老本了吗？于是三鹿为了节省成本，在奶粉中添加廉价大豆蛋白粉来替代奶粉，这大豆蛋白粉本来也没啥大事，但是， 恰恰这次里面被添加了伪造蛋白质的三聚氰胺这高科技玩意，于是最终制造出这起轰动全国的三鹿奶粉事件。当然，成人奶粉中肯定也添加了这种高科技玩意，因为 成年人的代谢能力比婴儿强大得多，除了特殊的病人，自然也不会有中毒事件发生。</p>
				]]>
			</description>
			<pubDate>Fri, 12 Sep 2008 12:19:26 +0800</pubDate>
		</item>
		<item>
			<title><![CDATA[在perl中使用信号量等待detach后的线程]]></title>
			<category>技术</category>
			<author>wustyunshu@yahoo.com.cn(云舒)</author>
			<link>http://www.icylife.net/yunshu/show.php?id=617</link>
			<guid>http://www.icylife.net/yunshu/show.php?id=617</guid>
			<description>
				<![CDATA[
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;摘要：开始写摘要了，不然首页太长了，不好看。perl的线程编程很简单，以前也大致说过，现在就不说了。这里主要说说等待线程退出的情况，如何使用信号量来等待被detach了的线程。</p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;在perl里面等待没有detach的线程好说，直接join等待退出就可以了。但是对于被detach过的，就比较麻烦一点了。因为主函数退出的时候是不管被detach了的线程是否完成的，没有完成就强制杀死，可能会导致程序工作结果不对。可是detach线程又是不可避免的，我尤其喜欢这么做，主要原因是因为我懒，不想保存一个数组，然后去挨个儿去收割，麻烦啊。况且detach掉之后，线程结束时系统自动回收资源，更是美事一桩。<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;今天测试一个小程序的时候，想到既然一般使用信号量来控制并发线程数量，那么应该也可以用信号量作为事件，来等待线程结束啊。写了个脚本测试一下，确实可行。在所有线程创建完毕，主程序要退出之前，尝试获得最大线程数量个信号，无法获得的时候会阻塞，直到成功获得。这是因为一共创建了最大并发线程数个信号量，而一个线程占用一个信号量，线程退出的时候才释放。如果能够获得到原始个数，就表示所有线程都释放了，所有线程处理完毕，程序可以结束了。</p>
<pre class="perl"><span style="color: rgb(128, 128, 128); font-style: italic;">#!/usr/bin/perl</span>
<span style="color: rgb(0, 0, 0); font-weight: bold;">use</span> strict;
<span style="color: rgb(0, 0, 0); font-weight: bold;">use</span> warnings;
<span style="color: rgb(0, 0, 0); font-weight: bold;">use</span> threads;
<span style="color: rgb(0, 0, 0); font-weight: bold;">use</span> Thread::<span style="color: rgb(0, 102, 0);">Semaphore</span>;
&nbsp;
<span style="color: rgb(177, 177, 0);">my</span> <span style="color: rgb(0, 0, 255);">$max_thread</span> = <span style="color: rgb(204, 102, 204);">4</span>;
<span style="color: rgb(177, 177, 0);">my</span> <span style="color: rgb(0, 0, 255);">$semaphore</span> = <span style="color: rgb(0, 0, 0); font-weight: bold;">new</span> Thread::<span style="color: rgb(0, 102, 0);">Semaphore</span><span style="color: rgb(102, 204, 102);">(</span> <span style="color: rgb(0, 0, 255);">$max_thread</span> <span style="color: rgb(102, 204, 102);">)</span>;
&nbsp;
<span style="color: rgb(0, 0, 0); font-weight: bold;">sub</span> TestFun
<span style="color: rgb(102, 204, 102);">{</span>
	<span style="color: rgb(177, 177, 0);">my</span> <span style="color: rgb(0, 0, 255);">$num</span> = <span style="color: rgb(0, 0, 102);">shift</span>;
	<span style="color: rgb(177, 177, 0);">my</span> <span style="color: rgb(0, 0, 255);">$count</span> = <span style="color: rgb(204, 102, 204);">1</span>;
	<span style="color: rgb(177, 177, 0);">while</span><span style="color: rgb(102, 204, 102);">(</span> <span style="color: rgb(0, 0, 255);">$count</span> &lt;= <span style="color: rgb(204, 102, 204);">3</span> <span style="color: rgb(102, 204, 102);">)</span>
	<span style="color: rgb(102, 204, 102);">{</span>
		<span style="color: rgb(0, 0, 102);">print</span> <span style="color: rgb(255, 0, 0);">&quot;print $num $count times in thread &quot;</span>.threads-&gt;<span style="color: rgb(0, 102, 0);">self</span><span style="color: rgb(102, 204, 102);">(</span><span style="color: rgb(102, 204, 102);">)</span>-&gt;<span style="color: rgb(0, 102, 0);">tid</span><span style="color: rgb(102, 204, 102);">(</span><span style="color: rgb(102, 204, 102);">)</span>.<span style="color: rgb(255, 0, 0);">&quot;n&quot;</span>;
		<span style="color: rgb(0, 0, 102);">sleep</span><span style="color: rgb(102, 204, 102);">(</span> <span style="color: rgb(204, 102, 204);">1</span> <span style="color: rgb(102, 204, 102);">)</span>;
		<span style="color: rgb(0, 0, 255);">$count</span> ++;
	<span style="color: rgb(102, 204, 102);">}</span>
	<span style="color: rgb(128, 128, 128); font-style: italic;"># 线程技术，释放一个信号量</span>
	<span style="color: rgb(0, 0, 255);">$semaphore</span>-&gt;<span style="color: rgb(0, 102, 0);">up</span><span style="color: rgb(102, 204, 102);">(</span> <span style="color: rgb(102, 204, 102);">)</span>;
<span style="color: rgb(102, 204, 102);">}</span>
&nbsp;
<span style="color: rgb(0, 0, 0); font-weight: bold;">sub</span> Wait2Quit
<span style="color: rgb(102, 204, 102);">{</span>
	<span style="color: rgb(0, 0, 102);">print</span> <span style="color: rgb(255, 0, 0);">&quot;Waiting to quit...n&quot;</span>;
&nbsp;
	<span style="color: rgb(177, 177, 0);">my</span> <span style="color: rgb(0, 0, 255);">$num</span> = <span style="color: rgb(204, 102, 204);">0</span>;
	<span style="color: rgb(177, 177, 0);">while</span><span style="color: rgb(102, 204, 102);">(</span> <span style="color: rgb(0, 0, 255);">$num</span> &lt; <span style="color: rgb(0, 0, 255);">$max_thread</span> <span style="color: rgb(102, 204, 102);">)</span>
	<span style="color: rgb(102, 204, 102);">{</span>
		<span style="color: rgb(128, 128, 128); font-style: italic;"># 尝试获取信号量，当能够获取到最大线程数个信号量时，表示所有线程都结束了</span>
		<span style="color: rgb(0, 0, 255);">$semaphore</span>-&gt;<span style="color: rgb(0, 102, 0);">down</span><span style="color: rgb(102, 204, 102);">(</span> <span style="color: rgb(102, 204, 102);">)</span>;
		<span style="color: rgb(0, 0, 255);">$num</span> ++;
		<span style="color: rgb(0, 0, 102);">print</span> <span style="color: rgb(255, 0, 0);">&quot;$num thread quit.n&quot;</span>;
	<span style="color: rgb(102, 204, 102);">}</span>
	<span style="color: rgb(0, 0, 102);">print</span> <span style="color: rgb(255, 0, 0);">&quot;All $max_thread thread quit.n&quot;</span>;
<span style="color: rgb(102, 204, 102);">}</span>
&nbsp;
<span style="color: rgb(177, 177, 0);">for</span><span style="color: rgb(102, 204, 102);">(</span> <span style="color: rgb(177, 177, 0);">my</span> <span style="color: rgb(0, 0, 255);">$index</span> = <span style="color: rgb(204, 102, 204);">1</span>; <span style="color: rgb(0, 0, 255);">$index</span> &lt;= <span style="color: rgb(204, 102, 204);">10</span>; <span style="color: rgb(0, 0, 255);">$index</span> ++<span style="color: rgb(102, 204, 102);">)</span>
<span style="color: rgb(102, 204, 102);">{</span>
	<span style="color: rgb(128, 128, 128); font-style: italic;"># 获取一个信号量，控制并行的线程数量</span>
	<span style="color: rgb(0, 0, 255);">$semaphore</span>-&gt;<span style="color: rgb(0, 102, 0);">down</span><span style="color: rgb(102, 204, 102);">(</span> <span style="color: rgb(102, 204, 102);">)</span>;
	<span style="color: rgb(177, 177, 0);">my</span> <span style="color: rgb(0, 0, 255);">$thread</span> = threads-&gt;<span style="color: rgb(0, 102, 0);">create</span><span style="color: rgb(102, 204, 102);">(</span> &amp;TestFun, <span style="color: rgb(0, 0, 255);">$index</span> <span style="color: rgb(102, 204, 102);">)</span>;
&nbsp;
	<span style="color: rgb(128, 128, 128); font-style: italic;"># 剥离线程，不关心返回值，系统自动回收资源</span>
	<span style="color: rgb(0, 0, 255);">$thread</span>-&gt;<span style="color: rgb(0, 102, 0);">detach</span><span style="color: rgb(102, 204, 102);">(</span><span style="color: rgb(102, 204, 102);">)</span>;
<span style="color: rgb(102, 204, 102);">}</span>
&nbsp;
Wait2Quit<span style="color: rgb(102, 204, 102);">(</span> <span style="color: rgb(102, 204, 102);">)</span>;
&nbsp;</pre>
				]]>
			</description>
			<pubDate>Thu, 11 Sep 2008 16:34:13 +0800</pubDate>
		</item>
		<item>
			<title><![CDATA[杀垃圾]]></title>
			<category>琐记</category>
			<author>wustyunshu@yahoo.com.cn(云舒)</author>
			<link>http://www.icylife.net/yunshu/show.php?id=616</link>
			<guid>http://www.icylife.net/yunshu/show.php?id=616</guid>
			<description>
				<![CDATA[
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 总是有些渣滓喜欢跑到别人的地方倒垃圾，屏蔽IP地址也不是个好办法，直接启用评论管制吧。对朋友们说一声抱歉，免得因为一些少量的垃圾污染大家的眼睛，只能这样了。我倒想看看，垃圾们还有什么办法可以使出来的？我就是堵住你们喷粪的嘴巴，你能奈我何？憋死你。</p>
				]]>
			</description>
			<pubDate>Wed, 10 Sep 2008 11:33:06 +0800</pubDate>
		</item>
		<item>
			<title><![CDATA[淘宝和百度]]></title>
			<category>八卦</category>
			<author>wustyunshu@yahoo.com.cn(云舒)</author>
			<link>http://www.icylife.net/yunshu/show.php?id=615</link>
			<guid>http://www.icylife.net/yunshu/show.php?id=615</guid>
			<description>
				<![CDATA[
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 淘宝修改了rebots.txt，拒绝了百度蜘蛛的收录，各路专家从18个方面，列举了起码36条理由，得出了72个结果，看一下乐呵乐呵还是不错的。对我这种直肠子，反倒觉得没什么好分析的。不知道别人购物的时候是怎么样，反正我要是想买东西，直接上淘宝搜索了。难道还先去百度搜索一下，再进到淘宝去？</p>
				]]>
			</description>
			<pubDate>Tue, 09 Sep 2008 09:51:11 +0800</pubDate>
		</item>
		<item>
			<title><![CDATA[Chrom的协议，你同意了么？]]></title>
			<category>八卦</category>
			<author>wustyunshu@yahoo.com.cn(云舒)</author>
			<link>http://www.icylife.net/yunshu/show.php?id=614</link>
			<guid>http://www.icylife.net/yunshu/show.php?id=614</guid>
			<description>
				<![CDATA[
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;By submitting, posting or displaying the content you give Google a perpetual, irrevocable, worldwide, royalty-free, and non-exclusive license to reproduce, adapt, modify, translate, publish, publicly perform, publicly display and distribute any content which you submit, post or display on or through, the services. This license is for the sole purpose of enabling Google to display, distribute and promote the services and may be revoked for certain services as defined in the additional terms of those services.</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 翻译一下，就是&ldquo;通过服务提交、发布或展示内容，则表明您授予谷歌在全球范围内复制、改编、修改、翻译、出版、公开演出、公开展示和分发这些内容的永久、不可撤销、无版税、非专有的许可。&rdquo;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 你点了同意么？</p>
				]]>
			</description>
			<pubDate>Thu, 04 Sep 2008 09:52:47 +0800</pubDate>
		</item>
		<item>
			<title><![CDATA[Flash排球游戏]]></title>
			<category>八卦</category>
			<author>wustyunshu@yahoo.com.cn(云舒)</author>
			<link>http://www.icylife.net/yunshu/show.php?id=613</link>
			<guid>http://www.icylife.net/yunshu/show.php?id=613</guid>
			<description>
				<![CDATA[
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;一个Flash做的小游戏，用鼠标点小球，不让它落下来，点一次得一份，你能得多少分？感觉用来练微操还是不错的，打星际之前多点点。</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <embed height="320" width="400" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" src="http://www.lpfrx.com/wp-content/uploads/2008/08/optus-tennis-challenge.swf" play="true" loop="true" menu="true"></embed></p>
				]]>
			</description>
			<pubDate>Fri, 29 Aug 2008 17:57:16 +0800</pubDate>
		</item>
		<item>
			<title><![CDATA[LX退赛后的故事]]></title>
			<category>八卦</category>
			<author>wustyunshu@yahoo.com.cn(云舒)</author>
			<link>http://www.icylife.net/yunshu/show.php?id=612</link>
			<guid>http://www.icylife.net/yunshu/show.php?id=612</guid>
			<description>
				<![CDATA[
<p>LX退赛后，故事会如何发展？请看：</p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1. LX因伤病退赛，但心中报效祖国之志不改，四年内刻苦训练，卧薪尝胆历经，千辛万苦。终于在下届奥运会上以破世界记录的成绩夺冠。&mdash;&mdash;40集CCTV年度大戏</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2. LX因伤退赛，国际博彩业爆出惊天冷门，香港警方重案组经过层层剖析，发现此事与国际赌博集团最大的庄家有关。经过一番斗智斗勇，最终擒获庄家，真相大白于天下。&mdash;&mdash;30集TVB港剧</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 3. LX退赛，心情极度低沉，就在人生的最低谷时，遇见了一位自己的女粉丝A。A用自己的温柔和善良感动了LX，使其重新振作起来。并夺回了属于自己的世界冠军头衔。最后LX在重夺奥运冠军的一刻，将金牌作为求婚礼物，献给了坐在看台上的A。&mdash;&mdash;20集日剧</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 4. LX因伤退赛，去到一家著名医院疗伤，在治疗过程中认识了一名身患绝症的女生B。LX感动于B对于生命的乐观和开朗，逐渐康复。却又引来了院长孙女C的追求，LX母亲为撮合LX与C，向B撒谎两人已经订婚。最终LX发觉了母亲的计策，重新找到已经万念俱灰的B，并约定夺回奥运冠军后即与B结婚。最终LX成功夺冠，B在病床前看着电视直播含笑离世，LX将金牌作为C的陪葬&hellip;&hellip;&mdash;&mdash;100集韩剧</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 5. LX因伤退赛，世界医学界都对该伤势束手无策。最终一神秘学家找到LX，愿意治好他的腿伤。并将其改造成一双快如闪电的飞毛腿。从此LX表面身份是一名运动员，事实上成为了一名维护正义的使者，凭借其无与伦比的速度优势与罪恶军团开始了针锋相对的斗争。&mdash;&mdash;20集美剧（第一季）</p>
				]]>
			</description>
			<pubDate>Thu, 28 Aug 2008 11:59:32 +0800</pubDate>
		</item>
		<item>
			<title><![CDATA[（转载）大便之于屎壳郎就好像粮食之于人类]]></title>
			<category>八卦</category>
			<author>wustyunshu@yahoo.com.cn(云舒)</author>
			<link>http://www.icylife.net/yunshu/show.php?id=611</link>
			<guid>http://www.icylife.net/yunshu/show.php?id=611</guid>
			<description>
				<![CDATA[
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 快下班了无聊得紧，刚好在天涯看到一篇关于奥运闭幕式上弹吉他的jimmy page的很有趣的文章，在天涯引起一场大战，地址是<a target="_blank" href="http://cache.tianya.cn/publicforum/content/beijing2008/1/13536.shtml">http://cache.tianya.cn/publicforum/content/beijing2008/1/13536.shtml</a>。这个帖子展现了很多东西，非常的有意思。顺便摘录一个人的一段回复过来，可惜别人对他这段我觉得很好的回复进行了很简单的处理&mdash;&mdash;骂。</p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;下面就是转载过来的回复了。</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&ldquo;摇滚乐之于欧美就像诗歌之于盛唐&rdquo;，这句话，对诗歌，对中国文化，没有丝毫贬低或不敬。要批评这句话的人，您确定您祖国语言和文化学好了？这句式你看明 白了？这句话的意思不是说摇滚乐等同与中国的古诗，而是说，摇滚乐对于欧美现代文化的意义，地位，作用就如同诗歌在盛唐时期。进一步说，就是像诗歌体现了 盛唐文明一样，摇滚乐也是现代西方文明的代表。这哪里不对？哪里对我们的文化不敬了？！</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&ldquo;大便之于屎壳郎就好像粮食之于人类&rdquo;，那些跳出来叫嚣&ldquo;大便怎么能跟粮食比？！不要侮辱粮食！&rdquo;的人，我才要对你们说，不要侮辱了我们民族精确的语言，请先学好我们本国的语言和文化，再出来评判别人！</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;那些不停的重申&ldquo;不就是戏子&rdquo;&ldquo;不就是唱歌&rdquo;&ldquo;不就是流行音乐&rdquo;&ldquo;不就是个消遣&rdquo;&ldquo;不就是XXX&rdquo;的人，按照你们的逻辑，梅兰芳也不就是个戏子？！王羲之也不就是个写字的？簪花仕女图不也是娱乐消遣？那些想跳出来骂&ldquo;凭什么跟我们的艺术大师比？！&rdquo;的人，麻烦你们双重标准不要太严重，别人那儿唱歌的得到的是蔑视，我们这唱歌的就要尊为艺术，大师，你们还知道要脸不？！</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;是啊，他&ldquo;不就是个唱歌的&rdquo;。苏东坡是啥？苏东坡也不就是个写歌词的？！还不会作曲呢！诗歌诗歌，知道为啥叫诗&ldquo;歌&rdquo;吗？！因为在中国古代，诗跟歌不分 家，所有的诗词曲赋都是能唱，能吟，能咏的。知道诗为什么有格律吗？知道&ldquo;浣溪沙&rdquo;&ldquo;如梦令&rdquo;&ldquo;江城子&rdquo;&ldquo;念奴娇&rdquo;&ldquo;一剪梅&rdquo;这些词牌名是什么意思吗？那 是为了跟曲调相配！唐朝为什么诗歌艺术繁盛？因为那时候社会安定，人民生活富足，有条件追求精神生活，也就是说，娱乐业发达！诗词歌赋，在那时候，也就是 个流行歌曲！</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;苏词和辛词，唐初四杰的诗，甚不合当世铺陈华丽的文风，因此往往被时人诟病&ldquo;不雅&rdquo;，正如诗经中的《风》因为其来源多是民间的劳动号子，山歌民歌情歌，而被当时的士大夫们称&ldquo;粗鄙&rdquo;，然而这些都无碍他们的价值。</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;当时流行的是那个天天在女人堆里打滚的柳永，苏东坡也是郁闷滴，特特找人问，你说，我的词和柳词，谁好？那人也端的是滑头的紧，说：柳郎中的词哇，只好 豆蔻年华的女孩儿，持红牙拍板，轻歌慢板的唱&ldquo;杨柳岸，晓风残月&rdquo;；学士的词，则非得关西大汉，手持铜琵琶、铁绰板，大吼&ldquo;大江东去&rdquo;。苏东坡在当时是先 锋，是革新派，当时乐坛跟现在一样，流行的是柳永那样软绵绵的绮丽香艳的情歌，很明显苏东坡的词比柳永更富思想性，可是有几个人爱听关西大汉吼哇？！况 且，轻松的不用动脑子的东西总是比深刻艰涩的有市场。君不见穿越文和郭敬明比名著好卖的多？！&ldquo;吾未见好德如好色者也&rdquo;如斯，古今通病。</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;苏东坡在当时也就是个搞摇滚的！当时的文人像你们一样，不屑的说：&ldquo;不就是个搞流行歌曲的？！&rdquo;但是老杜骂的好哇：&ldquo;尔曹身与名俱灭，不废江河万古流。&rdquo;</p>
				]]>
			</description>
			<pubDate>Tue, 26 Aug 2008 17:41:06 +0800</pubDate>
		</item>
		<item>
			<title><![CDATA[PHP版博客聚合程序]]></title>
			<category>技术</category>
			<author>wustyunshu@yahoo.com.cn(云舒)</author>
			<link>http://www.icylife.net/yunshu/show.php?id=610</link>
			<guid>http://www.icylife.net/yunshu/show.php?id=610</guid>
			<description>
				<![CDATA[
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;这是PST(http://www.ph4nt0m.org)的blog聚合程序，展现程序由luoluo编码，其它部分由云舒编码。数据库操作类从angel的sablog中拷贝来的，不知道他是否介意。这个算是1.2版，虽然和PST目前在用的有些区别，但是大体上是相似的，有什么问题请联系我或者luoluo，谢谢。</p>
<ul>
    <li>config.php&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 系统配置文件</li>
    <li>fetch_rss.php&nbsp;&nbsp;&nbsp; 抓取其他RSS内容的程序，目前只支持RSS，atom虽然一直说写，但是一直没空</li>
    <li>make_rss.php&nbsp;&nbsp;&nbsp; 生成聚合后的RSS</li>
</ul>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;至于如何定期跟新，这个看你自己了，写个小程序几分钟请求一下fetch_rss.php，或者直接命令行执行fetch_rss.php都可以，up_rss.pl是我做的一个示例。如果发现有问题，请检查一下静态页面缓存。</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 就这么几个简单的页面，因为有几个人要，干脆就发一下，此记。顺便，sql注入是做了过滤，但是富文本的XSS我就无能为力了，别乱抓别人的RSS吧。云舒于2008-08-25 23:51</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="http://www.icylife.net/yunshu/img/planet.zip">http://www.icylife.net/yunshu/img/planet.zip</a></p>
				]]>
			</description>
			<pubDate>Tue, 26 Aug 2008 00:00:48 +0800</pubDate>
		</item>
		<item>
			<title><![CDATA[某国中心电视台新闻报道试题]]></title>
			<category>读书</category>
			<author>wustyunshu@yahoo.com.cn(云舒)</author>
			<link>http://www.icylife.net/yunshu/show.php?id=609</link>
			<guid>http://www.icylife.net/yunshu/show.php?id=609</guid>
			<description>
				<![CDATA[
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 前几天和我家ICY看徐志摩，林徽因，陆小曼，金岳霖，梁思成那一堆人的八卦故事，找到了一封徐志摩写给陆小曼的情书。看了一下，边看边吐。如果你能够面不改色的大声读完，那么恭喜你，你可以去某国的国家电视台播新闻了。</p><p>龙龙：<br />
<br />
我的肝肠寸寸的断了。今晚再不好好的给你一封信，再不把我的心给你看，我就不配爱你，就不配受你的爱。我的小龙呀，这实在是太难受了。我现在不愿别的只愿我伴着你一同吃苦。&mdash;&mdash;你方才心头一阵阵的绞痛，我在旁边只是咬紧牙关闭着眼替你熬着。龙呀，让你血液里的讨命鬼来找着我吧，叫我眼看你这样生生的受罪，我什么意念都变了灰了！<br />
<br />
&hellip;&hellip;<br />
<br />
啊我的龙，这时候你睡熟了没有？你的呼吸调匀了没有？你的灵魂暂时平安了没有？你知不知道你的爱正在含着两眼热泪，在这深夜里和你说话，想你，疼你，安慰你，爱你？我好恨呀，这一层层的隔膜，真的全是隔膜：这仿佛是你淹在水里挣扎着要命，他们却掷下瓦片石块来，算是救渡你！我好恨呀，这酒的力量还不够大，方才我站在旁边，我是完全准备了的，我知道我的龙儿的心坎儿只嚷着：&ldquo;我冷呀，我要他的热胸膛依着我；我痛呀，我要我的他搂着我；我倦呀，我要在他的手臂内得到我最想望的安息与舒服！&rdquo;&mdash;&mdash;但是实际上只能在旁边站着看，我稍徽的一帮助，就受人干涉，意思说：&ldquo;不劳费心，这不关你的事，请你早云休息吧，她不用你管。&rdquo;哼，你不用我管！我这难受，你大约也有些觉着吧。&hellip;&hellip;<br />
<br />
龙，我的至爱，将来你永诀尘俗的俄顷，不能没有我在你的最近的边旁；你最后的呼吸一定得明白报告这世间你的心是谁的，你的爱是谁的，你的灵魂是谁的。龙呀，你应当知道我是怎样的爱你；你占有我的爱，我的灵，我的肉，我的&ldquo;整个儿&rdquo;永远在我爱的身旁放置着，永久的缠绕着。真的，龙龙！你有时真想拉你一同情死去，去到绝对的死的寂灭里去实现完全的爱，去到普通的黑暗里去寻求唯一的光明。</p>
				]]>
			</description>
			<pubDate>Fri, 22 Aug 2008 12:31:13 +0800</pubDate>
		</item>
		<item>
			<title><![CDATA[两个故事]]></title>
			<category>八卦</category>
			<author>wustyunshu@yahoo.com.cn(云舒)</author>
			<link>http://www.icylife.net/yunshu/show.php?id=608</link>
			<guid>http://www.icylife.net/yunshu/show.php?id=608</guid>
			<description>
				<![CDATA[
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 累的头晕眼花，编两个故事消遣一下。如有雷同，那肯定是你抄我的。</p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 第一个是英雄的故事。很久以前，有一个古老而又很有特色的国家。这个国家民主，富裕，发达，但是遗憾的是大家都跑得不快。后来有一天，这个国家出现了一个跑得很快的人，甚至跑赢了以跑步速度快而著称的飞毛腿先生。于是乎，他出名了，大家都认为他是英雄。有些人是发自内心的，有些人是为了自己的利益，有些人是为了陶冶别人的爱国情操，有些人是因为脑残&mdash;&mdash;总之基本上都认为他是英雄，敢反对的都被打入另册。就这样，这个人成了英雄。本来他自己是不相信自己是英雄的，但是大家都这么认为，他就也相信了。</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;可是后来有一天，他在一个很重要的赌博中跑步摔倒了，输了，没有得到象征千王之王的牌子。于是乎，大家就把他踩在了脚下，当然这些人当中，依然包含了发自内心的，为了自己的利益的，陶冶别人爱国情操的，和脑残的。本来就是一个普通人，被一个喜欢陶冶别人爱国主义情操的队伍在身上树起了一块散发着英雄光芒的牌子，最后又被踩成连普通人都不如的懦夫。不过既然享受了英雄的荣耀，那么就也忍受一下被人踩的感觉吧&mdash;&mdash;享受的同时应该能料到的。</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 一块牌子而已，得了也就那样，丢了也就那样。看看北方的巨人吧，已经在痛扁敢冒犯他威严的邻居了&mdash;&mdash;有人敢说这个没有牌子的国家是病夫么？</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 第二个故事是关于C133P的。从前有很多C133P，传说每一个人都有很多钱。原来他们考完了C133P之后，发现上班也不是特别理想，就去写书，写一些考C133P的秘技，结果书卖得很好，于是乎有钱了。读了他们的书的那些人，考试也都通过了，也发现了工作的不如意，于是灵机一动也去写书，最终也发达了，一代接一代&hellip;&hellip;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 纯属消遣，没有一点是真的。</p>
				]]>
			</description>
			<pubDate>Wed, 20 Aug 2008 18:16:43 +0800</pubDate>
		</item>
		<item>
			<title><![CDATA[几个免费的方案]]></title>
			<category>技术</category>
			<author>wustyunshu@yahoo.com.cn(云舒)</author>
			<link>http://www.icylife.net/yunshu/show.php?id=607</link>
			<guid>http://www.icylife.net/yunshu/show.php?id=607</guid>
			<description>
				<![CDATA[
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 最近没什么好写的，推荐几个东西吧，可能有些人不知道。其实有些免费的东西，或者开源的东西，都不错，差的就在于都是一个个零散的东西，没有做成一个系统的方案。不过有些集成的东西逐渐成熟了，一般的场合用一下，应该问题不大。</p>
<ul>
    <li>OSSIM</li>
</ul>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; OSSIM是一个开源的SOC（Security Operations Center）系统，官方主页是<a href="http://www.ossim.net/" target="_blank">http://www.ossim.net/</a>，它可以集中管理多个免费的安全工具，如Nessus，Snorts，Tcptrack，OSSEC，Nagios，Ntop等等。提供一个完整的WEB界面，可提供监控，报警，定时扫描，报表等服务，形成一套完整的解决方案。</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img height="358" width="640" src="http://www.ossim.net/screenshots/metrics.png" alt="" /></p>
<ul>
    <li>Sguil</li>
</ul>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Sguil是一个网络流量安全分析监控系统，官方主页在<a href="http://sguil.sourceforge.net/" target="_blank">http://sguil.sourceforge.net/</a>，它是Snort的WEB前端，提供实时的流量监控，可以查看每一个事件，状态连接，以及原始的数据包信息，简单的说，就是一个NIDS系统。</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img height="456" width="640" src="http://sguil.sourceforge.net/images/sguil_main.png" alt="" /></p>
<ul>
    <li>Inprotect</li>
</ul>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Inprotect类似是OSSIM的精简版，只保留了管理扫描器的功能，主要是管理Nessus和Nmap，提供报表，定时扫描等功能。Nessus和Nmap虽然开源免费，功能强大，但是免费版都没有很好的报表可供管理人员解读，以便了解宏观的网络安全状况，Inprotect恰好弥补了这一点。吴鲁加曾经在2004年写过一篇文章《用自由软件构建中小企业弱点评估系统》，介绍过Inprotect，不过那时候似乎做企业安全的人不多，都在搞溢出。</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 目前商业版的扫描工具，在扫描方面并不比Nessus出色，某些公司的只怕还不如，只是报表做得好看一点。用Inprotect来管理后台的Nessus和Nmap做漏洞管理，是个不错的选择。</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img alt="" src="http://sourceforge.net/dbimage.php?id=149150" /></p>
<ul>
    <li>Panabit</li>
</ul>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Panabit是国人自己基于FreeBSD做的一个流量管理系统，类似于IPS，不开源，但是可免费使用。功能非常强大，可解码非常多的应用层协议，包括各种P2P协议的管理&mdash;&mdash;我想这个应该是很多网络管理人员头疼的事情吧。官方主页是<a target="_blank" href="http://www.panabit.com/">http://www.panabit.com/</a>，中文的，文档也比较全。据我所知，国内有些公司在内网会部署Panabit来做P2P流量控制。不过IPS之类的系统，要想有更大的市场，做互备可能是免不了的&mdash;&mdash;就算不开启阻断功能，也会担心单点故障啊。</p>
				]]>
			</description>
			<pubDate>Tue, 19 Aug 2008 16:13:33 +0800</pubDate>
		</item>
		<item>
			<title><![CDATA[今天是鬼节]]></title>
			<category>琐记</category>
			<author>wustyunshu@yahoo.com.cn(云舒)</author>
			<link>http://www.icylife.net/yunshu/show.php?id=606</link>
			<guid>http://www.icylife.net/yunshu/show.php?id=606</guid>
			<description>
				<![CDATA[
<p>今天农历七月十五，俗说的鬼节，佛家叫做盂兰盆节，道家称为中元节。</p>
<p>中元的名称，是由上元而来。上元佳节，就是元宵了。元宵佳节要用灯笼庆祝，所以中元节也免不了放灯。不过人鬼有别，人为阳，鬼为阴；陆为阳，水为阴。所以上元张灯在陆地，中元张灯在水里。无数盏灯，放在水中轻轻飘着，星星点点，在朦胧的烟气中闪烁，倒也颇有点《倩女幽魂》那种凄美迷离的意境。至于为什么中元是鬼节，道家是这么讲的，&ldquo;天官紫微大帝赐福，诞于正月十五，称上元节。地官清虚大帝赦罪，诞于七月十五，称中元节。水官洞阴大帝解厄，诞于十月十五，称下元节。中元地官清虚大帝于七月十五中元时普渡孤魂野鬼，有罪的人也可向其祈求赦罪。&rdquo;《修行记》云，&ldquo;中元日 ，地官降下，定人间善恶，道士於是夜诵经，饿节囚徒亦得解脱。&rdquo;</p>
<p>盂兰盆，梵文Ullam-bana的音译。盂兰是倒悬的意思，说轮回就像倒悬的蝙蝠一样，是痛苦的，而在这天供奉则可接触逝者像倒悬一样的苦。盆&mdash;&mdash;不好意思，就是盆，装东西吃的那东西。佛家一向是讲究人生即苦的，《心经》中有八苦，生，老，病，死，怨憎会，爱别离，求不得。而且所谓&ldquo;人生在世如身处荆棘林中，心不动则人不妄动，不动则不伤&rdquo;，怎么彻底解脱？供奉，信佛&hellip;&hellip;怕苦的人还是有的，所以佛教也就兴盛起来了，这也就是他们比道教牛X有市场的地方。就像现在卖防火墙的，先DDOS你一下，怕了吧？没关系，我们的设备可以防御。扯远了，对于盂兰盆佛经中是这么说的，&ldquo;有目莲僧者，法力宏大。其母堕落饿鬼道中，食物入口，即化为烈焰，饥苦太甚。目莲无法解救母厄，于是求教于佛，为说盂兰盆经，教于七月十五日作盂兰盆以救其母。&rdquo;</p>
<p>不过上面的都是和谐版，在我老家，流行的是另外两个个佛家传说。地藏王菩萨看见自己的母亲在地狱受苦，于是在七月十五这天用佛经和禅杖，闯进地狱最底层，将他的母亲救了出来。但是由于他打破了鬼门关，导致很多鬼混跟着他后面跑了出来，为祸人间。所以人们在这天晚上，供奉布施，并且在水上点灯，指引他们回到冥界。另一个传说还是上面的目莲和尚&mdash;&mdash;目莲和尚并没有通过盂兰盆会将他的母亲从地狱救出来，于是用自己的愿力打开地狱，不惜放尽地狱中的八百万恶鬼，才救出自己的母亲。佛祖为了惩罚他，将其贬入凡间，并让他再将那八百万恶鬼一个一个地招回地狱。于是目连下届，转世为人，就是写出&ldquo;我花开尽百花杀&rdquo;的黄巢，杀尽八百万恶鬼转世，将他们重新带回地狱。又想起了本朝的一位诗人，&ldquo;遍地哀鸿满城血，无非一念救苍生&rdquo;，罢了，这个就不多说。</p>
<p>城里对鬼节没什么感觉，但是在农村还是很隆重的，我记得小时候在农村老家七月十五晚上，基本上是没人赶外出走夜路的。都在家祭拜祖先的，傍晚时分有些人家还要拿些饭菜到水边，一般是池塘边，给那些可怜的孤魂野鬼享用。在饭菜旁边，点上蜡烛，少些冥币，为鬼魂引路。从这样来看，道教的灯会和佛教的施舍自动结合到了一起，倒也很有意思。</p>
				]]>
			</description>
			<pubDate>Fri, 15 Aug 2008 14:31:45 +0800</pubDate>
		</item>
		<item>
			<title><![CDATA[内网架构，又头疼了]]></title>
			<category>技术</category>
			<author>wustyunshu@yahoo.com.cn(云舒)</author>
			<link>http://www.icylife.net/yunshu/show.php?id=605</link>
			<guid>http://www.icylife.net/yunshu/show.php?id=605</guid>
			<description>
				<![CDATA[
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 最近开始设计新大楼的内网架构，又头疼了。</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 和yahoo的，以及其它一些公司的情况完全不同。网络非常大，各个子公司之间的互相访问，员工位置在不同大楼之间的频繁变动，非常的麻烦。常规基于用户名的动态vlan划分等成熟方案都不是很适合，基本上没有可以参考的设计。</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 这是一个挑战，不过我会努力试试。</p>
				]]>
			</description>
			<pubDate>Fri, 15 Aug 2008 11:04:28 +0800</pubDate>
		</item>
		<item>
			<title><![CDATA[FlashGet都出溢出了]]></title>
			<category>技术</category>
			<author>wustyunshu@yahoo.com.cn(云舒)</author>
			<link>http://www.icylife.net/yunshu/show.php?id=604</link>
			<guid>http://www.icylife.net/yunshu/show.php?id=604</guid>
			<description>
				<![CDATA[
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 刚才hi群里面，有人发了一个FlashGet的溢出，POC在<a target="_blank" href="http://www.milw0rm.com/exploits/6240">http://www.milw0rm.com/exploits/6240</a>，确实很有意思啊。如果自己做一个假的FTP服务器，就可以坐等别人自己送上门了。只要自己写一个支持登陆，CWD，PWD等三个命令的假FTP服务器就行了，登陆的地方随便什么密码都返回成功，直到PWD命令的时候，返回一个超长的字符串，然后就!@#$%了。</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; FTP服务器架好了，就剩下两个问题，第一是怎么让别人找到这个连接。第二个就是怎么调用FlashGet来下载。这个不难，首先第一个问题，用骗的&hellip;&hellip; 你可以针对别人的爱好，比如说想看NBC开幕式的，你就告诉他你有高清版的NBC开幕式下载。喜欢看日本动作片的，你可以告诉他你有大量日本动作大片下 载。只要对方想看，把你做的网页发过去就行了。</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 现在要解决的是第二个问题，怎么调用flashget下载链接。这个其实也不难的，仔细想想，不是很多下载网站都有一个flashget下载专用地址么？ 我们要做的就是把那里的代码扒出来。其实就是js对原始URL做一些变换，调用其中的convertFgURL函数和 Flashget_SetHref_js函数就可以了。JS代码如下：</p>
<pre class="javascript"><ol><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"><span style="color: rgb(0, 51, 102); font-weight: bold;">var</span> fg_base64EncodeChars = <span style="color: rgb(51, 102, 204);">&quot;ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/&quot;</span>;</div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"><span style="color: rgb(0, 51, 102); font-weight: bold;">var</span> fg_base64DecodeChars = <span style="color: rgb(0, 51, 102); font-weight: bold;">new</span> Array<span style="color: rgb(102, 204, 102);">(</span></div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"><span style="color: rgb(204, 0, 0);">-1</span>, <span style="color: rgb(204, 0, 0);">-1</span>, <span style="color: rgb(204, 0, 0);">-1</span>, <span style="color: rgb(204, 0, 0);">-1</span>, <span style="color: rgb(204, 0, 0);">-1</span>, <span style="color: rgb(204, 0, 0);">-1</span>, <span style="color: rgb(204, 0, 0);">-1</span>, <span style="color: rgb(204, 0, 0);">-1</span>, <span style="color: rgb(204, 0, 0);">-1</span>, <span style="color: rgb(204, 0, 0);">-1</span>, <span style="color: rgb(204, 0, 0);">-1</span>, <span style="color: rgb(204, 0, 0);">-1</span>, <span style="color: rgb(204, 0, 0);">-1</span>, <span style="color: rgb(204, 0, 0);">-1</span>, <span style="color: rgb(204, 0, 0);">-1</span>, <span style="color: rgb(204, 0, 0);">-1</span>,</div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"><span style="color: rgb(204, 0, 0);">-1</span>, <span style="color: rgb(204, 0, 0);">-1</span>, <span style="color: rgb(204, 0, 0);">-1</span>, <span style="color: rgb(204, 0, 0);">-1</span>, <span style="color: rgb(204, 0, 0);">-1</span>, <span style="color: rgb(204, 0, 0);">-1</span>, <span style="color: rgb(204, 0, 0);">-1</span>, <span style="color: rgb(204, 0, 0);">-1</span>, <span style="color: rgb(204, 0, 0);">-1</span>, <span style="color: rgb(204, 0, 0);">-1</span>, <span style="color: rgb(204, 0, 0);">-1</span>, <span style="color: rgb(204, 0, 0);">-1</span>, <span style="color: rgb(204, 0, 0);">-1</span>, <span style="color: rgb(204, 0, 0);">-1</span>, <span style="color: rgb(204, 0, 0);">-1</span>, <span style="color: rgb(204, 0, 0);">-1</span>,</div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"><span style="color: rgb(204, 0, 0);">-1</span>, <span style="color: rgb(204, 0, 0);">-1</span>, <span style="color: rgb(204, 0, 0);">-1</span>, <span style="color: rgb(204, 0, 0);">-1</span>, <span style="color: rgb(204, 0, 0);">-1</span>, <span style="color: rgb(204, 0, 0);">-1</span>, <span style="color: rgb(204, 0, 0);">-1</span>, <span style="color: rgb(204, 0, 0);">-1</span>, <span style="color: rgb(204, 0, 0);">-1</span>, <span style="color: rgb(204, 0, 0);">-1</span>, <span style="color: rgb(204, 0, 0);">-1</span>, <span style="color: rgb(204, 0, 0);">62</span>, <span style="color: rgb(204, 0, 0);">-1</span>, <span style="color: rgb(204, 0, 0);">-1</span>, <span style="color: rgb(204, 0, 0);">-1</span>, <span style="color: rgb(204, 0, 0);">63</span>,</div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"><span style="color: rgb(204, 0, 0);">52</span>, <span style="color: rgb(204, 0, 0);">53</span>, <span style="color: rgb(204, 0, 0);">54</span>, <span style="color: rgb(204, 0, 0);">55</span>, <span style="color: rgb(204, 0, 0);">56</span>, <span style="color: rgb(204, 0, 0);">57</span>, <span style="color: rgb(204, 0, 0);">58</span>, <span style="color: rgb(204, 0, 0);">59</span>, <span style="color: rgb(204, 0, 0);">60</span>, <span style="color: rgb(204, 0, 0);">61</span>, <span style="color: rgb(204, 0, 0);">-1</span>, <span style="color: rgb(204, 0, 0);">-1</span>, <span style="color: rgb(204, 0, 0);">-1</span>, <span style="color: rgb(204, 0, 0);">-1</span>, <span style="color: rgb(204, 0, 0);">-1</span>, <span style="color: rgb(204, 0, 0);">-1</span>,</div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"><span style="color: rgb(204, 0, 0);">-1</span>,  <span style="color: rgb(204, 0, 0);">0</span>,  <span style="color: rgb(204, 0, 0);">1</span>,  <span style="color: rgb(204, 0, 0);">2</span>,  <span style="color: rgb(204, 0, 0);">3</span>,  <span style="color: rgb(204, 0, 0);">4</span>,  <span style="color: rgb(204, 0, 0);">5</span>,  <span style="color: rgb(204, 0, 0);">6</span>,  <span style="color: rgb(204, 0, 0);">7</span>,  <span style="color: rgb(204, 0, 0);">8</span>,  <span style="color: rgb(204, 0, 0);">9</span>, <span style="color: rgb(204, 0, 0);">10</span>, <span style="color: rgb(204, 0, 0);">11</span>, <span style="color: rgb(204, 0, 0);">12</span>, <span style="color: rgb(204, 0, 0);">13</span>, <span style="color: rgb(204, 0, 0);">14</span>,</div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"><span style="color: rgb(204, 0, 0);">15</span>, <span style="color: rgb(204, 0, 0);">16</span>, <span style="color: rgb(204, 0, 0);">17</span>, <span style="color: rgb(204, 0, 0);">18</span>, <span style="color: rgb(204, 0, 0);">19</span>, <span style="color: rgb(204, 0, 0);">20</span>, <span style="color: rgb(204, 0, 0);">21</span>, <span style="color: rgb(204, 0, 0);">22</span>, <span style="color: rgb(204, 0, 0);">23</span>, <span style="color: rgb(204, 0, 0);">24</span>, <span style="color: rgb(204, 0, 0);">25</span>, <span style="color: rgb(204, 0, 0);">-1</span>, <span style="color: rgb(204, 0, 0);">-1</span>, <span style="color: rgb(204, 0, 0);">-1</span>, <span style="color: rgb(204, 0, 0);">-1</span>, <span style="color: rgb(204, 0, 0);">-1</span>,</div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"><span style="color: rgb(204, 0, 0);">-1</span>, <span style="color: rgb(204, 0, 0);">26</span>, <span style="color: rgb(204, 0, 0);">27</span>, <span style="color: rgb(204, 0, 0);">28</span>, <span style="color: rgb(204, 0, 0);">29</span>, <span style="color: rgb(204, 0, 0);">30</span>, <span style="color: rgb(204, 0, 0);">31</span>, <span style="color: rgb(204, 0, 0);">32</span>, <span style="color: rgb(204, 0, 0);">33</span>, <span style="color: rgb(204, 0, 0);">34</span>, <span style="color: rgb(204, 0, 0);">35</span>, <span style="color: rgb(204, 0, 0);">36</span>, <span style="color: rgb(204, 0, 0);">37</span>, <span style="color: rgb(204, 0, 0);">38</span>, <span style="color: rgb(204, 0, 0);">39</span>, <span style="color: rgb(204, 0, 0);">40</span>,</div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"><span style="color: rgb(204, 0, 0);">41</span>, <span style="color: rgb(204, 0, 0);">42</span>, <span style="color: rgb(204, 0, 0);">43</span>, <span style="color: rgb(204, 0, 0);">44</span>, <span style="color: rgb(204, 0, 0);">45</span>, <span style="color: rgb(204, 0, 0);">46</span>, <span style="color: rgb(204, 0, 0);">47</span>, <span style="color: rgb(204, 0, 0);">48</span>, <span style="color: rgb(204, 0, 0);">49</span>, <span style="color: rgb(204, 0, 0);">50</span>, <span style="color: rgb(204, 0, 0);">51</span>, <span style="color: rgb(204, 0, 0);">-1</span>, <span style="color: rgb(204, 0, 0);">-1</span>, <span style="color: rgb(204, 0, 0);">-1</span>, <span style="color: rgb(204, 0, 0);">-1</span>, <span style="color: rgb(204, 0, 0);">-1</span><span style="color: rgb(102, 204, 102);">)</span>;</div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">&nbsp;</div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"><span style="color: rgb(0, 51, 102); font-weight: bold;">function</span> fg_base64encode<span style="color: rgb(102, 204, 102);">(</span>str<span style="color: rgb(102, 204, 102);">)</span> <span style="color: rgb(102, 204, 102);">{</span></div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"><span style="color: rgb(0, 51, 102); font-weight: bold;">var</span> out, i, len;</div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"><span style="color: rgb(0, 51, 102); font-weight: bold;">var</span> c1, c2, c3;</div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">&nbsp;</div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">len = str.<span style="color: rgb(0, 102, 0);">length</span>;</div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">i = <span style="color: rgb(204, 0, 0);">0</span>;</div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">out = <span style="color: rgb(51, 102, 204);">&quot;&quot;</span>;</div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"><span style="color: rgb(0, 0, 102); font-weight: bold;">while</span><span style="color: rgb(102, 204, 102);">(</span>i &lt; len<span style="color: rgb(102, 204, 102);">)</span> <span style="color: rgb(102, 204, 102);">{</span></div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">c1 = str.<span style="color: rgb(0, 102, 0);">charCodeAt</span><span style="color: rgb(102, 204, 102);">(</span>i++<span style="color: rgb(102, 204, 102);">)</span> &amp; 0xff;</div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"><span style="color: rgb(0, 0, 102); font-weight: bold;">if</span><span style="color: rgb(102, 204, 102);">(</span>i == len<span style="color: rgb(102, 204, 102);">)</span></div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"><span style="color: rgb(102, 204, 102);">{</span></div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">out += fg_base64EncodeChars.<span style="color: rgb(0, 102, 0);">charAt</span><span style="color: rgb(102, 204, 102);">(</span>c1 &gt;&gt; <span style="color: rgb(204, 0, 0);">2</span><span style="color: rgb(102, 204, 102);">)</span>;</div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">out += fg_base64EncodeChars.<span style="color: rgb(0, 102, 0);">charAt</span><span style="color: rgb(102, 204, 102);">(</span><span style="color: rgb(102, 204, 102);">(</span>c1 &amp; 0x3<span style="color: rgb(102, 204, 102);">)</span> &lt;&lt; <span style="color: rgb(204, 0, 0);">4</span><span style="color: rgb(102, 204, 102);">)</span>;</div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">out += <span style="color: rgb(51, 102, 204);">&quot;==&quot;</span>;</div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"><span style="color: rgb(0, 0, 102); font-weight: bold;">break</span>;</div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"><span style="color: rgb(102, 204, 102);">}</span></div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">c2 = str.<span style="color: rgb(0, 102, 0);">charCodeAt</span><span style="color: rgb(102, 204, 102);">(</span>i++<span style="color: rgb(102, 204, 102);">)</span>;</div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"><span style="color: rgb(0, 0, 102); font-weight: bold;">if</span><span style="color: rgb(102, 204, 102);">(</span>i == len<span style="color: rgb(102, 204, 102);">)</span></div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"><span style="color: rgb(102, 204, 102);">{</span></div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">out += fg_base64EncodeChars.<span style="color: rgb(0, 102, 0);">charAt</span><span style="color: rgb(102, 204, 102);">(</span>c1 &gt;&gt; <span style="color: rgb(204, 0, 0);">2</span><span style="color: rgb(102, 204, 102);">)</span>;</div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">out += fg_base64EncodeChars.<span style="color: rgb(0, 102, 0);">charAt</span><span style="color: rgb(102, 204, 102);">(</span><span style="color: rgb(102, 204, 102);">(</span><span style="color: rgb(102, 204, 102);">(</span>c1 &amp; 0x3<span style="color: rgb(102, 204, 102);">)</span>&lt;&lt; <span style="color: rgb(204, 0, 0);">4</span><span style="color: rgb(102, 204, 102);">)</span> | <span style="color: rgb(102, 204, 102);">(</span><span style="color: rgb(102, 204, 102);">(</span>c2 &amp; 0xF0<span style="color: rgb(102, 204, 102);">)</span> &gt;&gt; <span style="color: rgb(204, 0, 0);">4</span><span style="color: rgb(102, 204, 102);">)</span><span style="color: rgb(102, 204, 102);">)</span>;</div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">out += fg_base64EncodeChars.<span style="color: rgb(0, 102, 0);">charAt</span><span style="color: rgb(102, 204, 102);">(</span><span style="color: rgb(102, 204, 102);">(</span>c2 &amp; 0xF<span style="color: rgb(102, 204, 102);">)</span> &lt;&lt; <span style="color: rgb(204, 0, 0);">2</span><span style="color: rgb(102, 204, 102);">)</span>;</div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">out += <span style="color: rgb(51, 102, 204);">&quot;=&quot;</span>;</div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"><span style="color: rgb(0, 0, 102); font-weight: bold;">break</span>;</div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"><span style="color: rgb(102, 204, 102);">}</span></div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">c3 = str.<span style="color: rgb(0, 102, 0);">charCodeAt</span><span style="color: rgb(102, 204, 102);">(</span>i++<span style="color: rgb(102, 204, 102);">)</span>;</div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">out += fg_base64EncodeChars.<span style="color: rgb(0, 102, 0);">charAt</span><span style="color: rgb(102, 204, 102);">(</span>c1 &gt;&gt; <span style="color: rgb(204, 0, 0);">2</span><span style="color: rgb(102, 204, 102);">)</span>;</div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">out += fg_base64EncodeChars.<span style="color: rgb(0, 102, 0);">charAt</span><span style="color: rgb(102, 204, 102);">(</span><span style="color: rgb(102, 204, 102);">(</span><span style="color: rgb(102, 204, 102);">(</span>c1 &amp; 0x3<span style="color: rgb(102, 204, 102);">)</span>&lt;&lt; <span style="color: rgb(204, 0, 0);">4</span><span style="color: rgb(102, 204, 102);">)</span> | <span style="color: rgb(102, 204, 102);">(</span><span style="color: rgb(102, 204, 102);">(</span>c2 &amp; 0xF0<span style="color: rgb(102, 204, 102);">)</span> &gt;&gt; <span style="color: rgb(204, 0, 0);">4</span><span style="color: rgb(102, 204, 102);">)</span><span style="color: rgb(102, 204, 102);">)</span>;</div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">out += fg_base64EncodeChars.<span style="color: rgb(0, 102, 0);">charAt</span><span style="color: rgb(102, 204, 102);">(</span><span style="color: rgb(102, 204, 102);">(</span><span style="color: rgb(102, 204, 102);">(</span>c2 &amp; 0xF<span style="color: rgb(102, 204, 102);">)</span> &lt;&lt; <span style="color: rgb(204, 0, 0);">2</span><span style="color: rgb(102, 204, 102);">)</span> | <span style="color: rgb(102, 204, 102);">(</span><span style="color: rgb(102, 204, 102);">(</span>c3 &amp; 0xC0<span style="color: rgb(102, 204, 102);">)</span> &gt;&gt;<span style="color: rgb(204, 0, 0);">6</span><span style="color: rgb(102, 204, 102);">)</span><span style="color: rgb(102, 204, 102);">)</span>;</div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">out += fg_base64EncodeChars.<span style="color: rgb(0, 102, 0);">charAt</span><span style="color: rgb(102, 204, 102);">(</span>c3 &amp; 0x3F<span style="color: rgb(102, 204, 102);">)</span>;</div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"><span style="color: rgb(102, 204, 102);">}</span></div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"><span style="color: rgb(0, 0, 102); font-weight: bold;">return</span> out;</div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"><span style="color: rgb(102, 204, 102);">}</span></div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">&nbsp;</div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"><span style="color: rgb(0, 51, 102); font-weight: bold;">function</span> fg_base64decode<span style="color: rgb(102, 204, 102);">(</span>str<span style="color: rgb(102, 204, 102);">)</span> <span style="color: rgb(102, 204, 102);">{</span></div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"><span style="color: rgb(0, 51, 102); font-weight: bold;">var</span> c1, c2, c3, c4;</div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"><span style="color: rgb(0, 51, 102); font-weight: bold;">var</span> i, len, out;</div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">&nbsp;</div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">len = str.<span style="color: rgb(0, 102, 0);">length</span>;</div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">i = <span style="color: rgb(204, 0, 0);">0</span>;</div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">out = <span style="color: rgb(51, 102, 204);">&quot;&quot;</span>;</div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"><span style="color: rgb(0, 0, 102); font-weight: bold;">while</span><span style="color: rgb(102, 204, 102);">(</span>i &lt; len<span style="color: rgb(102, 204, 102);">)</span> <span style="color: rgb(102, 204, 102);">{</span></div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"><span style="color: rgb(0, 153, 0); font-style: italic;">/* c1 */</span></div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"><span style="color: rgb(0, 0, 102); font-weight: bold;">do</span> <span style="color: rgb(102, 204, 102);">{</span></div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">c1 = fg_base64DecodeChars<span style="color: rgb(102, 204, 102);">[</span>str.<span style="color: rgb(0, 102, 0);">charCodeAt</span><span style="color: rgb(102, 204, 102);">(</span>i++<span style="color: rgb(102, 204, 102);">)</span> &amp; 0xff<span style="color: rgb(102, 204, 102);">]</span>;</div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"><span style="color: rgb(102, 204, 102);">}</span> <span style="color: rgb(0, 0, 102); font-weight: bold;">while</span><span style="color: rgb(102, 204, 102);">(</span>i &lt; len &amp;&amp; c1 == <span style="color: rgb(204, 0, 0);">-1</span><span style="color: rgb(102, 204, 102);">)</span>;</div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"><span style="color: rgb(0, 0, 102); font-weight: bold;">if</span><span style="color: rgb(102, 204, 102);">(</span>c1 == <span style="color: rgb(204, 0, 0);">-1</span><span style="color: rgb(102, 204, 102);">)</span></div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"><span style="color: rgb(0, 0, 102); font-weight: bold;">break</span>;</div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">&nbsp;</div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"><span style="color: rgb(0, 153, 0); font-style: italic;">/* c2 */</span></div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"><span style="color: rgb(0, 0, 102); font-weight: bold;">do</span> <span style="color: rgb(102, 204, 102);">{</span></div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">c2 = fg_base64DecodeChars<span style="color: rgb(102, 204, 102);">[</span>str.<span style="color: rgb(0, 102, 0);">charCodeAt</span><span style="color: rgb(102, 204, 102);">(</span>i++<span style="color: rgb(102, 204, 102);">)</span> &amp; 0xff<span style="color: rgb(102, 204, 102);">]</span>;</div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"><span style="color: rgb(102, 204, 102);">}</span> <span style="color: rgb(0, 0, 102); font-weight: bold;">while</span><span style="color: rgb(102, 204, 102);">(</span>i &lt; len &amp;&amp; c2 == <span style="color: rgb(204, 0, 0);">-1</span><span style="color: rgb(102, 204, 102);">)</span>;</div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"><span style="color: rgb(0, 0, 102); font-weight: bold;">if</span><span style="color: rgb(102, 204, 102);">(</span>c2 == <span style="color: rgb(204, 0, 0);">-1</span><span style="color: rgb(102, 204, 102);">)</span></div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"><span style="color: rgb(0, 0, 102); font-weight: bold;">break</span>;</div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">&nbsp;</div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">out += String.<span style="color: rgb(0, 102, 0);">fromCharCode</span><span style="color: rgb(102, 204, 102);">(</span><span style="color: rgb(102, 204, 102);">(</span>c1 &lt;&lt; <span style="color: rgb(204, 0, 0);">2</span><span style="color: rgb(102, 204, 102);">)</span> | <span style="color: rgb(102, 204, 102);">(</span><span style="color: rgb(102, 204, 102);">(</span>c2 &amp; 0x30<span style="color: rgb(102, 204, 102);">)</span> &gt;&gt; <span style="color: rgb(204, 0, 0);">4</span><span style="color: rgb(102, 204, 102);">)</span><span style="color: rgb(102, 204, 102);">)</span>;</div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">&nbsp;</div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"><span style="color: rgb(0, 153, 0); font-style: italic;">/* c3 */</span></div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"><span style="color: rgb(0, 0, 102); font-weight: bold;">do</span> <span style="color: rgb(102, 204, 102);">{</span></div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">c3 = str.<span style="color: rgb(0, 102, 0);">charCodeAt</span><span style="color: rgb(102, 204, 102);">(</span>i++<span style="color: rgb(102, 204, 102);">)</span> &amp; 0xff;</div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"><span style="color: rgb(0, 0, 102); font-weight: bold;">if</span><span style="color: rgb(102, 204, 102);">(</span>c3 == <span style="color: rgb(204, 0, 0);">61</span><span style="color: rgb(102, 204, 102);">)</span></div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"><span style="color: rgb(0, 0, 102); font-weight: bold;">return</span> out;</div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">c3 = fg_base64DecodeChars<span style="color: rgb(102, 204, 102);">[</span>c3<span style="color: rgb(102, 204, 102);">]</span>;</div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"><span style="color: rgb(102, 204, 102);">}</span> <span style="color: rgb(0, 0, 102); font-weight: bold;">while</span><span style="color: rgb(102, 204, 102);">(</span>i &lt; len &amp;&amp; c3 == <span style="color: rgb(204, 0, 0);">-1</span><span style="color: rgb(102, 204, 102);">)</span>;</div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"><span style="color: rgb(0, 0, 102); font-weight: bold;">if</span><span style="color: rgb(102, 204, 102);">(</span>c3 == <span style="color: rgb(204, 0, 0);">-1</span><span style="color: rgb(102, 204, 102);">)</span></div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"><span style="color: rgb(0, 0, 102); font-weight: bold;">break</span>;</div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">&nbsp;</div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">out += String.<span style="color: rgb(0, 102, 0);">fromCharCode</span><span style="color: rgb(102, 204, 102);">(</span><span style="color: rgb(102, 204, 102);">(</span><span style="color: rgb(102, 204, 102);">(</span>c2 &amp; 0XF<span style="color: rgb(102, 204, 102);">)</span> &lt;&lt; <span style="color: rgb(204, 0, 0);">4</span><span style="color: rgb(102, 204, 102);">)</span> | <span style="color: rgb(102, 204, 102);">(</span><span style="color: rgb(102, 204, 102);">(</span>c3 &amp; 0x3C<span style="color: rgb(102, 204, 102);">)</span> &gt;&gt; <span style="color: rgb(204, 0, 0);">2</span><span style="color: rgb(102, 204, 102);">)</span><span style="color: rgb(102, 204, 102);">)</span>;</div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">&nbsp;</div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"><span style="color: rgb(0, 153, 0); font-style: italic;">/* c4 */</span></div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"><span style="color: rgb(0, 0, 102); font-weight: bold;">do</span> <span style="color: rgb(102, 204, 102);">{</span></div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">c4 = str.<span style="color: rgb(0, 102, 0);">charCodeAt</span><span style="color: rgb(102, 204, 102);">(</span>i++<span style="color: rgb(102, 204, 102);">)</span> &amp; 0xff;</div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"><span style="color: rgb(0, 0, 102); font-weight: bold;">if</span><span style="color: rgb(102, 204, 102);">(</span>c4 == <span style="color: rgb(204, 0, 0);">61</span><span style="color: rgb(102, 204, 102);">)</span></div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"><span style="color: rgb(0, 0, 102); font-weight: bold;">return</span> out;</div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">c4 = fg_base64DecodeChars<span style="color: rgb(102, 204, 102);">[</span>c4<span style="color: rgb(102, 204, 102);">]</span>;</div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"><span style="color: rgb(102, 204, 102);">}</span> <span style="color: rgb(0, 0, 102); font-weight: bold;">while</span><span style="color: rgb(102, 204, 102);">(</span>i &lt; len &amp;&amp; c4 == <span style="color: rgb(204, 0, 0);">-1</span><span style="color: rgb(102, 204, 102);">)</span>;</div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"><span style="color: rgb(0, 0, 102); font-weight: bold;">if</span><span style="color: rgb(102, 204, 102);">(</span>c4 == <span style="color: rgb(204, 0, 0);">-1</span><span style="color: rgb(102, 204, 102);">)</span></div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"><span style="color: rgb(0, 0, 102); font-weight: bold;">break</span>;</div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">out += String.<span style="color: rgb(0, 102, 0);">fromCharCode</span><span style="color: rgb(102, 204, 102);">(</span><span style="color: rgb(102, 204, 102);">(</span><span style="color: rgb(102, 204, 102);">(</span>c3 &amp; 0x03<span style="color: rgb(102, 204, 102);">)</span> &lt;&lt; <span style="color: rgb(204, 0, 0);">6</span><span style="color: rgb(102, 204, 102);">)</span> | c4<span style="color: rgb(102, 204, 102);">)</span>;</div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"><span style="color: rgb(102, 204, 102);">}</span></div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"><span style="color: rgb(0, 0, 102); font-weight: bold;">return</span> out;</div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"><span style="color: rgb(102, 204, 102);">}</span></div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">&nbsp;</div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"><span style="color: rgb(0, 51, 102); font-weight: bold;">function</span> fg_utf16to8<span style="color: rgb(102, 204, 102);">(</span>str<span style="color: rgb(102, 204, 102);">)</span> <span style="color: rgb(102, 204, 102);">{</span></div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"><span style="color: rgb(0, 51, 102); font-weight: bold;">var</span> out, i, len, c;</div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">&nbsp;</div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">out = <span style="color: rgb(51, 102, 204);">&quot;&quot;</span>;</div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">len = str.<span style="color: rgb(0, 102, 0);">length</span>;</div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"><span style="color: rgb(0, 0, 102); font-weight: bold;">for</span><span style="color: rgb(102, 204, 102);">(</span>i = <span style="color: rgb(204, 0, 0);">0</span>; i &lt; len; i++<span style="color: rgb(102, 204, 102);">)</span> <span style="color: rgb(102, 204, 102);">{</span></div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">c = str.<span style="color: rgb(0, 102, 0);">charCodeAt</span><span style="color: rgb(102, 204, 102);">(</span>i<span style="color: rgb(102, 204, 102);">)</span>;</div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"><span style="color: rgb(0, 0, 102); font-weight: bold;">if</span> <span style="color: rgb(102, 204, 102);">(</span><span style="color: rgb(102, 204, 102);">(</span>c &gt;= 0x0001<span style="color: rgb(102, 204, 102);">)</span> &amp;&amp; <span style="color: rgb(102, 204, 102);">(</span>c &lt;= 0x007F<span style="color: rgb(102, 204, 102);">)</span><span style="color: rgb(102, 204, 102);">)</span> <span style="color: rgb(102, 204, 102);">{</span></div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">out += str.<span style="color: rgb(0, 102, 0);">charAt</span><span style="color: rgb(102, 204, 102);">(</span>i<span style="color: rgb(102, 204, 102);">)</span>;</div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"><span style="color: rgb(102, 204, 102);">}</span> <span style="color: rgb(0, 0, 102); font-weight: bold;">else</span> <span style="color: rgb(0, 0, 102); font-weight: bold;">if</span> <span style="color: rgb(102, 204, 102);">(</span>c &gt; 0x07FF<span style="color: rgb(102, 204, 102);">)</span> <span style="color: rgb(102, 204, 102);">{</span></div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">out += String.<span style="color: rgb(0, 102, 0);">fromCharCode</span><span style="color: rgb(102, 204, 102);">(</span>0xE0 | <span style="color: rgb(102, 204, 102);">(</span><span style="color: rgb(102, 204, 102);">(</span>c &gt;&gt; <span style="color: rgb(204, 0, 0);">12</span><span style="color: rgb(102, 204, 102);">)</span> &amp; 0x0F<span style="color: rgb(102, 204, 102);">)</span><span style="color: rgb(102, 204, 102);">)</span>;</div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">out += String.<span style="color: rgb(0, 102, 0);">fromCharCode</span><span style="color: rgb(102, 204, 102);">(</span>0x80 | <span style="color: rgb(102, 204, 102);">(</span><span style="color: rgb(102, 204, 102);">(</span>c &gt;&gt;  <span style="color: rgb(204, 0, 0);">6</span><span style="color: rgb(102, 204, 102);">)</span> &amp; 0x3F<span style="color: rgb(102, 204, 102);">)</span><span style="color: rgb(102, 204, 102);">)</span>;</div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">out += String.<span style="color: rgb(0, 102, 0);">fromCharCode</span><span style="color: rgb(102, 204, 102);">(</span>0x80 | <span style="color: rgb(102, 204, 102);">(</span><span style="color: rgb(102, 204, 102);">(</span>c &gt;&gt;  <span style="color: rgb(204, 0, 0);">0</span><span style="color: rgb(102, 204, 102);">)</span> &amp; 0x3F<span style="color: rgb(102, 204, 102);">)</span><span style="color: rgb(102, 204, 102);">)</span>;</div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"><span style="color: rgb(102, 204, 102);">}</span> <span style="color: rgb(0, 0, 102); font-weight: bold;">else</span> <span style="color: rgb(102, 204, 102);">{</span></div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">out += String.<span style="color: rgb(0, 102, 0);">fromCharCode</span><span style="color: rgb(102, 204, 102);">(</span>0xC0 | <span style="color: rgb(102, 204, 102);">(</span><span style="color: rgb(102, 204, 102);">(</span>c &gt;&gt;  <span style="color: rgb(204, 0, 0);">6</span><span style="color: rgb(102, 204, 102);">)</span> &amp; 0x1F<span style="color: rgb(102, 204, 102);">)</span><span style="color: rgb(102, 204, 102);">)</span>;</div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">out += String.<span style="color: rgb(0, 102, 0);">fromCharCode</span><span style="color: rgb(102, 204, 102);">(</span>0x80 | <span style="color: rgb(102, 204, 102);">(</span><span style="color: rgb(102, 204, 102);">(</span>c &gt;&gt;  <span style="color: rgb(204, 0, 0);">0</span><span style="color: rgb(102, 204, 102);">)</span> &amp; 0x3F<span style="color: rgb(102, 204, 102);">)</span><span style="color: rgb(102, 204, 102);">)</span>;</div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"><span style="color: rgb(102, 204, 102);">}</span></div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"><span style="color: rgb(102, 204, 102);">}</span></div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"><span style="color: rgb(0, 0, 102); font-weight: bold;">return</span> out;</div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"><span style="color: rgb(102, 204, 102);">}</span></div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">&nbsp;</div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"><span style="color: rgb(0, 51, 102); font-weight: bold;">function</span> fg_utf8to16<span style="color: rgb(102, 204, 102);">(</span>str<span style="color: rgb(102, 204, 102);">)</span> <span style="color: rgb(102, 204, 102);">{</span></div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"><span style="color: rgb(0, 51, 102); font-weight: bold;">var</span> out, i, len, c;</div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"><span style="color: rgb(0, 51, 102); font-weight: bold;">var</span> char2, char3;</div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">&nbsp;</div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">out = <span style="color: rgb(51, 102, 204);">&quot;&quot;</span>;</div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">len = str.<span style="color: rgb(0, 102, 0);">length</span>;</div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">i = <span style="color: rgb(204, 0, 0);">0</span>;</div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"><span style="color: rgb(0, 0, 102); font-weight: bold;">while</span><span style="color: rgb(102, 204, 102);">(</span>i &lt; len<span style="color: rgb(102, 204, 102);">)</span> <span style="color: rgb(102, 204, 102);">{</span></div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">c = str.<span style="color: rgb(0, 102, 0);">charCodeAt</span><span style="color: rgb(102, 204, 102);">(</span>i++<span style="color: rgb(102, 204, 102);">)</span>;</div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"><span style="color: rgb(0, 0, 102); font-weight: bold;">switch</span><span style="color: rgb(102, 204, 102);">(</span>c &gt;&gt; <span style="color: rgb(204, 0, 0);">4</span><span style="color: rgb(102, 204, 102);">)</span></div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"><span style="color: rgb(102, 204, 102);">{</span></div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"><span style="color: rgb(0, 0, 102); font-weight: bold;">case</span> <span style="color: rgb(204, 0, 0);">0</span>: <span style="color: rgb(0, 0, 102); font-weight: bold;">case</span> <span style="color: rgb(204, 0, 0);">1</span>: <span style="color: rgb(0, 0, 102); font-weight: bold;">case</span> <span style="color: rgb(204, 0, 0);">2</span>: <span style="color: rgb(0, 0, 102); font-weight: bold;">case</span> <span style="color: rgb(204, 0, 0);">3</span>: <span style="color: rgb(0, 0, 102); font-weight: bold;">case</span> <span style="color: rgb(204, 0, 0);">4</span>: <span style="color: rgb(0, 0, 102); font-weight: bold;">case</span> <span style="color: rgb(204, 0, 0);">5</span>: <span style="color: rgb(0, 0, 102); font-weight: bold;">case</span> <span style="color: rgb(204, 0, 0);">6</span>: <span style="color: rgb(0, 0, 102); font-weight: bold;">case</span> <span style="color: rgb(204, 0, 0);">7</span>:</div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"><span style="color: rgb(0, 153, 0); font-style: italic;">// 0xxxxxxx</span></div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">out += str.<span style="color: rgb(0, 102, 0);">charAt</span><span style="color: rgb(102, 204, 102);">(</span>i<span style="color: rgb(204, 0, 0);">-1</span><span style="color: rgb(102, 204, 102);">)</span>;</div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"><span style="color: rgb(0, 0, 102); font-weight: bold;">break</span>;</div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"><span style="color: rgb(0, 0, 102); font-weight: bold;">case</span> <span style="color: rgb(204, 0, 0);">12</span>: <span style="color: rgb(0, 0, 102); font-weight: bold;">case</span> <span style="color: rgb(204, 0, 0);">13</span>:</div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"><span style="color: rgb(0, 153, 0); font-style: italic;">// 110x xxxx   10xx xxxx</span></div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">char2 = str.<span style="color: rgb(0, 102, 0);">charCodeAt</span><span style="color: rgb(102, 204, 102);">(</span>i++<span style="color: rgb(102, 204, 102);">)</span>;</div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">out += String.<span style="color: rgb(0, 102, 0);">fromCharCode</span><span style="color: rgb(102, 204, 102);">(</span><span style="color: rgb(102, 204, 102);">(</span><span style="color: rgb(102, 204, 102);">(</span>c &amp; 0x1F<span style="color: rgb(102, 204, 102);">)</span> &lt;&lt; <span style="color: rgb(204, 0, 0);">6</span><span style="color: rgb(102, 204, 102);">)</span> | <span style="color: rgb(102, 204, 102);">(</span>char2 &amp; 0x3F<span style="color: rgb(102, 204, 102);">)</span><span style="color: rgb(102, 204, 102);">)</span>;</div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"><span style="color: rgb(0, 0, 102); font-weight: bold;">break</span>;</div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"><span style="color: rgb(0, 0, 102); font-weight: bold;">case</span> <span style="color: rgb(204, 0, 0);">14</span>:</div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"><span style="color: rgb(0, 153, 0); font-style: italic;">// 1110 xxxx  10xx xxxx  10xx xxxx</span></div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">char2 = str.<span style="color: rgb(0, 102, 0);">charCodeAt</span><span style="color: rgb(102, 204, 102);">(</span>i++<span style="color: rgb(102, 204, 102);">)</span>;</div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">char3 = str.<span style="color: rgb(0, 102, 0);">charCodeAt</span><span style="color: rgb(102, 204, 102);">(</span>i++<span style="color: rgb(102, 204, 102);">)</span>;</div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">out += String.<span style="color: rgb(0, 102, 0);">fromCharCode</span><span style="color: rgb(102, 204, 102);">(</span><span style="color: rgb(102, 204, 102);">(</span><span style="color: rgb(102, 204, 102);">(</span>c &amp; 0x0F<span style="color: rgb(102, 204, 102);">)</span> &lt;&lt; <span style="color: rgb(204, 0, 0);">12</span><span style="color: rgb(102, 204, 102);">)</span> |</div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"><span style="color: rgb(102, 204, 102);">(</span><span style="color: rgb(102, 204, 102);">(</span>char2 &amp; 0x3F<span style="color: rgb(102, 204, 102);">)</span> &lt;&lt; <span style="color: rgb(204, 0, 0);">6</span><span style="color: rgb(102, 204, 102);">)</span> |</div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"><span style="color: rgb(102, 204, 102);">(</span><span style="color: rgb(102, 204, 102);">(</span>char3 &amp; 0x3F<span style="color: rgb(102, 204, 102);">)</span> &lt;&lt; <span style="color: rgb(204, 0, 0);">0</span><span style="color: rgb(102, 204, 102);">)</span><span style="color: rgb(102, 204, 102);">)</span>;</div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"><span style="color: rgb(0, 0, 102); font-weight: bold;">break</span>;</div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"><span style="color: rgb(102, 204, 102);">}</span></div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"><span style="color: rgb(102, 204, 102);">}</span></div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">&nbsp;</div></li