<?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>Vc爱好者 v3.0 &#187; win32</title>
	<atom:link href="http://www.vcfans.com/tag/win32/feed" rel="self" type="application/rss+xml" />
	<link>http://www.vcfans.com</link>
	<description>生活的天平本不平衡，只有通过努力改变其偏向。</description>
	<lastBuildDate>Thu, 26 Aug 2010 09:17:56 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>挥刀自宫术</title>
		<link>http://www.vcfans.com/2010/04/brandished-a-knife-from-the-uterus.html</link>
		<comments>http://www.vcfans.com/2010/04/brandished-a-knife-from-the-uterus.html#comments</comments>
		<pubDate>Fri, 09 Apr 2010 06:37:11 +0000</pubDate>
		<dc:creator>lonkil</dc:creator>
				<category><![CDATA[编程开发]]></category>
		<category><![CDATA[VC]]></category>
		<category><![CDATA[win32]]></category>
		<category><![CDATA[奇技淫巧]]></category>

		<guid isPermaLink="false">http://www.vcfans.com/?p=1139</guid>
		<description><![CDATA[一段自删除代码，写的很牛。]]></description>
		<wfw:commentRss>http://www.vcfans.com/2010/04/brandished-a-knife-from-the-uterus.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Pro OGRE 3D Programming  中文翻译版本0.2.0(chm)</title>
		<link>http://www.vcfans.com/2009/03/pro-ogre-3d-programming-chinese-translation-version-020-chm.html</link>
		<comments>http://www.vcfans.com/2009/03/pro-ogre-3d-programming-chinese-translation-version-020-chm.html#comments</comments>
		<pubDate>Thu, 05 Mar 2009 10:56:36 +0000</pubDate>
		<dc:creator>lonkil</dc:creator>
				<category><![CDATA[编程开发]]></category>
		<category><![CDATA[VC]]></category>
		<category><![CDATA[win32]]></category>
		<category><![CDATA[电子书]]></category>

		<guid isPermaLink="false">http://www.vcfans.com/?p=865</guid>
		<description><![CDATA[OGRE真是一个很牛X且开源的3D图像引擎，值得学习，分享一份中文开发文档。]]></description>
		<wfw:commentRss>http://www.vcfans.com/2009/03/pro-ogre-3d-programming-chinese-translation-version-020-chm.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>VC++文件拖拽功能实现</title>
		<link>http://www.vcfans.com/2008/11/visual-c-drag-and-drop-files-to-achieve.html</link>
		<comments>http://www.vcfans.com/2008/11/visual-c-drag-and-drop-files-to-achieve.html#comments</comments>
		<pubDate>Sat, 08 Nov 2008 15:33:01 +0000</pubDate>
		<dc:creator>lonkil</dc:creator>
				<category><![CDATA[本站原创]]></category>
		<category><![CDATA[编程开发]]></category>
		<category><![CDATA[sdk]]></category>
		<category><![CDATA[VC]]></category>
		<category><![CDATA[win32]]></category>

		<guid isPermaLink="false">http://www.vcfans.com/?p=724</guid>
		<description><![CDATA[Windows程序支持两种拖拽试式，一种文件拖拽，这正是我今天要演示的。一种是OLE拖拽，当你在VC中编辑代码，将代码从这个位置拖到另一个位置，就属于这种。拖拽功能给用户的操作带很大的方便，这一细节有助于提高软件的交互性和用户体验。这早已不是什么新技术，介绍给还不知道的朋友。]]></description>
		<wfw:commentRss>http://www.vcfans.com/2008/11/visual-c-drag-and-drop-files-to-achieve.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>一款盗号木马的核心源码</title>
		<link>http://www.vcfans.com/2008/09/a-stolen-account-of-the-trojan-core-source.html</link>
		<comments>http://www.vcfans.com/2008/09/a-stolen-account-of-the-trojan-core-source.html#comments</comments>
		<pubDate>Tue, 16 Sep 2008 05:38:25 +0000</pubDate>
		<dc:creator>lonkil</dc:creator>
				<category><![CDATA[经典源码]]></category>
		<category><![CDATA[编程开发]]></category>
		<category><![CDATA[VC]]></category>
		<category><![CDATA[win32]]></category>
		<category><![CDATA[汇编]]></category>
		<category><![CDATA[逆向]]></category>

		<guid isPermaLink="false">http://www.vcfans.com/?p=531</guid>
		<description><![CDATA[大概看了一下，实现方法和内存注册机比较像。先调试定位，然后计算好偏移后，再写代码。]]></description>
		<wfw:commentRss>http://www.vcfans.com/2008/09/a-stolen-account-of-the-trojan-core-source.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Windows句柄表格式(1) &#8211; 2000句柄表格式</title>
		<link>http://www.vcfans.com/2008/08/windows-handle-format-1-2000-forms-handler.html</link>
		<comments>http://www.vcfans.com/2008/08/windows-handle-format-1-2000-forms-handler.html#comments</comments>
		<pubDate>Fri, 22 Aug 2008 10:57:47 +0000</pubDate>
		<dc:creator>lonkil</dc:creator>
				<category><![CDATA[编程开发]]></category>
		<category><![CDATA[win32]]></category>
		<category><![CDATA[逆向]]></category>

		<guid isPermaLink="false">http://www.vcfans.com/?p=419</guid>
		<description><![CDATA[科大的牛人，出手就是不同凡响。不过居然工作后做Web方面的开发，也算是有才了。饭碗和爱好还是不能兼得的。by lonkil

发信人: ftofficer(0210&#124;别了，科大), 信区: Kernel
标 题: Windows句柄表格式(1) - 2000句柄表格式
发信站: 瀚海星云 (2006年11月26日01:50:44 星期天), 站内信件

版大暗示我需要交一篇原创了。工作以后天天搞一些Web上面的开发，很久没有研究内核
了。翻翻以前自己的手记，拼凑了一篇，简单写些Windows当中的句柄表格式好了。

今天比较晚了，先写2000下面的，明天再整理一个XP的好了。两者之间差异巨大，几乎
是完全重写的。

句柄表是Windows Object Manager维护的一个进程范围有效的表，用来管理Windows的内
核对象。关于Object Manager和句柄表的基础可以参见《Windows Internal》，讲的很
清楚。但是一旦涉及到了句柄表的实际格式，《Windows Internal》就讳莫如深了，对
于2000的句柄表还说了一些，但是对于XP/2003就基本上没有说什么了。

我们对句柄表的探索是从EPROCESS开始的，EPROCESS结构当中有一个指向_HANDLE_TABLE
结构的指针，名字叫做 ObjectTable，2000在0x128处，XP在0xC4处。这个结构在2000和
XP当中是完全不同的。2000当中定义很简单：
kd> dt nt!_handle_table
nt!_HANDLE_TABLE
+0x000 Flags         : Uint4B
+0x004 HandleCount     : Int4B
+0x008 Table         : Ptr32 Ptr32 Ptr32 _HANDLE_TABLE_ENTRY
+0x00c QuotaProcess   : Ptr32 _EPROCESS
+0x010 UniqueProcessId : Ptr32 Void
+0x014 FirstFreeTableEntry : Int4B
+0x018 NextIndexNeedingPool : Int4B
+0x01c HandleTableLock : _ERESOURCE
+0x054 HandleTableList : _LIST_ENTRY
+0x05c HandleContentionEvent : _KEVENT

真正指向Handle table entry的就是那个Table指针了，这是一个类型为_HANDLE_TABLE_
ENTRY***的东西，所以从2000的句柄表当中查东西出来就是分三次查表就好了。在WI当
中也有讲，Windows 2000将句柄值除以4之后，把结果的后24位当作三个8位索引来看待
，每个都是在对应级别的索引表当中的索引，前两个是Ptr表，最后一级是
_HANDLE_TABLE_ENTRY表。（这一点Windows Internal说的不清楚，容易让人认为说不用
除以4）。

举个例子来说吧。随便找个handle比较多的进程，就拿Winlogon好了。

kd> !handle 0628 7 b8
processor number 0
Searching for Process with Cid == b8
PROCESS fd779820 SessionId: 0 Cid: 00b8   Peb: 7ffdf000 ParentCid: 008c
DirBase: 035bf000 ObjectTable: fd7806a8 TableSize: 372.
Image: WINLOGON.EXE

Handle Table at e1cc9000 with 372 Entries in use
0628: Object: fd670488 GrantedAccess: 0012019f
Object: fd670488 Type: (fd90b840) File
ObjectHeader: fd670470
    HandleCount: 1 PointerCount: 1
    Directory Object: 00000000 Name: \SfcApi {NamedPipe}

记着这个Handle 0x0628。下面我们手动来查查看。先看这个Handle的值，除以4之后是0
x18A，低三个字节分别代表三个索引：0x00，0x01，0x8A。下面从进程的EPROCESS开始
：

kd> dt nt!_eprocess fd779820
nt!_EPROCESS
+0x000 Pcb         : _KPROCESS
...
+0x128 ObjectTable     : 0xfd7806a8 _HANDLE_TABLE

kd> dt nt!_handle_table 0xfd7806a8
nt!_HANDLE_TABLE
+0x000 Flags         : 0
+0x004 HandleCount     : 372
+0x008 Table         : 0xe1cc9000 -> 0xe1cc9400 -> 0xe1cc9800
_HANDLE_TABLE_ENTRY
...

第一级索引表在e1cc9000，索引为0，故：
kd> dd 0xe1cc9000
e1cc9000 e1cc9400 00000000 00000000 00000000
...

故第二级索引表在e1cc9400，索引为0x01，注意每个索引项为4字节：
kd> dd e1cc9400+0x01*4
e1cc9404 e1eb3000 e1eb3800 00000000 00000000
...

故sub handle table地址为e1eb3000，索引为0x8A，注意这时候表中存储的已经是_HAND
LE_TABLE_ENTRY了，故而每个大小为8字节：
kd> dd e1eb3000+0x8A*8
e1eb3450 7d670470 0012019f 7d6701e8 001f03ff
...

可见该对象的_OBJECT_HEADER结构位置在(7d670470 &#038; FFFFFFF8) &#124; 80000000 =
Fd670470，_OBJECT_HEADER当中的结构是0x18字节，之后就是各种对象的data了。所以
对象所在的位置就是fd670488
kd> !object Fd670488
Object: fd670488 Type: (fd90b840) File
ObjectHeader: fd670470
HandleCount: 1 PointerCount: 1
Directory Object: 00000000 Name: \SfcApi {NamedPipe}

这正与2000的句柄表格式相符。


--
Doing a little bit at a time, and an oyster makes a pearl.
※ 来源:·瀚海星云 bbs.ustc.edu.cn·[FROM: 222.95.168.191]
]]></description>
		<wfw:commentRss>http://www.vcfans.com/2008/08/windows-handle-format-1-2000-forms-handler.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>获取硬盘序列号</title>
		<link>http://www.vcfans.com/2008/07/get-hard-drive-serial-number.html</link>
		<comments>http://www.vcfans.com/2008/07/get-hard-drive-serial-number.html#comments</comments>
		<pubDate>Sun, 13 Jul 2008 14:46:34 +0000</pubDate>
		<dc:creator>lonkil</dc:creator>
				<category><![CDATA[经典源码]]></category>
		<category><![CDATA[编程开发]]></category>
		<category><![CDATA[VC]]></category>
		<category><![CDATA[win32]]></category>
		<category><![CDATA[源码]]></category>

		<guid isPermaLink="false">http://www.vcfans.com/?p=348</guid>
		<description><![CDATA[在网上找到一份取硬盘序列号的类，原作者已经无法查证了。这个类的作用就不多说了，至少可以一定程度的防止软件的任意Copy。

我在其中作了一处修改，因为原作者采用了MFC中的CString，在SDK下面使用不便，我就简单的修改了一下。]]></description>
		<wfw:commentRss>http://www.vcfans.com/2008/07/get-hard-drive-serial-number.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>窗口间的数据通信之消息通信</title>
		<link>http://www.vcfans.com/2008/06/window-between-the-data-communications-messaging.html</link>
		<comments>http://www.vcfans.com/2008/06/window-between-the-data-communications-messaging.html#comments</comments>
		<pubDate>Sat, 14 Jun 2008 11:06:37 +0000</pubDate>
		<dc:creator>lonkil</dc:creator>
				<category><![CDATA[编程开发]]></category>
		<category><![CDATA[win32]]></category>
		<category><![CDATA[汇编]]></category>

		<guid isPermaLink="false">http://192.168.1.12/?p=324</guid>
		<description><![CDATA[

Windows窗口之间的通信有多种方式，据我所知的就有：通过Socket、互发消息、剪贴板等，我用Win32 ASM演示了通过互发消息进行通信的两种方式，一种方式通过发送WM_SETTEXT，进行简单的字符串的通信；一种方式通过...]]></description>
		<wfw:commentRss>http://www.vcfans.com/2008/06/window-between-the-data-communications-messaging.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>计算机电源使用类型检测程序</title>
		<link>http://www.vcfans.com/2008/06/power-types-of-computer-use-testing-procedures.html</link>
		<comments>http://www.vcfans.com/2008/06/power-types-of-computer-use-testing-procedures.html#comments</comments>
		<pubDate>Sat, 14 Jun 2008 11:04:40 +0000</pubDate>
		<dc:creator>lonkil</dc:creator>
				<category><![CDATA[编程开发]]></category>
		<category><![CDATA[win32]]></category>
		<category><![CDATA[汇编]]></category>

		<guid isPermaLink="false">http://192.168.1.12/?p=323</guid>
		<description><![CDATA[在上一篇文章《安装XP SP3发现的小功能》中，看到微软的SP3在安装的时候对所使用的电源进行了检测，感觉这样的功能具有一定的实用意义。因为以前没接触地电源管理方面的知识，在最我提到要了解一下，这一功能是怎么实...]]></description>
		<wfw:commentRss>http://www.vcfans.com/2008/06/power-types-of-computer-use-testing-procedures.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>定时关机重启注销源码</title>
		<link>http://www.vcfans.com/2008/06/timing-shutdown-restart-write-off-source.html</link>
		<comments>http://www.vcfans.com/2008/06/timing-shutdown-restart-write-off-source.html#comments</comments>
		<pubDate>Mon, 09 Jun 2008 10:47:45 +0000</pubDate>
		<dc:creator>lonkil</dc:creator>
				<category><![CDATA[编程开发]]></category>
		<category><![CDATA[win32]]></category>
		<category><![CDATA[汇编]]></category>

		<guid isPermaLink="false">http://192.168.1.12/?p=319</guid>
		<description><![CDATA[第一个ASM程序，终于写了一个比Hello Word稍微复杂一点的程序了。这个程序断断续续的写了很长的时间，其间在一边学习ASM，一边写这个小程序。利用这个程序学到不少汇编方面的知识。今天 终于将这个程序给写结束了，W...]]></description>
		<wfw:commentRss>http://www.vcfans.com/2008/06/timing-shutdown-restart-write-off-source.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>用ASM做的定时关机重启注销程序</title>
		<link>http://www.vcfans.com/2008/06/asm-do-with-the-timing-of-resuming-the-write-off-procedures-shutdown.html</link>
		<comments>http://www.vcfans.com/2008/06/asm-do-with-the-timing-of-resuming-the-write-off-procedures-shutdown.html#comments</comments>
		<pubDate>Mon, 09 Jun 2008 10:44:40 +0000</pubDate>
		<dc:creator>lonkil</dc:creator>
				<category><![CDATA[本站原创]]></category>
		<category><![CDATA[win32]]></category>
		<category><![CDATA[汇编]]></category>

		<guid isPermaLink="false">http://192.168.1.12/?p=318</guid>
		<description><![CDATA[主要功能：实现定时关机、重启、注销，本下载文件中包含ASM代码，需要借鉴的朋友可以下来看看。

插一张程序界面：



[download id="61"]]]></description>
		<wfw:commentRss>http://www.vcfans.com/2008/06/asm-do-with-the-timing-of-resuming-the-write-off-procedures-shutdown.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>xp下双开3389源码</title>
		<link>http://www.vcfans.com/2008/05/under-a-3389-double-xp-source.html</link>
		<comments>http://www.vcfans.com/2008/05/under-a-3389-double-xp-source.html#comments</comments>
		<pubDate>Sun, 25 May 2008 09:49:58 +0000</pubDate>
		<dc:creator>lonkil</dc:creator>
				<category><![CDATA[编程开发]]></category>
		<category><![CDATA[win32]]></category>
		<category><![CDATA[源码]]></category>

		<guid isPermaLink="false">http://192.168.1.12/?p=299</guid>
		<description><![CDATA[

作者：cooldiyer
来源：红狼

很早时候写的,方便大家用,代码丢了我也可以百度到
编译后,直接运行,XP的终端自动开启激活guest,密码为cooldiyer,加管理员组
并且可以多用户登录
声明,原创………………..
 ...]]></description>
		<wfw:commentRss>http://www.vcfans.com/2008/05/under-a-3389-double-xp-source.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>提高程序质量的注意事项</title>
		<link>http://www.vcfans.com/2008/05/improve-the-quality-of-attention-to-procedural-matters.html</link>
		<comments>http://www.vcfans.com/2008/05/improve-the-quality-of-attention-to-procedural-matters.html#comments</comments>
		<pubDate>Tue, 13 May 2008 09:28:07 +0000</pubDate>
		<dc:creator>lonkil</dc:creator>
				<category><![CDATA[编程开发]]></category>
		<category><![CDATA[win32]]></category>

		<guid isPermaLink="false">http://192.168.1.12/?p=282</guid>
		<description><![CDATA[Author: brike.huang
Email: brike.huang_at_163.com
QQ: 24558102
Date: 2008.05
--------------------
以下是我从事windows开发的一些心得，希望对各位有所帮助。
软件开发，比较重要是软件需求、进度控制、...]]></description>
		<wfw:commentRss>http://www.vcfans.com/2008/05/improve-the-quality-of-attention-to-procedural-matters.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SvcHost.exe 调用的服务原理与实践</title>
		<link>http://www.vcfans.com/2008/05/svchostexe-call-the-service-principles-and-practice.html</link>
		<comments>http://www.vcfans.com/2008/05/svchostexe-call-the-service-principles-and-practice.html#comments</comments>
		<pubDate>Mon, 12 May 2008 09:24:15 +0000</pubDate>
		<dc:creator>lonkil</dc:creator>
				<category><![CDATA[编程开发]]></category>
		<category><![CDATA[win32]]></category>

		<guid isPermaLink="false">http://192.168.1.12/?p=280</guid>
		<description><![CDATA[1. 多个服务共享一个Svchost.exe进程利与弊

windows 系统服务分为独立进程和共享进程两种，在windows NT时只有服务器管理器SCM（Services.exe）有多个共享服务，随着系统内置服务的增加，在windows 2000中ms又把很...]]></description>
		<wfw:commentRss>http://www.vcfans.com/2008/05/svchostexe-call-the-service-principles-and-practice.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>网站刷流量的VC源码</title>
		<link>http://www.vcfans.com/2008/05/brush-site-traffic-vc-source.html</link>
		<comments>http://www.vcfans.com/2008/05/brush-site-traffic-vc-source.html#comments</comments>
		<pubDate>Mon, 12 May 2008 09:23:09 +0000</pubDate>
		<dc:creator>lonkil</dc:creator>
				<category><![CDATA[编程开发]]></category>
		<category><![CDATA[win32]]></category>
		<category><![CDATA[源码]]></category>

		<guid isPermaLink="false">http://192.168.1.12/?p=279</guid>
		<description><![CDATA[
这种刷流量的话，不支持脚本统计代码，因为脚本它根本没执行。不过可以从中学习了用Socket访问Http的方法]]></description>
		<wfw:commentRss>http://www.vcfans.com/2008/05/brush-site-traffic-vc-source.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>一道有趣的C基础题,感兴趣的可以试试。[5月15日修]</title>
		<link>http://www.vcfans.com/2008/05/c-an-interesting-basis-for-that-you-might-be-interested.html</link>
		<comments>http://www.vcfans.com/2008/05/c-an-interesting-basis-for-that-you-might-be-interested.html#comments</comments>
		<pubDate>Tue, 06 May 2008 09:06:01 +0000</pubDate>
		<dc:creator>lonkil</dc:creator>
				<category><![CDATA[编程开发]]></category>
		<category><![CDATA[win32]]></category>
		<category><![CDATA[程序]]></category>

		<guid isPermaLink="false">http://192.168.1.12/?p=269</guid>
		<description><![CDATA[感谢whislter 对本人错误的指出，现对本文进行如下修订。
;===========================================
;一道有趣的C基础题,感兴趣的可以试试。
;Author: Lonkil
;By Lonkil (lonkil_at_gmail.com)
;2...]]></description>
		<wfw:commentRss>http://www.vcfans.com/2008/05/c-an-interesting-basis-for-that-you-might-be-interested.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
