<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>火星信息安全研究院C/C++</title>
	<atom:link href="http://www.h4ck.org.cn/tag/cc/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.h4ck.org.cn</link>
	<description>Hack-Crack  信息安全 【Institute Of Information Serurity From Mars】</description>
	<lastBuildDate>Sat, 04 Feb 2012 13:59:16 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>Moving to Windows x64【翻译】</title>
		<link>http://www.h4ck.org.cn/2011/12/moving-to-windows-x64-translate-to-ch/</link>
		<comments>http://www.h4ck.org.cn/2011/12/moving-to-windows-x64-translate-to-ch/#comments</comments>
		<pubDate>Fri, 16 Dec 2011 04:06:43 +0000</pubDate>
		<dc:creator>obaby</dc:creator>
				<category><![CDATA[发表的文章『Posted ArticleS』]]></category>
		<category><![CDATA[破解/汇编『Crack/Asm』]]></category>
		<category><![CDATA[ASM]]></category>
		<category><![CDATA[C/C++]]></category>

		<guid isPermaLink="false">http://www.h4ck.org.cn/?p=3530</guid>
		<description><![CDATA[Moving to Windows x64【翻译】]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.h4ck.org.cn/wp-content/uploads//2011/12/move.png" rel="lightbox" title="move"><img title="move" src="http://www.h4ck.org.cn/wp-content/uploads//2011/12/move.png" alt="" width="687" height="410" /></a></p>
<p>目前翻译完了第一部分。进行中…… <img src='http://www.h4ck.org.cn/wp-content/plugins/smilies-themer/Julianus/20x20-big_smile.png' alt=':)' class='wp-smiley' /> 猛击<a href="http://dl.dbank.com/c0tk3b7x7z" target="_blank">此处</a>下载预览版本，目前翻译到进程内通讯，大约是全文的一半。 <img src='http://www.h4ck.org.cn/wp-content/plugins/smilies-themer/Julianus/20x20-big_smile.png' alt=':)' class='wp-smiley' /> </p>
<p>已经全部完成，猛击<a href="http://bbs.pediy.com/showthread.php?t=145198" target="_blank">此处</a>下载！<br />
<h3>相关文章</h3>
<ul class="related_posts">
<li><a href="http://www.h4ck.org.cn/2011/11/cdelphi-execute-cmd-commands-and-get-result/" title="C/C++/Delphi 调用命令并且显示执行结果" rel="bookmark inlinks">C/C++/Delphi 调用命令并且显示执行结果</a><span class="count">( 0 )</span></li>
<li><a href="http://www.h4ck.org.cn/2011/10/hashab-for-ios-4-x/" title="HashAB for iOS 4.x " rel="bookmark inlinks">HashAB for iOS 4.x </a><span class="count">( 0 )</span></li>
<li><a href="http://www.h4ck.org.cn/2011/03/windows-customized-gina-in-safe-modewindows-xp/" title="Windows Customized Gina In Safe Mode(Windows xp)" rel="bookmark inlinks">Windows Customized Gina In Safe Mode(Windows xp)</a><span class="count">( 3 )</span></li>
<li><a href="http://www.h4ck.org.cn/2011/01/windows-customized-gina-source-code/" title="Windows Customized Gina Source Code" rel="bookmark inlinks">Windows Customized Gina Source Code</a><span class="count">( 1 )</span></li>
<li><a href="http://www.h4ck.org.cn/2011/09/winasm-keygen-theme/" title="WinASM KeyGen 模板" rel="bookmark inlinks">WinASM KeyGen 模板</a><span class="count">( 0 )</span></li>
<li><a href="http://www.h4ck.org.cn/2010/04/get-device-type/" title="获取指定类型的设备，符号链接" rel="bookmark inlinks">获取指定类型的设备，符号链接</a><span class="count">( 0 )</span></li>
<li><a href="http://www.h4ck.org.cn/2011/01/wsock32-hook-send-and-recv-functions/" title="WSock32 Hook send and recv Functions" rel="bookmark inlinks">WSock32 Hook send and recv Functions</a><span class="count">( 1 )</span></li>
<li><a href="http://www.h4ck.org.cn/2011/10/hex2ascii-ascii2hex/" title="HEX2ASCII &#038;&#038; ASCII2HEX" rel="bookmark inlinks">HEX2ASCII &#038;&#038; ASCII2HEX</a><span class="count">( 0 )</span></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.h4ck.org.cn/2011/12/moving-to-windows-x64-translate-to-ch/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>VS2010 + IDASDK6.2搭建IDA Plugin开发环境</title>
		<link>http://www.h4ck.org.cn/2011/11/vs2010-idasdk6-2-ida-plugin-development/</link>
		<comments>http://www.h4ck.org.cn/2011/11/vs2010-idasdk6-2-ida-plugin-development/#comments</comments>
		<pubDate>Tue, 29 Nov 2011 08:50:14 +0000</pubDate>
		<dc:creator>obaby</dc:creator>
				<category><![CDATA[插件『IDA/OD Plugin』]]></category>
		<category><![CDATA[程序设计『Programing』]]></category>
		<category><![CDATA[C/C++]]></category>
		<category><![CDATA[IDA]]></category>

		<guid isPermaLink="false">http://www.h4ck.org.cn/?p=3438</guid>
		<description><![CDATA[VS2010 + IDASDK6.2搭建IDA Plugin开发环境]]></description>
			<content:encoded><![CDATA[<p>这里使用的开发环境是vs2010，不过几乎所有的设置在早期版本的vs中基本是一致的。启动vs之后关闭其他的项目和解决方案，然后按照下面的流程创作工程即可。</p>
<ol>
<li>执行菜单的File-&gt;New-&gt;Project… (Ctrl-Shift-N)打开新建工程窗口。</li>
<li>展开左侧的Visual C++项目模板分支，然后选择右侧的Win32 Project条目，输入工程名称，然后点击确定。</li>
</ol>
<p><a href="http://www.h4ck.org.cn/wp-content/uploads//2011/11/1.png" rel="lightbox" title="1"><img title="1" src="http://www.h4ck.org.cn/wp-content/uploads//2011/11/1.png" alt="" width="669" height="462" /></a><br />
<span id="more-3438"></span></p>
<ol>
<li>在Win32Application Wizard先到出现之后，点击左侧的Application Settings连接，在设置界面勾选Windows Application选项，然后选择Empty Project，点击完成按钮退出向导。</li>
</ol>
<p><a href="http://www.h4ck.org.cn/wp-content/uploads//2011/11/2.png" rel="lightbox" title="2"><img title="2" src="http://www.h4ck.org.cn/wp-content/uploads//2011/11/2.png" alt="" width="615" height="524" /></a></p>
<ol>
<li>在左侧的解决方案浏览器中，点击源文件，执行添加，新建项添加新的源文件。</li>
</ol>
<p><a href="http://www.h4ck.org.cn/wp-content/uploads//2011/11/3.png" rel="lightbox" title="3"><img title="3" src="http://www.h4ck.org.cn/wp-content/uploads//2011/11/3.png" alt="" width="582" height="333" /></a></p>
<ol>
<li>选择C++文件模板，输入文件名称然后点击添加按钮添加此文件，重复此操作知道添加完所有文件。</li>
</ol>
<p><a href="http://www.h4ck.org.cn/wp-content/uploads//2011/11/4.png" rel="lightbox" title="4"><img title="4" src="http://www.h4ck.org.cn/wp-content/uploads//2011/11/4.png" alt="" width="669" height="462" /></a></p>
<ol>
<li>按照下面的格式修改项目属性。</li>
</ol>
<p>在左上方的配置下拉框中选择<strong>Release</strong>；</p>
<p>修改属性-&gt;常规，将配置类型修改为<strong>动态库</strong><strong>DLL</strong><strong>，目标文件扩展名修改为.plw</strong></p>
<p>C/C++-&gt;常规，附加包含目录添加ida sdk include目录，例如C:\IDA\SDK\Include</p>
<p><a href="http://www.h4ck.org.cn/wp-content/uploads//2011/11/51.png" rel="lightbox" title="5"><img title="5" src="http://www.h4ck.org.cn/wp-content/uploads//2011/11/51.png" alt="" width="487" height="315" /></a></p>
<p>C/C++-&gt;预处理器，添加__NT__;__IDP__字段到预处理器定义中。</p>
<p>C/C++-&gt;代码生成，关闭缓冲区安全检查，将基本运行时检查设为默认，将运行库设置为多线程（MT）</p>
<p><a href="http://www.h4ck.org.cn/wp-content/uploads//2011/11/6.png" rel="lightbox" title="6"><img title="6" src="http://www.h4ck.org.cn/wp-content/uploads//2011/11/6.png" alt="" width="752" height="495" /></a></p>
<p>C/C++-&gt;高级，将调用约定修改为__stdcall (/Gz)</p>
<p>连接器-&gt;常规，将输出文件修改为你的ida插件目录，例如E:\IDA 6.2\plugins</p>
<p><a href="http://www.h4ck.org.cn/wp-content/uploads//2011/11/7.png" rel="lightbox" title="7"><img title="7" src="http://www.h4ck.org.cn/wp-content/uploads//2011/11/7.png" alt="" width="752" height="495" /></a></p>
<p>连接器-&gt;输入，将ida.lib添加到附加依赖项中。</p>
<p><a href="http://www.h4ck.org.cn/wp-content/uploads//2011/11/8.png" rel="lightbox" title="8"><img title="8" src="http://www.h4ck.org.cn/wp-content/uploads//2011/11/8.png" alt="" width="752" height="495" /></a></p>
<p>连接器-&gt;调试，生成调试信息设置为否</p>
<p>连接器-&gt;命令行添加/EXPORT:PLUGIN</p>
<p>生成事件-&gt;后期生成事件，将ida添加到命令行中一边每次生成之后启动加载插件运行（可以不设置）</p>
<p>所有配置完成时候点击保存然后关闭设置窗口，在顶部的配置栏中选择release，即可。</p>
<p><a href="http://www.h4ck.org.cn/wp-content/uploads//2011/11/9.png" rel="lightbox" title="9"><img title="9" src="http://www.h4ck.org.cn/wp-content/uploads//2011/11/9.png" alt="" width="752" height="495" /></a></p>
<p>下面就可以开始写代码和进行测试了，这里有一个简单的插件模板，再次基础上完善即可创建一个新的插件：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
</pre></td><td class="code"><pre class="c" style="font-family:monospace;"><span style="color: #339933;">#include &lt;ida .hpp&gt;</span>
<span style="color: #339933;">#include &lt;idp .hpp&gt;</span>
<span style="color: #339933;">#include &lt;loader .hpp&gt;</span>
&nbsp;
<span style="color: #993333;">int</span> IDAP_init<span style="color: #009900;">&#40;</span><span style="color: #993333;">void</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #666666; font-style: italic;">// Do checks here to ensure your plug-in is being used within</span>
	<span style="color: #666666; font-style: italic;">// an environment it was written for. Return PLUGIN_SKIP if the 	</span>
	<span style="color: #666666; font-style: italic;">// checks fail, otherwise return PLUGIN_KEEP.</span>
&nbsp;
	<span style="color: #b1b100;">return</span> PLUGIN_KEEP<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #993333;">void</span> IDAP_term<span style="color: #009900;">&#40;</span><span style="color: #993333;">void</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #666666; font-style: italic;">// Stuff to do when exiting, generally you'd put any sort</span>
	<span style="color: #666666; font-style: italic;">// of clean-up jobs here.</span>
	<span style="color: #b1b100;">return</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// The plugin can be passed an integer argument from the plugins.cfg</span>
<span style="color: #666666; font-style: italic;">// file. This can be useful when you want the one plug-in to do</span>
<span style="color: #666666; font-style: italic;">// something different depending on the hot-key pressed or menu</span>
<span style="color: #666666; font-style: italic;">// item selected.</span>
<span style="color: #993333;">void</span> IDAP_run<span style="color: #009900;">&#40;</span><span style="color: #993333;">int</span> arg<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #666666; font-style: italic;">// The &quot;meat&quot; of your plug-in</span>
	msg<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;Hello world By obaby!<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	msg<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;This is My first IDA Plugin!<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	msg<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;Plugin templete Created by Steve Micallef!<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	msg<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;Thx for his Great Works!<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #b1b100;">return</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// There isn't much use for these yet, but I set them anyway.</span>
<span style="color: #993333;">char</span> IDAP_comment<span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> 	<span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;This is my test plug-in&quot;</span><span style="color: #339933;">;</span>
<span style="color: #993333;">char</span> IDAP_help<span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> 		<span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;My plugin&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// The name of the plug-in displayed in the Edit-&gt;Plugins menu. It can </span>
<span style="color: #666666; font-style: italic;">// be overridden in the user's plugins.cfg file.</span>
<span style="color: #993333;">char</span> IDAP_name<span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> 		<span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;My plugin&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// The hot-key the user can use to run your plug-in.</span>
<span style="color: #993333;">char</span> IDAP_hotkey<span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> 	<span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;Alt-X&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// The all-important exported PLUGIN object</span>
plugin_t PLUGIN <span style="color: #339933;">=</span>
<span style="color: #009900;">&#123;</span>
	IDP_INTERFACE_VERSION<span style="color: #339933;">,</span>	<span style="color: #666666; font-style: italic;">// IDA version plug-in is written for</span>
	<span style="color: #0000dd;">0</span><span style="color: #339933;">,</span>					<span style="color: #666666; font-style: italic;">// Flags (see below)</span>
	IDAP_init<span style="color: #339933;">,</span>			<span style="color: #666666; font-style: italic;">// Initialisation function</span>
	IDAP_term<span style="color: #339933;">,</span>			<span style="color: #666666; font-style: italic;">// Clean-up function</span>
	IDAP_run<span style="color: #339933;">,</span>				<span style="color: #666666; font-style: italic;">// Main plug-in body</span>
	IDAP_comment<span style="color: #339933;">,</span>			<span style="color: #666666; font-style: italic;">// Comment �unused</span>
	IDAP_help<span style="color: #339933;">,</span>			<span style="color: #666666; font-style: italic;">// As above �unused</span>
	IDAP_name<span style="color: #339933;">,</span>			<span style="color: #666666; font-style: italic;">// Plug-in name shown in </span>
	<span style="color: #666666; font-style: italic;">// Edit-&gt;Plugins menu</span>
	IDAP_hotkey			<span style="color: #666666; font-style: italic;">// Hot key to run the plug-in</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
<span style="color: #339933;">&lt;/</span>loader<span style="color: #339933;">&gt;&lt;/</span>idp<span style="color: #339933;">&gt;&lt;/</span>ida<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p>最后是一张效果图，至于其他的东西，以后可以继续写点东西。</p>
<p><a href="http://www.h4ck.org.cn/wp-content/uploads//2011/11/10.png" rel="lightbox" title="10"><img title="10" src="http://www.h4ck.org.cn/wp-content/uploads//2011/11/10.png" alt="" width="638" height="367" /></a></p>
<p><a href="http://dl.dbank.com/c0tdka4qpf" target="_blank">猛击此处下载pdf版本</a>！<br />
<h3>相关文章</h3>
<ul class="related_posts">
<li><a href="http://www.h4ck.org.cn/2011/05/kernel-debugging-with-ida-pro/" title="IDA调试Windows 内核" rel="bookmark inlinks">IDA调试Windows 内核</a><span class="count">( 0 )</span></li>
<li><a href="http://www.h4ck.org.cn/2011/09/comment-viewer-v-0-2/" title="Comment Viewer v.0.2" rel="bookmark inlinks">Comment Viewer v.0.2</a><span class="count">( 0 )</span></li>
<li><a href="http://www.h4ck.org.cn/2010/06/ida-sdk-5-5/" title="IDA Sdk 5.5" rel="bookmark inlinks">IDA Sdk 5.5</a><span class="count">( 0 )</span></li>
<li><a href="http://www.h4ck.org.cn/2010/02/libraryfunctions/" title="LibraryFunctions" rel="bookmark inlinks">LibraryFunctions</a><span class="count">( 0 )</span></li>
<li><a href="http://www.h4ck.org.cn/2010/07/wmi-based-system-share-detect-via-cc/" title="WMI Based System Share Detect Via C/C++" rel="bookmark inlinks">WMI Based System Share Detect Via C/C++</a><span class="count">( 0 )</span></li>
<li><a href="http://www.h4ck.org.cn/2009/10/cstringedit/" title="一道C++题｛字符串处理｝" rel="bookmark inlinks">一道C++题｛字符串处理｝</a><span class="count">( 0 )</span></li>
<li><a href="http://www.h4ck.org.cn/2011/07/unpack-64bit-exe-via-ida-debug-plugin/" title="IDA + Debug 插件 实现64Bit Exe脱壳" rel="bookmark inlinks">IDA + Debug 插件 实现64Bit Exe脱壳</a><span class="count">( 0 )</span></li>
<li><a href="http://www.h4ck.org.cn/2011/11/vs-compile-options/" title="微软C-C++ 编译器选项" rel="bookmark inlinks">微软C-C++ 编译器选项</a><span class="count">( 0 )</span></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.h4ck.org.cn/2011/11/vs2010-idasdk6-2-ida-plugin-development/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>C/C++/Delphi 调用命令并且显示执行结果</title>
		<link>http://www.h4ck.org.cn/2011/11/cdelphi-execute-cmd-commands-and-get-result/</link>
		<comments>http://www.h4ck.org.cn/2011/11/cdelphi-execute-cmd-commands-and-get-result/#comments</comments>
		<pubDate>Tue, 29 Nov 2011 06:38:57 +0000</pubDate>
		<dc:creator>obaby</dc:creator>
				<category><![CDATA[程序设计『Programing』]]></category>
		<category><![CDATA[C/C++]]></category>
		<category><![CDATA[Delphi]]></category>

		<guid isPermaLink="false">http://www.h4ck.org.cn/?p=3432</guid>
		<description><![CDATA[C/C++/Delphi 调用命令并且显示执行结果]]></description>
			<content:encoded><![CDATA[<p>C/C++ 代码：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
</pre></td><td class="code"><pre class="c" style="font-family:monospace;"><span style="color: #993333;">void</span> ExecutCmd<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	SECURITY_ATTRIBUTES sa<span style="color: #339933;">;</span>
	HANDLE hRead<span style="color: #339933;">,</span>hWrite<span style="color: #339933;">;</span>
	<span style="color: #993333;">wchar_t</span> <span style="color: #339933;">*</span> lpCommandLine <span style="color: #339933;">=</span>_T<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;ping.exe www.h4ck.org.cn &quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	sa.<span style="color: #202020;">nLength</span> <span style="color: #339933;">=</span> <span style="color: #993333;">sizeof</span><span style="color: #009900;">&#40;</span>SECURITY_ATTRIBUTES<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	sa.<span style="color: #202020;">lpSecurityDescriptor</span> <span style="color: #339933;">=</span> NULL<span style="color: #339933;">;</span>
	sa.<span style="color: #202020;">bInheritHandle</span> <span style="color: #339933;">=</span> TRUE<span style="color: #339933;">;</span>
&nbsp;
	TCHAR temp<span style="color: #009900;">&#91;</span><span style="color: #0000dd;">255</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span><span style="color: #0000dd;">0</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
	_tcscpy<span style="color: #009900;">&#40;</span>temp<span style="color: #339933;">,</span>lpCommandLine<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>CreatePipe<span style="color: #009900;">&#40;</span><span style="color: #339933;">&amp;</span>hRead<span style="color: #339933;">,&amp;</span>hWrite<span style="color: #339933;">,&amp;</span>sa<span style="color: #339933;">,</span><span style="color: #0000dd;">0</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		MessageBox<span style="color: #009900;">&#40;</span>_T<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;Error On CreatePipe()&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">return</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	STARTUPINFO si<span style="color: #339933;">;</span>
	PROCESS_INFORMATION pi<span style="color: #339933;">;</span>
	si.<span style="color: #202020;">cb</span> <span style="color: #339933;">=</span> <span style="color: #993333;">sizeof</span><span style="color: #009900;">&#40;</span>STARTUPINFO<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	GetStartupInfo<span style="color: #009900;">&#40;</span><span style="color: #339933;">&amp;</span>si<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	si.<span style="color: #202020;">hStdError</span> <span style="color: #339933;">=</span> hWrite<span style="color: #339933;">;</span>
	si.<span style="color: #202020;">hStdOutput</span> <span style="color: #339933;">=</span> hWrite<span style="color: #339933;">;</span>
	si.<span style="color: #202020;">wShowWindow</span> <span style="color: #339933;">=</span> SW_HIDE<span style="color: #339933;">;</span>
	si.<span style="color: #202020;">dwFlags</span> <span style="color: #339933;">=</span> STARTF_USESHOWWINDOW <span style="color: #339933;">|</span> STARTF_USESTDHANDLES<span style="color: #339933;">;</span>
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>CreateProcess<span style="color: #009900;">&#40;</span>NULL<span style="color: #339933;">,</span>temp
		<span style="color: #339933;">,</span>NULL<span style="color: #339933;">,</span>NULL<span style="color: #339933;">,</span>TRUE<span style="color: #339933;">,</span>NULL<span style="color: #339933;">,</span>NULL<span style="color: #339933;">,</span>NULL<span style="color: #339933;">,&amp;</span>si<span style="color: #339933;">,&amp;</span>pi<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			MessageBox<span style="color: #009900;">&#40;</span>_T<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;Error on CreateProcess()&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #b1b100;">return</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
	CloseHandle<span style="color: #009900;">&#40;</span>hWrite<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #993333;">char</span> buffer<span style="color: #009900;">&#91;</span><span style="color: #0000dd;">4096</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span><span style="color: #0000dd;">0</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
	DWORD bytesRead<span style="color: #339933;">;</span>
	<span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
		<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>ReadFile<span style="color: #009900;">&#40;</span>hRead<span style="color: #339933;">,</span>buffer<span style="color: #339933;">,</span>0x3FFu<span style="color: #339933;">,&amp;</span>bytesRead<span style="color: #339933;">,</span>NULL<span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> NULL<span style="color: #009900;">&#41;</span>
			<span style="color: #000000; font-weight: bold;">break</span><span style="color: #339933;">;</span>
		outputstr <span style="color: #339933;">+=</span> buffer<span style="color: #339933;">;</span><span style="color: #666666; font-style: italic;">//m_outputstr is CString</span>
		OutputDebugString<span style="color: #009900;">&#40;</span>outputstr<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		UpdateData<span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		Sleep<span style="color: #009900;">&#40;</span><span style="color: #0000dd;">200</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p><span id="more-3432"></span><br />
Delphi 代码：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
</pre></td><td class="code"><pre class="delphi" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">procedure</span> CheckResult<span style="color: #000066;">&#40;</span>b<span style="color: #000066;">:</span> <span style="color: #000066; font-weight: bold;">Boolean</span><span style="color: #000066;">&#41;</span><span style="color: #000066;">;</span> 
<span style="color: #000000; font-weight: bold;">begin</span> 
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #000000; font-weight: bold;">not</span> b <span style="color: #000000; font-weight: bold;">then</span> 
<span style="color: #000000; font-weight: bold;">raise</span> Exception<span style="color: #000066;">.</span><span style="color: #006600;">Create</span><span style="color: #000066;">&#40;</span><span style="color: #000066;">SysErrorMessage</span><span style="color: #000066;">&#40;</span><span style="color: #000066;">GetLastError</span><span style="color: #000066;">&#41;</span><span style="color: #000066;">&#41;</span><span style="color: #000066;">;</span> 
<span style="color: #000000; font-weight: bold;">end</span><span style="color: #000066;">;</span> 
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> RunDOS<span style="color: #000066;">&#40;</span><span style="color: #000000; font-weight: bold;">const</span> CommandLine<span style="color: #000066;">:</span> <span style="color: #000066; font-weight: bold;">string</span><span style="color: #000066;">&#41;</span><span style="color: #000066;">:</span> <span style="color: #000066; font-weight: bold;">string</span><span style="color: #000066;">;</span> 
<span style="color: #000000; font-weight: bold;">var</span> 
HRead<span style="color: #000066;">,</span> HWrite<span style="color: #000066;">:</span> <span style="color: #000066; font-weight: bold;">THandle</span><span style="color: #000066;">;</span> 
StartInfo<span style="color: #000066;">:</span> TStartupInfo<span style="color: #000066;">;</span> 
ProceInfo<span style="color: #000066;">:</span> TProcessInformation<span style="color: #000066;">;</span> 
b<span style="color: #000066;">:</span> <span style="color: #000066; font-weight: bold;">Boolean</span><span style="color: #000066;">;</span> 
sa<span style="color: #000066;">:</span> TSecurityAttributes<span style="color: #000066;">;</span> 
inS<span style="color: #000066;">:</span> THandleStream<span style="color: #000066;">;</span> 
sRet<span style="color: #000066;">:</span> TStrings<span style="color: #000066;">;</span> 
<span style="color: #000000; font-weight: bold;">begin</span> 
Result <span style="color: #000066;">:</span><span style="color: #000066;">=</span> <span style="color: #ff0000;">''</span><span style="color: #000066;">;</span> 
<span style="color: #000066;">FillChar</span><span style="color: #000066;">&#40;</span>sa<span style="color: #000066;">,</span> <span style="color: #000066;">sizeof</span><span style="color: #000066;">&#40;</span>sa<span style="color: #000066;">&#41;</span><span style="color: #000066;">,</span> <span style="color: #0000ff;">0</span><span style="color: #000066;">&#41;</span><span style="color: #000066;">;</span> 
<span style="color: #808080; font-style: italic;">//设置允许继承，否则在NT和2000下无法取得输出结果 </span>
sa<span style="color: #000066;">.</span><span style="color: #006600;">nLength</span> <span style="color: #000066;">:</span><span style="color: #000066;">=</span> <span style="color: #000066;">sizeof</span><span style="color: #000066;">&#40;</span>sa<span style="color: #000066;">&#41;</span><span style="color: #000066;">;</span> 
sa<span style="color: #000066;">.</span><span style="color: #006600;">bInheritHandle</span> <span style="color: #000066;">:</span><span style="color: #000066;">=</span> <span style="color: #000000; font-weight: bold;">True</span><span style="color: #000066;">;</span> 
sa<span style="color: #000066;">.</span><span style="color: #006600;">lpSecurityDescriptor</span> <span style="color: #000066;">:</span><span style="color: #000066;">=</span> <span style="color: #000000; font-weight: bold;">nil</span><span style="color: #000066;">;</span> 
b <span style="color: #000066;">:</span><span style="color: #000066;">=</span> CreatePipe<span style="color: #000066;">&#40;</span>HRead<span style="color: #000066;">,</span> HWrite<span style="color: #000066;">,</span> <span style="color: #000066;">@</span>sa<span style="color: #000066;">,</span> <span style="color: #0000ff;">0</span><span style="color: #000066;">&#41;</span><span style="color: #000066;">;</span> 
CheckResult<span style="color: #000066;">&#40;</span>b<span style="color: #000066;">&#41;</span><span style="color: #000066;">;</span> 
&nbsp;
<span style="color: #000066;">FillChar</span><span style="color: #000066;">&#40;</span>StartInfo<span style="color: #000066;">,</span> <span style="color: #000066;">SizeOf</span><span style="color: #000066;">&#40;</span>StartInfo<span style="color: #000066;">&#41;</span><span style="color: #000066;">,</span> <span style="color: #0000ff;">0</span><span style="color: #000066;">&#41;</span><span style="color: #000066;">;</span> 
StartInfo<span style="color: #000066;">.</span><span style="color: #006600;">cb</span> <span style="color: #000066;">:</span><span style="color: #000066;">=</span> <span style="color: #000066;">SizeOf</span><span style="color: #000066;">&#40;</span>StartInfo<span style="color: #000066;">&#41;</span><span style="color: #000066;">;</span> 
StartInfo<span style="color: #000066;">.</span><span style="color: #006600;">wShowWindow</span> <span style="color: #000066;">:</span><span style="color: #000066;">=</span> SW_HIDE<span style="color: #000066;">;</span> 
<span style="color: #808080; font-style: italic;">//使用指定的句柄作为标准输入输出的文件句柄,使用指定的显示方式 </span>
StartInfo<span style="color: #000066;">.</span><span style="color: #006600;">dwFlags</span> <span style="color: #000066;">:</span><span style="color: #000066;">=</span> STARTF_USESTDHANDLES <span style="color: #000000; font-weight: bold;">or</span> STARTF_USESHOWWINDOW<span style="color: #000066;">;</span> 
StartInfo<span style="color: #000066;">.</span><span style="color: #006600;">hStdError</span> <span style="color: #000066;">:</span><span style="color: #000066;">=</span> HWrite<span style="color: #000066;">;</span> 
StartInfo<span style="color: #000066;">.</span><span style="color: #006600;">hStdInput</span> <span style="color: #000066;">:</span><span style="color: #000066;">=</span> GetStdHandle<span style="color: #000066;">&#40;</span>STD_INPUT_HANDLE<span style="color: #000066;">&#41;</span><span style="color: #000066;">;</span> <span style="color: #808080; font-style: italic;">//HRead; </span>
StartInfo<span style="color: #000066;">.</span><span style="color: #006600;">hStdOutput</span> <span style="color: #000066;">:</span><span style="color: #000066;">=</span> HWrite<span style="color: #000066;">;</span> 
&nbsp;
b <span style="color: #000066;">:</span><span style="color: #000066;">=</span> CreateProcess<span style="color: #000066;">&#40;</span><span style="color: #000000; font-weight: bold;">nil</span><span style="color: #000066;">,</span> <span style="color: #808080; font-style: italic;">//lpApplicationName: PChar </span>
<span style="color: #000066; font-weight: bold;">PChar</span><span style="color: #000066;">&#40;</span>CommandLine<span style="color: #000066;">&#41;</span><span style="color: #000066;">,</span> <span style="color: #808080; font-style: italic;">//lpCommandLine: PChar </span>
<span style="color: #000000; font-weight: bold;">nil</span><span style="color: #000066;">,</span> <span style="color: #808080; font-style: italic;">//lpProcessAttributes: PSecurityAttributes </span>
<span style="color: #000000; font-weight: bold;">nil</span><span style="color: #000066;">,</span> <span style="color: #808080; font-style: italic;">//lpThreadAttributes: PSecurityAttributes </span>
<span style="color: #000000; font-weight: bold;">True</span><span style="color: #000066;">,</span> <span style="color: #808080; font-style: italic;">//bInheritHandles: BOOL </span>
CREATE_NEW_CONSOLE<span style="color: #000066;">,</span> 
<span style="color: #000000; font-weight: bold;">nil</span><span style="color: #000066;">,</span> 
<span style="color: #000000; font-weight: bold;">nil</span><span style="color: #000066;">,</span> 
StartInfo<span style="color: #000066;">,</span> 
ProceInfo<span style="color: #000066;">&#41;</span><span style="color: #000066;">;</span> 
&nbsp;
CheckResult<span style="color: #000066;">&#40;</span>b<span style="color: #000066;">&#41;</span><span style="color: #000066;">;</span> 
WaitForSingleObject<span style="color: #000066;">&#40;</span>ProceInfo<span style="color: #000066;">.</span><span style="color: #006600;">hProcess</span><span style="color: #000066;">,</span> INFINITE<span style="color: #000066;">&#41;</span><span style="color: #000066;">;</span> 
&nbsp;
inS <span style="color: #000066;">:</span><span style="color: #000066;">=</span> THandleStream<span style="color: #000066;">.</span><span style="color: #006600;">Create</span><span style="color: #000066;">&#40;</span>HRead<span style="color: #000066;">&#41;</span><span style="color: #000066;">;</span> 
<span style="color: #000000; font-weight: bold;">if</span> inS<span style="color: #000066;">.</span><span style="color: #006600;">Size</span> &gt; <span style="color: #0000ff;">0</span> <span style="color: #000000; font-weight: bold;">then</span> 
<span style="color: #000000; font-weight: bold;">begin</span> 
sRet <span style="color: #000066;">:</span><span style="color: #000066;">=</span> TStringList<span style="color: #000066;">.</span><span style="color: #006600;">Create</span><span style="color: #000066;">;</span> 
sRet<span style="color: #000066;">.</span><span style="color: #006600;">LoadFromStream</span><span style="color: #000066;">&#40;</span>inS<span style="color: #000066;">&#41;</span><span style="color: #000066;">;</span> 
Result <span style="color: #000066;">:</span><span style="color: #000066;">=</span> sRet<span style="color: #000066;">.</span><span style="color: #006600;">Text</span><span style="color: #000066;">;</span> 
sRet<span style="color: #000066;">.</span><span style="color: #006600;">Free</span><span style="color: #000066;">;</span> 
<span style="color: #000000; font-weight: bold;">end</span><span style="color: #000066;">;</span> 
inS<span style="color: #000066;">.</span><span style="color: #006600;">Free</span><span style="color: #000066;">;</span> 
&nbsp;
CloseHandle<span style="color: #000066;">&#40;</span>HRead<span style="color: #000066;">&#41;</span><span style="color: #000066;">;</span> 
CloseHandle<span style="color: #000066;">&#40;</span>HWrite<span style="color: #000066;">&#41;</span><span style="color: #000066;">;</span> 
<span style="color: #000000; font-weight: bold;">end</span><span style="color: #000066;">;</span></pre></td></tr></table></div>

<h3>相关文章</h3>
<ul class="related_posts">
<li><a href="http://www.h4ck.org.cn/2011/05/reg_multi_sz/" title="蛋疼的 REG_MULTI_SZ" rel="bookmark inlinks">蛋疼的 REG_MULTI_SZ</a><span class="count">( 4 )</span></li>
<li><a href="http://www.h4ck.org.cn/2010/07/wmi-based-system-share-detect-via-cc/" title="WMI Based System Share Detect Via C/C++" rel="bookmark inlinks">WMI Based System Share Detect Via C/C++</a><span class="count">( 0 )</span></li>
<li><a href="http://www.h4ck.org.cn/2011/11/let-them-drag-and-drop-files-on-your-program/" title="Let them drag and drop files on your program" rel="bookmark inlinks">Let them drag and drop files on your program</a><span class="count">( 0 )</span></li>
<li><a href="http://www.h4ck.org.cn/2011/01/detours-install/" title="VS2008安装Detours库 【Windows 7 64bit】" rel="bookmark inlinks">VS2008安装Detours库 【Windows 7 64bit】</a><span class="count">( 0 )</span></li>
<li><a href="http://www.h4ck.org.cn/2009/11/c-fangzhen/" title="C语言二维数组 打印方阵" rel="bookmark inlinks">C语言二维数组 打印方阵</a><span class="count">( 0 )</span></li>
<li><a href="http://www.h4ck.org.cn/2011/01/wsock32-hook-send-and-recv-functions/" title="WSock32 Hook send and recv Functions" rel="bookmark inlinks">WSock32 Hook send and recv Functions</a><span class="count">( 1 )</span></li>
<li><a href="http://www.h4ck.org.cn/2009/09/delphi-three-layer/" title="Delphi三层架构的精彩文章" rel="bookmark inlinks">Delphi三层架构的精彩文章</a><span class="count">( 0 )</span></li>
<li><a href="http://www.h4ck.org.cn/2010/01/drivers/" title="键盘过滤驱动勘误《寒江独钓》" rel="bookmark inlinks">键盘过滤驱动勘误《寒江独钓》</a><span class="count">( 0 )</span></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.h4ck.org.cn/2011/11/cdelphi-execute-cmd-commands-and-get-result/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>微软C-C++ 编译器选项</title>
		<link>http://www.h4ck.org.cn/2011/11/vs-compile-options/</link>
		<comments>http://www.h4ck.org.cn/2011/11/vs-compile-options/#comments</comments>
		<pubDate>Tue, 15 Nov 2011 03:58:26 +0000</pubDate>
		<dc:creator>obaby</dc:creator>
				<category><![CDATA[程序设计『Programing』]]></category>
		<category><![CDATA[C/C++]]></category>

		<guid isPermaLink="false">http://www.h4ck.org.cn/?p=3385</guid>
		<description><![CDATA[微软C-C++ 编译器选项]]></description>
			<content:encoded><![CDATA[<table id="AutoNumber1" style="width: 85%;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td colspan="3" align="center" width="100%"><strong>微软C/C++ 编译器选项</strong></td>
</tr>
<tr>
<td colspan="3" align="center" width="100%"><span style="color: #008000;"><strong>-优化- </strong></span></td>
</tr>
<tr>
<td width="22%">/O1</td>
<td width="32%">最小化空间</td>
<td width="46%">minimize space</td>
</tr>
<tr>
<td width="22%">/Op[-]</td>
<td width="32%">改善浮点数一致性</td>
<td width="46%">improve floating-pt consistency</td>
</tr>
<tr>
<td width="22%">/O2</td>
<td width="32%">最大化速度</td>
<td width="46%">maximize speed</td>
</tr>
<tr>
<td width="22%">/Os</td>
<td width="32%">优选代码空间</td>
<td width="46%">favor code space</td>
</tr>
<tr>
<td width="22%">/Oa</td>
<td width="32%">假设没有别名</td>
<td width="46%">assume no aliasing</td>
</tr>
<tr>
<td width="22%">/Ot</td>
<td width="32%">优选代码速度</td>
<td width="46%">favor code speed</td>
</tr>
<tr>
<td width="22%">/Ob</td>
<td width="32%">内联展开（默认 n=0）</td>
<td width="46%">inline expansion (default n=0)</td>
</tr>
<tr>
<td width="22%">/Ow</td>
<td width="32%">假设交叉函数别名</td>
<td width="46%">assume cross-function aliasing</td>
</tr>
<tr>
<td width="22%">/Od</td>
<td width="32%">禁用优化（默认值）</td>
<td width="46%">disable optimizations (default)</td>
</tr>
<tr>
<td width="22%">/Ox</td>
<td width="32%">最大化选项。(/Ogityb2 /Gs)</td>
<td width="46%">maximum opts. (/Ogityb1 /Gs)</td>
</tr>
<tr>
<td width="22%">/Og</td>
<td width="32%">启用全局优化</td>
<td width="46%">enable global optimization</td>
</tr>
<tr>
<td width="22%">/Oy[-]</td>
<td width="32%">启用框架指针省略</td>
<td width="46%">enable frame pointer omission</td>
</tr>
<tr>
<td width="22%">/Oi</td>
<td width="32%">启用内建函数</td>
<td width="46%">enable intrinsic functions</td>
</tr>
<tr>
<td colspan="3" align="center" width="100%"><strong>-代码生成- </strong></td>
</tr>
<tr>
<td width="22%">/G3</td>
<td width="32%">为 80386 进行优化</td>
<td width="46%">optimize for 80386</td>
</tr>
<tr>
<td width="22%">/G4</td>
<td width="32%">为 80486 进行优化</td>
<td width="46%">optimize for 80486</td>
</tr>
<tr>
<td width="22%">/GR[-]</td>
<td width="32%">启用 C++ RTTI</td>
<td width="46%">enable C++ RTTI</td>
</tr>
<tr>
<td width="22%">/G5</td>
<td width="32%">为 Pentium 进行优化</td>
<td width="46%">optimize for Pentium</td>
</tr>
<tr>
<td width="22%">/G6</td>
<td width="32%">为 Pentium Pro 进行优化</td>
<td width="46%">optimize for Pentium Pro</td>
</tr>
<tr>
<td width="22%">/GX[-]</td>
<td width="32%">启用 C++ 异常处理（与 /EHsc 相同）</td>
<td width="46%">enable C++ EH (same as /EHsc)</td>
</tr>
<tr>
<td width="22%">/EHs</td>
<td width="32%">启用同步 C++ 异常处理</td>
<td width="46%">enable synchronous C++ EH</td>
</tr>
<tr>
<td width="22%">/GD</td>
<td width="32%">为 Windows DLL 进行优化</td>
<td width="46%">optimize for Windows DLL</td>
</tr>
<tr>
<td width="22%">/GB</td>
<td width="32%">为混合模型进行优化（默认）</td>
<td width="46%">optimize for blended model (default)</td>
</tr>
<tr>
<td width="22%">/EHa</td>
<td width="32%">启用异步 C++ 异常处理</td>
<td width="46%">enable asynchronous C++ EH</td>
</tr>
<tr>
<td width="22%">/Gd</td>
<td width="32%">__cdecl 调用约定</td>
<td width="46%">__cdecl calling convention</td>
</tr>
<tr>
<td width="22%">/EHc</td>
<td width="32%">extern“C”默认为 nothrow</td>
<td width="46%">extern “C” defaults to nothrow</td>
</tr>
<tr>
<td width="22%">/Gr</td>
<td width="32%">__fastcall 调用约定</td>
<td width="46%">__fastcall calling convention</td>
</tr>
<tr>
<td width="22%">/Gi[-]</td>
<td width="32%">启用增量编译</td>
<td width="46%">enable incremental compilation</td>
</tr>
<tr>
<td width="22%">/Gz</td>
<td width="32%">__stdcall 调用约定</td>
<td width="46%">__stdcall calling convention</td>
</tr>
<tr>
<td width="22%">/Gm[-]</td>
<td width="32%">启用最小重新生成</td>
<td width="46%">enable minimal rebuild</td>
</tr>
<tr>
<td width="22%">/GA</td>
<td width="32%">为 Windows 应用程序进行优化</td>
<td width="46%">optimize for Windows Application</td>
</tr>
<tr>
<td width="22%">/Gf</td>
<td width="32%">启用字符串池</td>
<td width="46%">enable string pooling</td>
</tr>
<tr>
<td width="22%">/QIfdiv[-]</td>
<td width="32%">启用 Pentium FDIV 修复</td>
<td width="46%">enable Pentium FDIV fix</td>
</tr>
<tr>
<td width="22%">/GF</td>
<td width="32%">启用只读字符串池</td>
<td width="46%">enable read-only string pooling</td>
</tr>
<tr>
<td width="22%">/QI0f[-]</td>
<td width="32%">启用 Pentium 0x0f 修复</td>
<td width="46%">enable Pentium 0x0f fix</td>
</tr>
<tr>
<td width="22%">/Gy</td>
<td width="32%">分隔链接器函数</td>
<td width="46%">separate functions for linker</td>
</tr>
<tr>
<td width="22%">/GZ</td>
<td width="32%">启用运行时调试检查</td>
<td width="46%">enable runtime debug checks</td>
</tr>
<tr>
<td width="22%">/Gh</td>
<td width="32%">启用钩子函数调用</td>
<td width="46%">enable hook function call</td>
</tr>
<tr>
<td width="22%">/Ge</td>
<td width="32%">对所有函数强制堆栈检查</td>
<td width="46%">force stack checking for all funcs</td>
</tr>
<tr>
<td width="22%">/Gs[num]</td>
<td width="32%">禁用堆栈检查调用</td>
<td width="46%">disable stack checking calls</td>
</tr>
</tbody>
</table>
<p><span id="more-3385"></span></p>
<table id="AutoNumber1" style="width: 85%;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td colspan="3" align="center" width="100%"><strong>-输出文件- </strong></td>
</tr>
<tr>
<td width="22%">/Fa[file]</td>
<td width="32%">命名程序集列表文件</td>
<td width="46%">name assembly listing file</td>
</tr>
<tr>
<td width="22%">/Fo</td>
<td width="32%">命名对象文件</td>
<td width="46%">name object file</td>
</tr>
<tr>
<td width="22%">/FA[sc]</td>
<td width="32%">配置程序集列表</td>
<td width="46%">configure assembly listing</td>
</tr>
<tr>
<td width="22%">/Fp</td>
<td width="32%">命名预编译头文件</td>
<td width="46%">name precompiled header file</td>
</tr>
<tr>
<td width="22%">/Fd[file]</td>
<td width="32%">命名 .PDB 文件</td>
<td width="46%">name .PDB file</td>
</tr>
<tr>
<td width="22%">/Fr[file]</td>
<td width="32%">命名源浏览器文件</td>
<td width="46%">name source browser file</td>
</tr>
<tr>
<td width="22%">/Fe</td>
<td width="32%">命名可执行文件</td>
<td width="46%">name executable file</td>
</tr>
<tr>
<td width="22%">/FR[file]</td>
<td width="32%">命名扩展 .SBR 文件</td>
<td width="46%">name extended .SBR file</td>
</tr>
<tr>
<td width="22%">/Fm[file]</td>
<td width="32%">命名映射文件</td>
<td width="46%">name map file</td>
</tr>
<tr>
<td colspan="3" align="center" width="100%"><strong>-预处理器- </strong></td>
</tr>
<tr>
<td width="22%">/FI</td>
<td width="32%">命名强制包含文件</td>
<td width="46%">name forced include file</td>
</tr>
<tr>
<td width="22%">/C</td>
<td width="32%">不吸取注释</td>
<td width="46%">don&#8217;t strip comments</td>
</tr>
<tr>
<td width="22%">/U</td>
<td width="32%">移除预定义宏</td>
<td width="46%">remove predefined macro</td>
</tr>
<tr>
<td width="22%">/D{=|#}</td>
<td width="32%">定义宏</td>
<td width="46%">define macro</td>
</tr>
<tr>
<td width="22%">/u</td>
<td width="32%">移除所有预定义宏</td>
<td width="46%">remove all predefined macros</td>
</tr>
<tr>
<td width="22%">/E</td>
<td width="32%">将预处理定向到标准输出</td>
<td width="46%">preprocess to stdout</td>
</tr>
<tr>
<td width="22%">/I<dir></dir></td>
<td width="32%">添加到包含文件的搜索路径</td>
<td width="46%">add to include search path</td>
</tr>
<tr>
<td width="22%">/EP</td>
<td width="32%">将预处理定向到标准输出，不要带行号</td>
<td width="46%">preprocess to stdout, no #line</td>
</tr>
<tr>
<td width="22%">/X</td>
<td width="32%">忽略“标准位置”</td>
<td width="46%">ignore “standard places”</td>
</tr>
<tr>
<td width="22%">/P</td>
<td width="32%">预处理到文件</td>
<td width="46%">preprocess to file</td>
</tr>
<tr>
<td colspan="3" align="center" width="100%"><strong>-语言- </strong></td>
</tr>
<tr>
<td width="22%">/Zi</td>
<td width="32%">启用调试信息</td>
<td width="46%">enable debugging information</td>
</tr>
<tr>
<td width="22%">/Zl</td>
<td width="32%">忽略 .OBJ 中的默认库名</td>
<td width="46%">omit default library name in .OBJ</td>
</tr>
<tr>
<td width="22%">/ZI</td>
<td width="32%">启用调试信息的“编辑并继续”功能</td>
<td width="46%">enable Edit and Continue debug info</td>
</tr>
<tr>
<td width="22%">/Zg</td>
<td width="32%">生成函数原型</td>
<td width="46%">generate function prototypes</td>
</tr>
<tr>
<td width="22%">/Z7</td>
<td width="32%">启用旧式调试信息</td>
<td width="46%">enable old-style debug info</td>
</tr>
<tr>
<td width="22%">/Zs</td>
<td width="32%">只进行语法检查</td>
<td width="46%">syntax check only</td>
</tr>
<tr>
<td width="22%">/Zd</td>
<td width="32%">仅要行号调试信息</td>
<td width="46%">line number debugging info only</td>
</tr>
<tr>
<td width="22%">/vd{0|1}</td>
<td width="32%">禁用/启用 vtordisp</td>
<td width="46%">disable/enable vtordisp</td>
</tr>
<tr>
<td width="22%">/Zp[n]</td>
<td width="32%">在 n 字节边界上包装结构</td>
<td width="46%">pack structs on n-byte boundary</td>
</tr>
<tr>
<td width="22%">/vm</td>
<td width="32%">指向成员的指针类型</td>
<td width="46%">type of pointers to members</td>
</tr>
<tr>
<td width="22%">/Za</td>
<td width="32%">禁用扩展（暗指 /Op）</td>
<td width="46%">disable extensions (implies /Op)</td>
</tr>
<tr>
<td width="22%">/noBool</td>
<td width="32%">禁用“bool”关键字</td>
<td width="46%">disable “bool” keyword</td>
</tr>
<tr>
<td width="22%">/Ze</td>
<td width="32%">启用扩展（默认）</td>
<td width="46%">enable extensions (default)</td>
</tr>
<tr>
<td colspan="3" align="center" width="100%"><strong>- 杂项 &#8211; </strong></td>
</tr>
<tr>
<td width="22%">/?, /help</td>
<td width="32%">打印此帮助消息</td>
<td width="46%">print this help message</td>
</tr>
<tr>
<td width="22%">/c</td>
<td width="32%">只编译，不链接</td>
<td width="46%">compile only, no link</td>
</tr>
<tr>
<td width="22%">/W</td>
<td width="32%">设置警告等级（默认 n=1）</td>
<td width="46%">set warning level (default n=1)</td>
</tr>
<tr>
<td width="22%">/H</td>
<td width="32%">最大化外部名称长度</td>
<td width="46%">max external name length</td>
</tr>
<tr>
<td width="22%">/J</td>
<td width="32%">默认 char 类型是 unsigned</td>
<td width="46%">default char type is unsigned</td>
</tr>
<tr>
<td width="22%">/nologo</td>
<td width="32%">取消显示版权消息</td>
<td width="46%">suppress copyright message</td>
</tr>
<tr>
<td width="22%">/WX</td>
<td width="32%">将警告视为错误</td>
<td width="46%">treat warnings as errors</td>
</tr>
<tr>
<td width="22%">/Tc<source /></td>
<td width="32%">将文件编译为 .c</td>
<td width="46%">compile file as .c</td>
</tr>
<tr>
<td width="22%">/Yc[file]</td>
<td width="32%">创建 .PCH 文件</td>
<td width="46%">create .PCH file</td>
</tr>
<tr>
<td width="22%">/Tp<source /></td>
<td width="32%">将文件编译为 .cpp</td>
<td width="46%">compile file as .cpp</td>
</tr>
<tr>
<td width="22%">/Yd</td>
<td width="32%">将调试信息放在每个 .OBJ 中</td>
<td width="46%">put debug info in every .OBJ</td>
</tr>
<tr>
<td width="22%">/TC</td>
<td width="32%">将所有文件编译为 .c</td>
<td width="46%">compile all files as .c</td>
</tr>
<tr>
<td width="22%">/TP</td>
<td width="32%">将所有文件编译为 .cpp</td>
<td width="46%">compile all files as .cpp</td>
</tr>
<tr>
<td width="22%">/Yu[file]</td>
<td width="32%">使用 .PCH 文件</td>
<td width="46%">use .PCH file</td>
</tr>
<tr>
<td width="22%">/V</td>
<td width="32%">设置版本字符串</td>
<td width="46%">set version string</td>
</tr>
<tr>
<td width="22%">/YX[file]</td>
<td width="32%">自动的 .PCH 文件</td>
<td width="46%">automatic .PCH</td>
</tr>
<tr>
<td width="22%">/w</td>
<td width="32%">禁用所有警告</td>
<td width="46%">disable all warnings</td>
</tr>
<tr>
<td width="22%">/Zm</td>
<td width="32%">最大内存分配（默认为 %）</td>
<td width="46%">max memory alloc (% of default)</td>
</tr>
<tr>
<td colspan="3" align="center" width="100%"><strong>-链接- </strong></td>
</tr>
<tr>
<td width="22%">/MD</td>
<td width="32%">与 MSVCRT.LIB 链接</td>
<td width="46%">link with MSVCRT.LIB</td>
</tr>
<tr>
<td width="22%">/MDd</td>
<td width="32%">与 MSVCRTD.LIB 调试库链接</td>
<td width="46%">link with MSVCRTD.LIB debug lib</td>
</tr>
<tr>
<td width="22%">/ML</td>
<td width="32%">与 LIBC.LIB 链接</td>
<td width="46%">link with LIBC.LIB</td>
</tr>
<tr>
<td width="22%">/MLd</td>
<td width="32%">与 LIBCD.LIB 调试库链接</td>
<td width="46%">link with LIBCD.LIB debug lib</td>
</tr>
<tr>
<td width="22%">/MT</td>
<td width="32%">与 LIBCMT.LIB 链接</td>
<td width="46%">link with LIBCMT.LIB</td>
</tr>
<tr>
<td width="22%">/MTd</td>
<td width="32%">与 LIBCMTD.LIB 调试库链接</td>
<td width="46%">link with LIBCMTD.LIB debug lib</td>
</tr>
<tr>
<td width="22%">/LD</td>
<td width="32%">创建 .DLL</td>
<td width="46%">Create .DLL</td>
</tr>
<tr>
<td width="22%">/F</td>
<td width="32%">设置堆栈大小</td>
<td width="46%">set stack size</td>
</tr>
<tr>
<td width="22%">/LDd</td>
<td width="32%">创建 .DLL 调试库</td>
<td width="46%">Create .DLL debug libary</td>
</tr>
<tr>
<td width="22%">/link</td>
<td width="32%">[链接器选项和库]</td>
<td width="46%">[linker options and libraries]</td>
</tr>
</tbody>
</table>
<p><a href="http://dl.dbank.com/c0cnp84orz" target="_blank">Click here to download the htmlfile.</a> <img src='http://www.h4ck.org.cn/wp-content/plugins/smilies-themer/Julianus/20x20-look_down.png' alt=':D' class='wp-smiley' /> <br />
<h3>相关文章</h3>
<ul class="related_posts">
<li><a href="http://www.h4ck.org.cn/2010/02/windows-api/" title="新编Windows API参考大全" rel="bookmark inlinks">新编Windows API参考大全</a><span class="count">( 0 )</span></li>
<li><a href="http://www.h4ck.org.cn/2010/03/c-topic/" title="两道C语言题目" rel="bookmark inlinks">两道C语言题目</a><span class="count">( 0 )</span></li>
<li><a href="http://www.h4ck.org.cn/2011/12/moving-to-windows-x64-translate-to-ch/" title="Moving to Windows x64【翻译】" rel="bookmark inlinks">Moving to Windows x64【翻译】</a><span class="count">( 2 )</span></li>
<li><a href="http://www.h4ck.org.cn/2011/03/windows-customized-gina-in-safe-modewindows-xp/" title="Windows Customized Gina In Safe Mode(Windows xp)" rel="bookmark inlinks">Windows Customized Gina In Safe Mode(Windows xp)</a><span class="count">( 3 )</span></li>
<li><a href="http://www.h4ck.org.cn/2010/01/drivers/" title="键盘过滤驱动勘误《寒江独钓》" rel="bookmark inlinks">键盘过滤驱动勘误《寒江独钓》</a><span class="count">( 0 )</span></li>
<li><a href="http://www.h4ck.org.cn/2010/06/ida-sdk-5-5/" title="IDA Sdk 5.5" rel="bookmark inlinks">IDA Sdk 5.5</a><span class="count">( 0 )</span></li>
<li><a href="http://www.h4ck.org.cn/2011/01/windows-customized-gina-source-code/" title="Windows Customized Gina Source Code" rel="bookmark inlinks">Windows Customized Gina Source Code</a><span class="count">( 1 )</span></li>
<li><a href="http://www.h4ck.org.cn/2011/01/easysys-0-3-2-6-for-vs2008wdk7/" title="EasySYS 0.3.2.6 for vs2008/WDK7" rel="bookmark inlinks">EasySYS 0.3.2.6 for vs2008/WDK7</a><span class="count">( 0 )</span></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.h4ck.org.cn/2011/11/vs-compile-options/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hello Apple</title>
		<link>http://www.h4ck.org.cn/2011/05/hello-world-2/</link>
		<comments>http://www.h4ck.org.cn/2011/05/hello-world-2/#comments</comments>
		<pubDate>Wed, 18 May 2011 10:22:43 +0000</pubDate>
		<dc:creator>obaby</dc:creator>
				<category><![CDATA[程序设计『Programing』]]></category>
		<category><![CDATA[C/C++]]></category>
		<category><![CDATA[Crack]]></category>
		<category><![CDATA[驱动开发]]></category>

		<guid isPermaLink="false">http://www.h4ck.org.cn/?p=2824</guid>
		<description><![CDATA[Hello World]]></description>
			<content:encoded><![CDATA[<p><a rel="lightbox" href="http://www.h4ck.org.cn/wp-content/uploads//2011/05/APPLE2.png" title="APPLE2"><img title="APPLE2" src="http://www.h4ck.org.cn/wp-content/uploads//2011/05/APPLE2.png" alt="" width="638" height="430" /></a></p>
<p>Hello world！<br />
<h3>相关文章</h3>
<ul class="related_posts">
<li><a href="http://www.h4ck.org.cn/2010/06/restorator-2009-4-0-build-1807-cracked/" title="Restorator 2009 4.0 build 1807 Cracked" rel="bookmark inlinks">Restorator 2009 4.0 build 1807 Cracked</a><span class="count">( 0 )</span></li>
<li><a href="http://www.h4ck.org.cn/2011/12/hopper-disassembler-v1-6-1-share/" title="Hopper Disassembler v1.6.1 [share]" rel="bookmark inlinks">Hopper Disassembler v1.6.1 [share]</a><span class="count">( 0 )</span></li>
<li><a href="http://www.h4ck.org.cn/2009/08/010-editor-v2-0-cracked/" title="010 Editor V2.0 Cracked " rel="bookmark inlinks">010 Editor V2.0 Cracked </a><span class="count">( 0 )</span></li>
<li><a href="http://www.h4ck.org.cn/2011/06/%e8%bf%85%e9%9b%b77%ef%bc%9a-7-2-0-3076-%e5%8e%bb%e5%b9%bf%e5%91%8a%e8%a1%a5%e4%b8%81/" title="迅雷7： 7.2.0.3076 去广告补丁" rel="bookmark inlinks">迅雷7： 7.2.0.3076 去广告补丁</a><span class="count">( 2 )</span></li>
<li><a href="http://www.h4ck.org.cn/2009/12/dansnow-iibeta1/" title="溯雪IIBeta1--又见溯雪" rel="bookmark inlinks">溯雪IIBeta1&#8211;又见溯雪</a><span class="count">( 0 )</span></li>
<li><a href="http://www.h4ck.org.cn/2011/01/thunder7-1-5-2152-ad-remove/" title="迅雷7.1.5.2152 去广告补丁" rel="bookmark inlinks">迅雷7.1.5.2152 去广告补丁</a><span class="count">( 9 )</span></li>
<li><a href="http://www.h4ck.org.cn/2010/03/perfectdisk-11-pro-keygen/" title="PerfectDisk 11 Pro Keygen" rel="bookmark inlinks">PerfectDisk 11 Pro Keygen</a><span class="count">( 1 )</span></li>
<li><a href="http://www.h4ck.org.cn/2009/09/driverdevelop3-8/" title="驱动开发学习笔记（3-8）–Four-F的驱动开发教程-后备列表" rel="bookmark inlinks">驱动开发学习笔记（3-8）–Four-F的驱动开发教程-后备列表</a><span class="count">( 0 )</span></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.h4ck.org.cn/2011/05/hello-world-2/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>蛋疼的 REG_MULTI_SZ</title>
		<link>http://www.h4ck.org.cn/2011/05/reg_multi_sz/</link>
		<comments>http://www.h4ck.org.cn/2011/05/reg_multi_sz/#comments</comments>
		<pubDate>Thu, 12 May 2011 05:04:13 +0000</pubDate>
		<dc:creator>obaby</dc:creator>
				<category><![CDATA[程序设计『Programing』]]></category>
		<category><![CDATA[C/C++]]></category>
		<category><![CDATA[Delphi]]></category>

		<guid isPermaLink="false">http://www.h4ck.org.cn/?p=2817</guid>
		<description><![CDATA[话说这个东西是够蛋疼的，当时在发《Delphi Read/Write REG_MULTI_SZ》一篇的时候就注意到读到的信息虽然是正确的，但是在写入的时候却发生了错误。如果再读的话那就更不对了。

从网上查了一下那个蛋疼的REG_MULTI_SZ到底是个什么东西，但是大部分人的结论就是这么一句：

REG_MULTI_SZ    一个以空字符结束的字符串数组，被两个null字符结束。]]></description>
			<content:encoded><![CDATA[<p>话说这个东西是够蛋疼的，当时在发《<a href="http://www.h4ck.org.cn/2011/04/delphi-readwrite-reg_multi_sz/" target="_blank">Delphi Read/Write REG_MULTI_SZ</a>》一篇的时候就注意到读到的信息虽然是正确的，但是在写入的时候却发生了错误。如果再读的话那就更不对了。  从网上查了一下那个蛋疼的REG_MULTI_SZ到底是个什么东西，但是大部分人的结论就是这么一句：</p>
<blockquote><p><span style="color: #ff00ff;">REG_MULTI_SZ    一个以空字符结束的字符串数组，被两个null字符结束。</span></p></blockquote>
<p>看了半天也没发现到底信息后面写的是什么东西，看来是我太笨了！ <img src='http://www.h4ck.org.cn/wp-content/plugins/smilies-themer/Julianus/20x20-too_sad.png' alt='=(' class='wp-smiley' />  今天又遇到这个问题索性把注册表中的一个REG_MULTI_SZ   键值倒了出来，原来竟然是这么一串东东：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
</pre></td><td class="code"><pre class="asm" style="font-family:monospace;">Windows Registry Editor Version <span style="color: #0000ff;">5.00</span>
&nbsp;
<span style="color: #009900; font-weight: bold;">&#91;</span>HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System<span style="color: #009900; font-weight: bold;">&#93;</span>
<span style="color: #7f007f;">&quot;Component Information&quot;</span>=hex<span style="color: #339933;">:</span><span style="color: #0000ff;">00</span><span style="color: #339933;">,</span><span style="color: #0000ff;">00</span><span style="color: #339933;">,</span><span style="color: #0000ff;">00</span><span style="color: #339933;">,</span><span style="color: #0000ff;">00</span><span style="color: #339933;">,</span><span style="color: #0000ff;">00</span><span style="color: #339933;">,</span><span style="color: #0000ff;">00</span><span style="color: #339933;">,</span><span style="color: #0000ff;">00</span><span style="color: #339933;">,</span><span style="color: #0000ff;">00</span><span style="color: #339933;">,</span><span style="color: #0000ff;">00</span><span style="color: #339933;">,</span><span style="color: #0000ff;">00</span><span style="color: #339933;">,</span><span style="color: #0000ff;">00</span><span style="color: #339933;">,</span><span style="color: #0000ff;">00</span><span style="color: #339933;">,</span><span style="color: #0000ff;">00</span><span style="color: #339933;">,</span><span style="color: #0000ff;">00</span><span style="color: #339933;">,</span><span style="color: #0000ff;">00</span><span style="color: #339933;">,</span><span style="color: #0000ff;">00</span>
<span style="color: #7f007f;">&quot;Identifier&quot;</span>=<span style="color: #7f007f;">&quot;AT/AT COMPATIBLE&quot;</span>
<span style="color: #7f007f;">&quot;Configuration Data&quot;</span>=hex<span style="color: #009900; font-weight: bold;">&#40;</span><span style="color: #0000ff;">9</span><span style="color: #009900; font-weight: bold;">&#41;</span><span style="color: #339933;">:</span>ff<span style="color: #339933;">,</span>ff<span style="color: #339933;">,</span>ff<span style="color: #339933;">,</span>ff<span style="color: #339933;">,</span>ff<span style="color: #339933;">,</span>ff<span style="color: #339933;">,</span>ff<span style="color: #339933;">,</span>ff<span style="color: #339933;">,</span><span style="color: #0000ff;">00</span><span style="color: #339933;">,</span><span style="color: #0000ff;">00</span><span style="color: #339933;">,</span><span style="color: #0000ff;">00</span><span style="color: #339933;">,</span><span style="color: #0000ff;">00</span><span style="color: #339933;">,</span><span style="color: #0000ff;">02</span><span style="color: #339933;">,</span><span style="color: #0000ff;">00</span><span style="color: #339933;">,</span><span style="color: #0000ff;">00</span><span style="color: #339933;">,</span><span style="color: #0000ff;">00</span><span style="color: #339933;">,</span><span style="color: #0000ff;">05</span><span style="color: #339933;">,</span>\
<span style="color: #0000ff;">00</span><span style="color: #339933;">,</span><span style="color: #0000ff;">00</span><span style="color: #339933;">,</span><span style="color: #0000ff;">00</span><span style="color: #339933;">,</span>0c<span style="color: #339933;">,</span><span style="color: #0000ff;">00</span><span style="color: #339933;">,</span><span style="color: #0000ff;">00</span><span style="color: #339933;">,</span><span style="color: #0000ff;">00</span><span style="color: #339933;">,</span><span style="color: #0000ff;">00</span><span style="color: #339933;">,</span><span style="color: #0000ff;">00</span><span style="color: #339933;">,</span><span style="color: #0000ff;">00</span><span style="color: #339933;">,</span><span style="color: #0000ff;">00</span><span style="color: #339933;">,</span><span style="color: #0000ff;">00</span><span style="color: #339933;">,</span><span style="color: #0000ff;">00</span><span style="color: #339933;">,</span><span style="color: #0000ff;">00</span><span style="color: #339933;">,</span><span style="color: #0000ff;">00</span><span style="color: #339933;">,</span><span style="color: #0000ff;">80</span><span style="color: #339933;">,</span><span style="color: #0000ff;">00</span><span style="color: #339933;">,</span>ff<span style="color: #339933;">,</span><span style="color: #0000ff;">03</span><span style="color: #339933;">,</span><span style="color: #0000ff;">00</span><span style="color: #339933;">,</span><span style="color: #0000ff;">00</span><span style="color: #339933;">,</span><span style="color: #0000ff;">3f</span><span style="color: #339933;">,</span><span style="color: #0000ff;">00</span><span style="color: #339933;">,</span>fe<span style="color: #339933;">,</span><span style="color: #0000ff;">00</span><span style="color: #339933;">,</span>\
<span style="color: #0000ff;">01</span><span style="color: #339933;">,</span><span style="color: #0000ff;">00</span><span style="color: #339933;">,</span><span style="color: #0000ff;">05</span><span style="color: #339933;">,</span><span style="color: #0000ff;">00</span><span style="color: #339933;">,</span><span style="color: #0000ff;">00</span><span style="color: #339933;">,</span><span style="color: #0000ff;">00</span><span style="color: #339933;">,</span><span style="color: #0000ff;">18</span><span style="color: #339933;">,</span><span style="color: #0000ff;">00</span><span style="color: #339933;">,</span><span style="color: #0000ff;">00</span><span style="color: #339933;">,</span><span style="color: #0000ff;">00</span><span style="color: #339933;">,</span><span style="color: #0000ff;">00</span><span style="color: #339933;">,</span><span style="color: #0000ff;">00</span><span style="color: #339933;">,</span><span style="color: #0000ff;">00</span><span style="color: #339933;">,</span><span style="color: #0000ff;">00</span><span style="color: #339933;">,</span><span style="color: #0000ff;">00</span><span style="color: #339933;">,</span><span style="color: #0000ff;">00</span><span style="color: #339933;">,</span><span style="color: #0000ff;">00</span><span style="color: #339933;">,</span><span style="color: #0000ff;">00</span><span style="color: #339933;">,</span><span style="color: #0000ff;">00</span><span style="color: #339933;">,</span><span style="color: #0000ff;">00</span><span style="color: #339933;">,</span>0c<span style="color: #339933;">,</span><span style="color: #0000ff;">00</span><span style="color: #339933;">,</span><span style="color: #0000ff;">00</span><span style="color: #339933;">,</span>de<span style="color: #339933;">,</span><span style="color: #0000ff;">00</span><span style="color: #339933;">,</span>\
<span style="color: #0000ff;">00</span><span style="color: #339933;">,</span><span style="color: #0000ff;">00</span><span style="color: #339933;">,</span><span style="color: #0000ff;">00</span><span style="color: #339933;">,</span>0e<span style="color: #339933;">,</span><span style="color: #0000ff;">00</span><span style="color: #339933;">,</span><span style="color: #0000ff;">00</span><span style="color: #339933;">,</span><span style="color: #0000ff;">00</span><span style="color: #339933;">,</span><span style="color: #0000ff;">01</span><span style="color: #339933;">,</span><span style="color: #0000ff;">00</span><span style="color: #339933;">,</span><span style="color: #0000ff;">00</span><span style="color: #339933;">,</span><span style="color: #0000ff;">00</span><span style="color: #339933;">,</span><span style="color: #0000ff;">0f</span><span style="color: #339933;">,</span><span style="color: #0000ff;">00</span><span style="color: #339933;">,</span><span style="color: #0000ff;">00</span><span style="color: #339933;">,</span><span style="color: #0000ff;">00</span><span style="color: #339933;">,</span><span style="color: #0000ff;">01</span><span style="color: #339933;">,</span><span style="color: #0000ff;">00</span>
<span style="color: #7f007f;">&quot;SystemBiosDate&quot;</span>=<span style="color: #7f007f;">&quot;12/17/10&quot;</span>
<span style="color: #7f007f;">&quot;SystemBiosVersion&quot;</span>=hex<span style="color: #009900; font-weight: bold;">&#40;</span><span style="color: #0000ff;">7</span><span style="color: #009900; font-weight: bold;">&#41;</span><span style="color: #339933;">:</span><span style="color: #0000ff;">31</span><span style="color: #339933;">,</span><span style="color: #0000ff;">00</span><span style="color: #339933;">,</span><span style="color: #0000ff;">32</span><span style="color: #339933;">,</span><span style="color: #0000ff;">00</span><span style="color: #339933;">,</span><span style="color: #0000ff;">31</span><span style="color: #339933;">,</span><span style="color: #0000ff;">00</span><span style="color: #339933;">,</span><span style="color: #0000ff;">37</span><span style="color: #339933;">,</span><span style="color: #0000ff;">00</span><span style="color: #339933;">,</span><span style="color: #0000ff;">31</span><span style="color: #339933;">,</span><span style="color: #0000ff;">00</span><span style="color: #339933;">,</span><span style="color: #0000ff;">30</span><span style="color: #339933;">,</span><span style="color: #0000ff;">00</span><span style="color: #339933;">,</span><span style="color: #0000ff;">20</span><span style="color: #339933;">,</span><span style="color: #0000ff;">00</span><span style="color: #339933;">,</span>2d<span style="color: #339933;">,</span><span style="color: #0000ff;">00</span><span style="color: #339933;">,</span><span style="color: #0000ff;">20</span><span style="color: #339933;">,</span>\
<span style="color: #0000ff;">00</span><span style="color: #339933;">,</span><span style="color: #0000ff;">32</span><span style="color: #339933;">,</span><span style="color: #0000ff;">00</span><span style="color: #339933;">,</span><span style="color: #0000ff;">30</span><span style="color: #339933;">,</span><span style="color: #0000ff;">00</span><span style="color: #339933;">,</span><span style="color: #0000ff;">31</span><span style="color: #339933;">,</span><span style="color: #0000ff;">00</span><span style="color: #339933;">,</span><span style="color: #0000ff;">30</span><span style="color: #339933;">,</span><span style="color: #0000ff;">00</span><span style="color: #339933;">,</span><span style="color: #0000ff;">31</span><span style="color: #339933;">,</span><span style="color: #0000ff;">00</span><span style="color: #339933;">,</span><span style="color: #0000ff;">32</span><span style="color: #339933;">,</span><span style="color: #0000ff;">00</span><span style="color: #339933;">,</span><span style="color: #0000ff;">31</span><span style="color: #339933;">,</span><span style="color: #0000ff;">00</span><span style="color: #339933;">,</span><span style="color: #0000ff;">37</span><span style="color: #339933;">,</span><span style="color: #0000ff;">00</span><span style="color: #339933;">,</span><span style="color: #0000ff;">00</span><span style="color: #339933;">,</span><span style="color: #0000ff;">00</span><span style="color: #339933;">,</span><span style="color: #0000ff;">00</span><span style="color: #339933;">,</span><span style="color: #0000ff;">00</span></pre></td></tr></table></div>

<p>结束的地方是00,00,00,00,00～ <img src='http://www.h4ck.org.cn/wp-content/plugins/smilies-themer/Julianus/20x20-look_down.png' alt=':D' class='wp-smiley' /> ，知道了是怎么结束的也就知道该怎么写回去了。擦，太蛋疼了～<br />
<h3>相关文章</h3>
<ul class="related_posts">
<li><a href="http://www.h4ck.org.cn/2010/04/get-device-type/" title="获取指定类型的设备，符号链接" rel="bookmark inlinks">获取指定类型的设备，符号链接</a><span class="count">( 0 )</span></li>
<li><a href="http://www.h4ck.org.cn/2011/04/delphi-readwrite-reg_multi_sz/" title="Delphi Read/Write REG_MULTI_SZ" rel="bookmark inlinks">Delphi Read/Write REG_MULTI_SZ</a><span class="count">( 0 )</span></li>
<li><a href="http://www.h4ck.org.cn/2009/11/delphi-time-delay/" title="Delphi中实现程序的延时的方法" rel="bookmark inlinks">Delphi中实现程序的延时的方法</a><span class="count">( 0 )</span></li>
<li><a href="http://www.h4ck.org.cn/2011/11/od-unicode-string-format-convert-v0-1/" title="OD Unicode String Format Convert v0.1" rel="bookmark inlinks">OD Unicode String Format Convert v0.1</a><span class="count">( 0 )</span></li>
<li><a href="http://www.h4ck.org.cn/2009/11/unicode-base64/" title="字符转转换（汉字 Unicode Base64加密解密）" rel="bookmark inlinks">字符转转换（汉字 Unicode Base64加密解密）</a><span class="count">( 0 )</span></li>
<li><a href="http://www.h4ck.org.cn/2010/03/ip/" title="IP归属地查询器" rel="bookmark inlinks">IP归属地查询器</a><span class="count">( 0 )</span></li>
<li><a href="http://www.h4ck.org.cn/2011/11/let-them-drag-and-drop-files-on-your-program/" title="Let them drag and drop files on your program" rel="bookmark inlinks">Let them drag and drop files on your program</a><span class="count">( 0 )</span></li>
<li><a href="http://www.h4ck.org.cn/2009/08/sourcecode-counter/" title="智能源码统计伴侣 V3.7" rel="bookmark inlinks">智能源码统计伴侣 V3.7</a><span class="count">( 1 )</span></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.h4ck.org.cn/2011/05/reg_multi_sz/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Reflector 1.0.2011.0408</title>
		<link>http://www.h4ck.org.cn/2011/04/reflector-1-0-2011-0408/</link>
		<comments>http://www.h4ck.org.cn/2011/04/reflector-1-0-2011-0408/#comments</comments>
		<pubDate>Fri, 29 Apr 2011 09:39:30 +0000</pubDate>
		<dc:creator>obaby</dc:creator>
				<category><![CDATA[破解/汇编『Crack/Asm』]]></category>
		<category><![CDATA[程序设计『Programing』]]></category>
		<category><![CDATA[C/C++]]></category>
		<category><![CDATA[Crack]]></category>
		<category><![CDATA[PETools]]></category>

		<guid isPermaLink="false">http://www.h4ck.org.cn/?p=2754</guid>
		<description><![CDATA[Reflector 1.0.2011.0408]]></description>
			<content:encoded><![CDATA[<p><a rel="lightbox" href="http://www.h4ck.org.cn/wp-content/uploads//2011/04/net.png" title="net"><img title="net" src="http://www.h4ck.org.cn/wp-content/uploads//2011/04/net.png" alt="" width="690" height="486" /></a></p>
<blockquote><p>修改：<br />
1，移除所有授权相关代码和资源<br />
2，移除所有报告错误相关代码和资源<br />
3，移除ReflectorInstaller相关代码和资源，大小由4.3M（混淆压缩）变成2.8M（未混淆压缩）<br />
4，增加代码着色，原来只有黑色和深绿色，看起来要命。类名红色，方法名绿色，类字段浅黄色，参数浅绿色，本地变量黑色（若不喜欢自己修改代码）</p></blockquote>
<p><a href="http://dl.dbank.com/c0fwwszild" target="_blank">猛击此处下载二进制程序</a>，<a href="http://dl.dbank.com/c032iipst3" target="_blank">猛击此处下载源代码！ </a></p>
<p>原文链接：http://www.cnblogs.com/nnhy/archive/2011/04/14/2016021.html<br />
<h3>相关文章</h3>
<ul class="related_posts">
<li><a href="http://www.h4ck.org.cn/2011/03/my-first-book-crack/" title="《破解—不破不逆》" rel="bookmark inlinks">《破解—不破不逆》</a><span class="count">( 6 )</span></li>
<li><a href="http://www.h4ck.org.cn/2011/11/vs-compile-options/" title="微软C-C++ 编译器选项" rel="bookmark inlinks">微软C-C++ 编译器选项</a><span class="count">( 0 )</span></li>
<li><a href="http://www.h4ck.org.cn/2010/12/thunder-7-1-4-2112-ad-killer/" title="迅雷7 （7.1.4.2112）去广告补丁" rel="bookmark inlinks">迅雷7 （7.1.4.2112）去广告补丁</a><span class="count">( 1 )</span></li>
<li><a href="http://www.h4ck.org.cn/2011/04/happy-birthday-to-myself/" title="Happy Birthday To Myself!" rel="bookmark inlinks">Happy Birthday To Myself!</a><span class="count">( 2 )</span></li>
<li><a href="http://www.h4ck.org.cn/2010/07/xxq/" title="我有小小强 破解版" rel="bookmark inlinks">我有小小强 破解版</a><span class="count">( 0 )</span></li>
<li><a href="http://www.h4ck.org.cn/2010/01/dailypim-4-1-cracked-by-obaby/" title="DailyPIM 4.1 Cracked by Obaby [修改为Loader模式，功能无缺失]" rel="bookmark inlinks">DailyPIM 4.1 Cracked by Obaby [修改为Loader模式，功能无缺失]</a><span class="count">( 3 )</span></li>
<li><a href="http://www.h4ck.org.cn/2009/08/winrar-crack/" title="爆破Winrar" rel="bookmark inlinks">爆破Winrar</a><span class="count">( 0 )</span></li>
<li><a href="http://www.h4ck.org.cn/2010/08/youyi-proxy/" title="优易代理 1.6 破解版" rel="bookmark inlinks">优易代理 1.6 破解版</a><span class="count">( 0 )</span></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.h4ck.org.cn/2011/04/reflector-1-0-2011-0408/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>dejavu-fonts-ttf-2.33</title>
		<link>http://www.h4ck.org.cn/2011/04/dejavu-fonts-ttf-2-33/</link>
		<comments>http://www.h4ck.org.cn/2011/04/dejavu-fonts-ttf-2-33/#comments</comments>
		<pubDate>Fri, 29 Apr 2011 05:18:31 +0000</pubDate>
		<dc:creator>obaby</dc:creator>
				<category><![CDATA[程序设计『Programing』]]></category>
		<category><![CDATA[C/C++]]></category>
		<category><![CDATA[Delphi]]></category>
		<category><![CDATA[系统美化]]></category>

		<guid isPermaLink="false">http://www.h4ck.org.cn/?p=2749</guid>
		<description><![CDATA[dejavu-fonts-ttf-2.33]]></description>
			<content:encoded><![CDATA[<p>分享一套等宽字体，挺好看的。<a href="http://dl.dbank.com/c0dic7a5gp" target="_blank">猛击此处下载字体！</a>下图是在vs 2008中的效果：</p>
<p><a rel="lightbox" href="http://www.h4ck.org.cn/wp-content/uploads//2011/04/fonts.png" title="fonts"><img title="fonts" src="http://www.h4ck.org.cn/wp-content/uploads//2011/04/fonts.png" alt="" width="664" height="417" /></a><br />
<span id="more-2749"></span><br />
下图是在Delphi 2010中的效果，使用的是里面的另外一套字体，由于Delphi本身的问题，在设置字体的时候有的是无法显示的：</p>
<p><a rel="lightbox" href="http://www.h4ck.org.cn/wp-content/uploads//2011/04/delphi.png" title="delphi"><img title="delphi" src="http://www.h4ck.org.cn/wp-content/uploads//2011/04/delphi.png" alt="" width="672" height="389" /></a></p>
<p>同样IDA和Delphi一样也是有的字体在设置界面是不出现的，但是显示效果还是不错的，下图是在IDA 5.5中的效果，嘎嘎：</p>
<p><a rel="lightbox" href="http://www.h4ck.org.cn/wp-content/uploads//2011/04/ida.png" title="ida"><img title="ida" src="http://www.h4ck.org.cn/wp-content/uploads//2011/04/ida.png" alt="" width="638" height="339" /></a></p>
<p>以前记得有篇文章叫做什么程序员专用十大字体的什么东东，不过里面的东西都忘了，也不记得介绍的是什么字体了。<br />
<h3>相关文章</h3>
<ul class="related_posts">
<li><a href="http://www.h4ck.org.cn/2009/12/bbs-time-add/" title="火星黑客研究院-论坛挂机工具" rel="bookmark inlinks">火星黑客研究院-论坛挂机工具</a><span class="count">( 0 )</span></li>
<li><a href="http://www.h4ck.org.cn/2011/09/embarcadero-delphi-xe2-rtm-v16-0-4256-43595-lite-v5-0/" title="Embarcadero.Delphi.XE2.RTM.v16.0.4256.43595.Lite.v5.0" rel="bookmark inlinks">Embarcadero.Delphi.XE2.RTM.v16.0.4256.43595.Lite.v5.0</a><span class="count">( 0 )</span></li>
<li><a href="http://www.h4ck.org.cn/2009/11/ftp-my-ip/" title="FTP my IP" rel="bookmark inlinks">FTP my IP</a><span class="count">( 0 )</span></li>
<li><a href="http://www.h4ck.org.cn/2011/04/ultramon-3-x-sn/" title="UltraMon 3.x序列号" rel="bookmark inlinks">UltraMon 3.x序列号</a><span class="count">( 0 )</span></li>
<li><a href="http://www.h4ck.org.cn/2010/01/drivers/" title="键盘过滤驱动勘误《寒江独钓》" rel="bookmark inlinks">键盘过滤驱动勘误《寒江独钓》</a><span class="count">( 0 )</span></li>
<li><a href="http://www.h4ck.org.cn/2009/09/delphi-2010-product-film/" title="Delphi 2010產品技術發表會投影片和範例檔!" rel="bookmark inlinks">Delphi 2010產品技術發表會投影片和範例檔!</a><span class="count">( 0 )</span></li>
<li><a href="http://www.h4ck.org.cn/2010/03/delphi-2010-rtm-cracked/" title="Delphi.2010.RTM. Cracked" rel="bookmark inlinks">Delphi.2010.RTM. Cracked</a><span class="count">( 0 )</span></li>
<li><a href="http://www.h4ck.org.cn/2011/04/delphi-readwrite-reg_multi_sz/" title="Delphi Read/Write REG_MULTI_SZ" rel="bookmark inlinks">Delphi Read/Write REG_MULTI_SZ</a><span class="count">( 0 )</span></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.h4ck.org.cn/2011/04/dejavu-fonts-ttf-2-33/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Windows Customized Gina In Safe Mode(Windows xp)</title>
		<link>http://www.h4ck.org.cn/2011/03/windows-customized-gina-in-safe-modewindows-xp/</link>
		<comments>http://www.h4ck.org.cn/2011/03/windows-customized-gina-in-safe-modewindows-xp/#comments</comments>
		<pubDate>Thu, 10 Mar 2011 02:10:08 +0000</pubDate>
		<dc:creator>obaby</dc:creator>
				<category><![CDATA[操作系统『Operating System』]]></category>
		<category><![CDATA[程序设计『Programing』]]></category>
		<category><![CDATA[C/C++]]></category>

		<guid isPermaLink="false">http://h4ck.ws/?p=2376</guid>
		<description><![CDATA[This question has been here for so a long time.till yesterday i suddenly got an idea to solve this problem.So i tested it today ,and it works well. However it only works on windows xp,in windows vista and  windows 7 there is no gina dlls.

Gladly it works.Click here to download the gina dll source code (only with this dll ,it will not works in safe mode).Also there are many other ways to let the dll works in safe mode . I know one,meybe not the best but the work one.lol]]></description>
			<content:encoded><![CDATA[<div>
<p><a rel="lightbox" href="http://h4ck.ws/wp-content/uploads//2011/01/Gina.png" title="Gina"><img title="Gina" src="http://h4ck.ws/wp-content/uploads//2011/01/Gina.png" alt="" width="573" height="463" /></a></p>
</div>
<p><a href="http://dl.dbank.com/c0lqp9y8d8" target="_blank">Click here to download the gina dll source code</a> <span style="color: #ff0000;">(only with this dll ,it will not works in safe mode)</span>.<span style="color: #00ff00;">Also there are many other ways to let the dll works in safe mode . I know one,meybe not the best but the work one.lol</span><a href="http://dl.dbank.com/c00xlxmnae" target="_blank"> If u don&#8217;t believe it .click here to download the test video.</a><br />
<span id="more-2376"></span><br />
Online Video here:</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="600" height="500" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="src" value="http://player.youku.com/player.php/sid/XMjM1OTUxMDk2/v.swf" /><embed type="application/x-shockwave-flash" width="600" height="500" src="http://player.youku.com/player.php/sid/XMjM1OTUxMDk2/v.swf"></embed></object></p>
<p>lol,Beautiful isn&#8217;t it?</p>
<h2><strong><span style="color: #ff0000;">If u wanner to know how i made this,I can tell u , if u would like to pay 40,000 RMB.lol【This is not a joke!】(如果你想知道怎么做到的，并且愿意花费40,000RMB的话我就告诉你，哈哈【这不是玩笑!】)</span></strong></h2>
<h3>相关文章</h3>
<ul class="related_posts">
<li><a href="http://www.h4ck.org.cn/2011/01/get-windows-7-hotfix-infos-from-registry/" title="Get Windows 7 Hotfix Infos From Registry" rel="bookmark inlinks">Get Windows 7 Hotfix Infos From Registry</a><span class="count">( 0 )</span></li>
<li><a href="http://www.h4ck.org.cn/2011/11/vs-compile-options/" title="微软C-C++ 编译器选项" rel="bookmark inlinks">微软C-C++ 编译器选项</a><span class="count">( 0 )</span></li>
<li><a href="http://www.h4ck.org.cn/2010/02/windows-api/" title="新编Windows API参考大全" rel="bookmark inlinks">新编Windows API参考大全</a><span class="count">( 0 )</span></li>
<li><a href="http://www.h4ck.org.cn/2011/04/reflector-1-0-2011-0408/" title="Reflector 1.0.2011.0408" rel="bookmark inlinks">Reflector 1.0.2011.0408</a><span class="count">( 3 )</span></li>
<li><a href="http://www.h4ck.org.cn/2010/01/drivers/" title="键盘过滤驱动勘误《寒江独钓》" rel="bookmark inlinks">键盘过滤驱动勘误《寒江独钓》</a><span class="count">( 0 )</span></li>
<li><a href="http://www.h4ck.org.cn/2010/03/vs2008-wdk-ddkwizard-win-7/" title="VS2008 、WDK 和DDKWizard搭建Win 7驱动开发环境" rel="bookmark inlinks">VS2008 、WDK 和DDKWizard搭建Win 7驱动开发环境</a><span class="count">( 5 )</span></li>
<li><a href="http://www.h4ck.org.cn/2009/10/cstringedit/" title="一道C++题｛字符串处理｝" rel="bookmark inlinks">一道C++题｛字符串处理｝</a><span class="count">( 0 )</span></li>
<li><a href="http://www.h4ck.org.cn/2010/07/wmi-based-system-share-detect-via-cc/" title="WMI Based System Share Detect Via C/C++" rel="bookmark inlinks">WMI Based System Share Detect Via C/C++</a><span class="count">( 0 )</span></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.h4ck.org.cn/2011/03/windows-customized-gina-in-safe-modewindows-xp/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>VS2008安装Detours库 【Windows 7 64bit】</title>
		<link>http://www.h4ck.org.cn/2011/01/detours-install/</link>
		<comments>http://www.h4ck.org.cn/2011/01/detours-install/#comments</comments>
		<pubDate>Tue, 25 Jan 2011 13:47:30 +0000</pubDate>
		<dc:creator>obaby</dc:creator>
				<category><![CDATA[程序设计『Programing』]]></category>
		<category><![CDATA[C/C++]]></category>

		<guid isPermaLink="false">http://www.h4ck.org.cn/?p=2431</guid>
		<description><![CDATA[原始的安装库可以从这里下载：http://research.microsoft.com/sn/detours（下载后是个msi的安装包，完全傻瓜式的安装），在公司使用的win7 32bit系统上安装编译很正常，但是在家里的64位系统上安装编译却出现了不少问题。]]></description>
			<content:encoded><![CDATA[<p>原始的安装库可以从这里下载：<a href="http://research.microsoft.com/sn/detours" target="_blank">http://research.microsoft.com/sn/detours</a>（下载后是个msi的安装包，完全傻瓜式的安装），在公司使用的win7 32bit系统上安装编译很正常，但是在家里的64位系统上安装编译却出现了不少问题。今天晚上重新看了一下发现默认的那个vs命令行工具貌似是64位的，用兼容性的命令行工具就可以编译了，效果如下图所示：</p>
<p><a rel="lightbox" href="http://www.h4ck.org.cn/wp-content/uploads//2011/01/detours.png" title="detours"><img title="detours" src="http://www.h4ck.org.cn/wp-content/uploads//2011/01/detours.png" alt="" width="675" height="436" /></a><br />
<span id="more-2431"></span><br />
编译完成之后会生成两个lib文件和一个Dll文件，这些都是运行Detours程序所必需的。上面的只是一些64为环境下的安装需要注意的问题，最后记录一下通用的安装方法吧：</p>
<p>1.当然是下载了，下载链接上面也说过了：<a href="http://research.microsoft.com/sn/detours" target="_blank">http://research.microsoft.com/sn/detours</a> ，下载后是一个msi的安装包，直接安装即可，安装之后没有任何的提示信息。但是可以从下面的路径找到安装后的源代码和文件：C:\Program Files (x86)\Microsoft Research\Detours Express 2.1（如果是32位系统将会是C:\Program Files \Microsoft Research\Detours Express 2.1），对应目录下的三个子目录以及文件功能如下：</p>
<p>samples：程序实例代码，包含了各种函数API的使用实例；</p>
<p>src：detours的接口文件以及头文件；</p>
<p>Detours.chm：帮助文件，包含函数的参数以及使用方法说明等。</p>
<p>2.建议将上面提到的src目录拷贝到vs安装目录下的vc文件夹下（如果是vc6则拷贝到vc98目录下），如果是vs2008则拷贝到vs的默认安装路径C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC即可（64位系统，其他系统请自行调整目录）。并且将src改名为detours以便区分代码用途。</p>
<p>3.运行vs2008 的命令提示行工具，切换到detours目录下，然后执行nmake命令将会自动编译并声称可执行文件、库文件和符号文件（如果是64位系统在命令提示行下无法通过编译则使用本文开始提到的“兼容工具命令提示”即可。）。如果没有错误的话编译完成之后将会生成如下的文件：</p>
<p>在vc的lib目录下生成detoured.lib，detours.lib和detoured.exp</p>
<p>在vc的bin目录下生成detoured.dll和detoured.pdb</p>
<p>将detours.h自动复制到vc下的include文件夹下。</p>
<p>因而在实际使用的过程中只需要将detourd.dll文件复制到system32目录下，并且在程序代码中包含头文件和相关的lib文件即可。</p>
<p>这也是为什么要将detours的src目录拷贝到vc目录下的原因，这样在实际使用的过程中将会减少很多不必要的步骤。</p>
<p>相关的实例可以参考CodeProject的相关工程，代码还是比较完善的，涵盖了较多的函数使用方法：<a href="http://www.codeproject.com/KB/DLL/funapihook.aspx" target="_blank">http://www.codeproject.com/KB/DLL/funapihook.aspx </a></p>
<p>最后还是贴一段Wsock Hook的代码，比上面一片文章的代码则又简单了不少（这段代码来自于上面的实例中，版权归原作者所有）：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
</pre></td><td class="code"><pre class="c" style="font-family:monospace;"><span style="color: #339933;">#undef UNICODE</span>
<span style="color: #339933;">#include &lt;cstdio&gt;</span>
<span style="color: #339933;">#include &lt;winsock2 .h&gt;</span>
<span style="color: #339933;">#include &lt;ws2tcpip .h&gt;</span>
<span style="color: #339933;">#include &lt;windows .h&gt;</span>
<span style="color: #339933;">#include &lt;detours .h&gt; //*IMPORTANT: Look at path if compiler error</span>
&nbsp;
&nbsp;
<span style="color: #339933;">#pragma comment(lib, &quot;detoured.lib&quot;)</span>
<span style="color: #339933;">#pragma comment(lib, &quot;detours.lib&quot;)</span>
<span style="color: #339933;">#pragma comment(lib, &quot;Ws2_32.lib&quot;)</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//Prototypes</span>
<span style="color: #993333;">int</span> <span style="color: #009900;">&#40;</span>WINAPI <span style="color: #339933;">*</span>pSend<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span>SOCKET s<span style="color: #339933;">,</span> <span style="color: #993333;">const</span> <span style="color: #993333;">char</span><span style="color: #339933;">*</span> buf<span style="color: #339933;">,</span> <span style="color: #993333;">int</span> len<span style="color: #339933;">,</span> <span style="color: #993333;">int</span> flags<span style="color: #009900;">&#41;</span> <span style="color: #339933;">=</span> send<span style="color: #339933;">;</span>
<span style="color: #993333;">int</span> WINAPI MySend<span style="color: #009900;">&#40;</span>SOCKET s<span style="color: #339933;">,</span> <span style="color: #993333;">const</span> <span style="color: #993333;">char</span><span style="color: #339933;">*</span> buf<span style="color: #339933;">,</span> <span style="color: #993333;">int</span> len<span style="color: #339933;">,</span> <span style="color: #993333;">int</span> flags<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #993333;">int</span> <span style="color: #009900;">&#40;</span>WINAPI <span style="color: #339933;">*</span>pRecv<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span>SOCKET s<span style="color: #339933;">,</span> <span style="color: #993333;">char</span><span style="color: #339933;">*</span> buf<span style="color: #339933;">,</span> <span style="color: #993333;">int</span> len<span style="color: #339933;">,</span> <span style="color: #993333;">int</span> flags<span style="color: #009900;">&#41;</span> <span style="color: #339933;">=</span> recv<span style="color: #339933;">;</span>
<span style="color: #993333;">int</span> WINAPI MyRecv<span style="color: #009900;">&#40;</span>SOCKET s<span style="color: #339933;">,</span> <span style="color: #993333;">char</span><span style="color: #339933;">*</span> buf<span style="color: #339933;">,</span> <span style="color: #993333;">int</span> len<span style="color: #339933;">,</span> <span style="color: #993333;">int</span> flags<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//Log files</span>
FILE<span style="color: #339933;">*</span> pSendLogFile<span style="color: #339933;">;</span>
FILE<span style="color: #339933;">*</span> pRecvLogFile<span style="color: #339933;">;</span>
&nbsp;
INT APIENTRY DllMain<span style="color: #009900;">&#40;</span>HMODULE hDLL<span style="color: #339933;">,</span> DWORD Reason<span style="color: #339933;">,</span> LPVOID Reserved<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #b1b100;">switch</span><span style="color: #009900;">&#40;</span>Reason<span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
	<span style="color: #b1b100;">case</span> DLL_PROCESS_ATTACH<span style="color: #339933;">:</span>	<span style="color: #666666; font-style: italic;">//Do standard detouring</span>
		DisableThreadLibraryCalls<span style="color: #009900;">&#40;</span>hDLL<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		DetourTransactionBegin<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		DetourUpdateThread<span style="color: #009900;">&#40;</span>GetCurrentThread<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		DetourAttach<span style="color: #009900;">&#40;</span><span style="color: #339933;">&amp;</span><span style="color: #009900;">&#40;</span>PVOID<span style="color: #339933;">&amp;</span><span style="color: #009900;">&#41;</span>pSend<span style="color: #339933;">,</span> MySend<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span>DetourTransactionCommit<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> NO_ERROR<span style="color: #009900;">&#41;</span>
			OutputDebugString<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;send() detoured successfully&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		DetourTransactionBegin<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		DetourUpdateThread<span style="color: #009900;">&#40;</span>GetCurrentThread<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		DetourAttach<span style="color: #009900;">&#40;</span><span style="color: #339933;">&amp;</span><span style="color: #009900;">&#40;</span>PVOID<span style="color: #339933;">&amp;</span><span style="color: #009900;">&#41;</span>pRecv<span style="color: #339933;">,</span> MyRecv<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span>DetourTransactionCommit<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> NO_ERROR<span style="color: #009900;">&#41;</span>
			OutputDebugString<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;recv() detoured successfully&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000000; font-weight: bold;">break</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">case</span> DLL_PROCESS_DETACH<span style="color: #339933;">:</span>
		DetourTransactionBegin<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>	<span style="color: #666666; font-style: italic;">//Detach</span>
        DetourUpdateThread<span style="color: #009900;">&#40;</span>GetCurrentThread<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		DetourDetach<span style="color: #009900;">&#40;</span><span style="color: #339933;">&amp;</span><span style="color: #009900;">&#40;</span>PVOID<span style="color: #339933;">&amp;</span><span style="color: #009900;">&#41;</span>pSend<span style="color: #339933;">,</span> MySend<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		DetourTransactionCommit<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		DetourTransactionBegin<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        DetourUpdateThread<span style="color: #009900;">&#40;</span>GetCurrentThread<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		DetourDetach<span style="color: #009900;">&#40;</span><span style="color: #339933;">&amp;</span><span style="color: #009900;">&#40;</span>PVOID<span style="color: #339933;">&amp;</span><span style="color: #009900;">&#41;</span>pRecv<span style="color: #339933;">,</span> MyRecv<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		DetourTransactionCommit<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000000; font-weight: bold;">break</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">case</span> DLL_THREAD_ATTACH<span style="color: #339933;">:</span>
	<span style="color: #b1b100;">case</span> DLL_THREAD_DETACH<span style="color: #339933;">:</span>
		<span style="color: #000000; font-weight: bold;">break</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
	<span style="color: #b1b100;">return</span> TRUE<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//Open file, write contents, close it</span>
<span style="color: #993333;">int</span> WINAPI MySend<span style="color: #009900;">&#40;</span>SOCKET s<span style="color: #339933;">,</span> <span style="color: #993333;">const</span> <span style="color: #993333;">char</span><span style="color: #339933;">*</span> buf<span style="color: #339933;">,</span> <span style="color: #993333;">int</span> len<span style="color: #339933;">,</span> <span style="color: #993333;">int</span> flags<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	fopen_s<span style="color: #009900;">&#40;</span><span style="color: #339933;">&amp;</span>pSendLogFile<span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;C:<span style="color: #000099; font-weight: bold;">\\</span>SendLog.txt&quot;</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;a+&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	fprintf<span style="color: #009900;">&#40;</span>pSendLogFile<span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;%s<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">,</span> buf<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	fclose<span style="color: #009900;">&#40;</span>pSendLogFile<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">return</span> pSend<span style="color: #009900;">&#40;</span>s<span style="color: #339933;">,</span> buf<span style="color: #339933;">,</span> len<span style="color: #339933;">,</span> flags<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #993333;">int</span> WINAPI MyRecv<span style="color: #009900;">&#40;</span>SOCKET s<span style="color: #339933;">,</span> <span style="color: #993333;">char</span><span style="color: #339933;">*</span> buf<span style="color: #339933;">,</span> <span style="color: #993333;">int</span> len<span style="color: #339933;">,</span> <span style="color: #993333;">int</span> flags<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	fopen_s<span style="color: #009900;">&#40;</span><span style="color: #339933;">&amp;</span>pRecvLogFile<span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;C:<span style="color: #000099; font-weight: bold;">\\</span>RecvLog.txt&quot;</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;a+&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	fprintf<span style="color: #009900;">&#40;</span>pRecvLogFile<span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;%s<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">,</span> buf<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	fclose<span style="color: #009900;">&#40;</span>pRecvLogFile<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">return</span> pRecv<span style="color: #009900;">&#40;</span>s<span style="color: #339933;">,</span> buf<span style="color: #339933;">,</span> len<span style="color: #339933;">,</span> flags<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #339933;">&lt;/</span>detours<span style="color: #339933;">&gt;&lt;/</span>windows<span style="color: #339933;">&gt;&lt;/</span>ws2tcpip<span style="color: #339933;">&gt;&lt;/</span>winsock2<span style="color: #339933;">&gt;&lt;/</span>cstdio<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<h3>相关文章</h3>
<ul class="related_posts">
<li><a href="http://www.h4ck.org.cn/2010/03/c-topic/" title="两道C语言题目" rel="bookmark inlinks">两道C语言题目</a><span class="count">( 0 )</span></li>
<li><a href="http://www.h4ck.org.cn/2011/01/get-windows-7-hotfix-infos-from-registry/" title="Get Windows 7 Hotfix Infos From Registry" rel="bookmark inlinks">Get Windows 7 Hotfix Infos From Registry</a><span class="count">( 0 )</span></li>
<li><a href="http://www.h4ck.org.cn/2011/01/wsock32-hook-send-and-recv-functions/" title="WSock32 Hook send and recv Functions" rel="bookmark inlinks">WSock32 Hook send and recv Functions</a><span class="count">( 1 )</span></li>
<li><a href="http://www.h4ck.org.cn/2010/04/get-device-type/" title="获取指定类型的设备，符号链接" rel="bookmark inlinks">获取指定类型的设备，符号链接</a><span class="count">( 0 )</span></li>
<li><a href="http://www.h4ck.org.cn/2010/02/libraryfunctions/" title="LibraryFunctions" rel="bookmark inlinks">LibraryFunctions</a><span class="count">( 0 )</span></li>
<li><a href="http://www.h4ck.org.cn/2010/01/drivers/" title="键盘过滤驱动勘误《寒江独钓》" rel="bookmark inlinks">键盘过滤驱动勘误《寒江独钓》</a><span class="count">( 0 )</span></li>
<li><a href="http://www.h4ck.org.cn/2011/05/hello-world-2/" title="Hello Apple" rel="bookmark inlinks">Hello Apple</a><span class="count">( 2 )</span></li>
<li><a href="http://www.h4ck.org.cn/2011/12/moving-to-windows-x64-translate-to-ch/" title="Moving to Windows x64【翻译】" rel="bookmark inlinks">Moving to Windows x64【翻译】</a><span class="count">( 2 )</span></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.h4ck.org.cn/2011/01/detours-install/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

