|
|
|
[原创]《寒江独钓:Windows内核安全编程》已发售
ps2intcap这个例子在光盘中就有,光盘中的例子我们都直接运行过,我未能发现什么错误(如果发现,我当然就改了)既然你发现了太多的错误,还麻烦你指出,以便让我能够有机会修改。 |
|
[原创]《寒江独钓:Windows内核安全编程》已发售
好久没有来过了,所以少看这个。不过你既然解决了,嘿嘿,那就不说了。 |
|
[原创]《寒江独钓:Windows内核安全编程》已发售
第一个问题,调试,这个问题说“除了_asm int 3之外, 没有任何其它调试方法的介绍”纯属冤枉。本书第15页:“在驱动加载之前,设置断点不方便。所以笔者手工在DriverEntry 中加入一个断点如下:”,也就是说用int 3设置断点是因为在驱动加载之前,不方便设置断点采用的临时措施,绝对没有说int 3是唯一的设置断点的方法。 本书第16页很清楚的写明: “(3)将光标移动到代码某一行上按下F9 键设置一个断点。请注意设置断点之前,系统必须已经中断;否则无法设置和修改断点。此外,再按一次F9 键可以取消断点。” 如果你按本书的第一章设置好了代码目录、符号表目录,从技术上说就可以用F9设置断点。如果不行,只剩下一点运气问题。WinDbg并不是总是没问题的,你必须多试几次。 第二个问题,应用程序和驱动程序的通讯问题 本书至少有两章讲解了应用程序和驱动程序的通讯,其中之一是第9章,其中之二是第11章。因为驱动和应用程序通信的方法都是一样的,所以没有必要每个例子都讲解驱动和应用程序的通信。所以9章之前的例子都有意设计成了不需要和应用程序通信的情况。让读者可以先熟悉驱动程序的开发。而且本书“阅读注意”中一开头就说本书应该从头到尾阅读,循序渐进,而不应该仅仅为了实现某个需求而阅读本书的某一章。 第三,迷惑的概念 “被绑定的目标设备, 这个设备是虚拟设备还是真实的设备? 它和目标设备之间、和真实设备之间的关系”这一点其实在书上多处都有解释。其中解说最多的是第三章。第四章的情况和第三章几乎完全一样,所以没有必要再次反复的加以解说。本书3.1.1的开头: “进行过滤的最主要的方法是对一个设备对象(Device Object)进行绑定。读者可以想象,Windows系统之所以可以运作,是因为Windows中已经存在许多提供了各种功能的设备对象。这些设备对象接收请求,并完成实际硬件的功能。 “我们可以首先认为:一个真实的设备对应一个设备对象(虽然实际对应关系可能复杂得多)。通过编程可以生成一个虚拟的设备对象,并“绑定”(Attach)在一个真实的设备上。一旦绑定,则本来操作系统发送给真实设备的请求,就会首先发送到这个虚拟设备。” 至于你绑定的实际是什么设备,以及你的设备之下是什么设备,它们有什么关系,这和具体情况有关,甚至和这台计算机上安装的其他软件有关,换句话说,作为这层设备的编程者,根本不需要去关心,也不能依赖这些信息。 第四个问题: 代码中的有不少函数出现了, 但是没有讲解用它的作用,比如: IoCopyCurrentIrpStackLocationToNext(Irp); 为什么要调用这个函数?作用是什么? 调用后产生的结果是什么样的? 这个函数最初出现在第4章第70页,在调用之前本书已经有解释(同一页上): "调用IoCopyCurrentIrpStackLocationToNext把当前IRP栈空间拷贝到下一个栈空间(这和前面的调用IoSkipCurrentIrpStackLocation跳过当前栈空间形成对比)。" 这个解释只是为了让读者能使用这个函数。在本书第7章196页又做了总结性的介绍: "完成IRP时是忽略还是拷贝当前栈空间(IO_STACK_LOCATION),返回什么状态值,以及完成函数中如何结束IRP,是不那么容易弄清楚的一件事情。笔者做个总结如下: (1)如果对IRP完成之后的事情无兴趣,则直接忽略当前IO_STACK_ LOCATION(从代码上说,调用内核API函数IoSkipCurrentIrpStackLocation),然后向下传递请求,返回IoCallDriver所返回的状态。 (2)不但对IRP完成之后的事情无兴趣,而且不打算继续传递,打算立刻返回成功或失败。那么不用忽略或者拷贝当前IO_STACK_LOCATION,填写IRP的状态参数后调用IoCompleteRequest,并返回自己想返回的结果。 (3)如果对IRP完成之后的事情有兴趣,并打算在完成函数中处理,应该首先拷贝当前IO_STACK_LOCATION(IoCopyCurrentIrpStackLocationToNext),然后指定完成函数,并返回IoCallDriver()所返回的状态。在完成函数中,不需要调用IoCompleteRequest,直接返回IRP的当前状态即可。 (4)同(3)的情况,有时候,会把任务塞入系统工作线程或者希望在另外的线程中去完成IRP,那么完成函数中应该返回STATUS_MORE_PROCESSING_ REQUIRED,此时完成IRP时应该调用IoCompleteRequest。另一种类似的情况是在分发函数中等待完成函数中设置事件,那么完成函数返回STATUS_MORE_PROCESSING_REQUIRED,分发函数在等待结束后调用IoCompleteRequest。 " 我理解读者希望读到某一个部分就完全弄懂已经读过的所有的部分的心情,但是在Windows内核编程中,很遗憾这是不可能的。越想了解得多,进展就越缓慢,甚至可能就泄气放弃了。本人在完成第一个商业产品之前,许多概念都没有弄懂,但是开发了很多项目之后,许多概念就慢慢的懂了。本书没办法在第4章就把第4章需要的全部知识都罗列给读者(那后面的章节就没有必要了),但是凭我的经验说一句:知识是许多项目积累和总结出来的,而不是一蹴而就的学会的。在早期的学习中囫囵吞枣并不总是错的。 第五个问题:关于代码的注释。 关于代码的注释是仁者见仁智者见智,每个人都希望自己不懂的地方注释多,而自己懂的地方注释少。但是每个人懂和不懂的地方并不一样,所以满足所有人是不可能的。而且本书中的代码并没有为特定的读者特别写过,很多代码是原始工程中留下来的。 |
|
[原创]《寒江独钓:Windows内核安全编程》已发售
因为不是首发,当当一般从发货到上架要一周半左右的时间。 |
|
[原创]《寒江独钓:Windows内核安全编程》已发售
baud=1152是不是写错了,应该是baud=115200 |
|
[原创]《寒江独钓:Windows内核安全编程》已发售
前面的wowocock帖子已经做了解释,是WDK的版本的问题,不是操作系统的版本的问题。感谢你再次指出,我在本帖第一楼着重说明这个问题,以便避免读者的困扰。 |
|
|
|
|
|
[原创]《寒江独钓:Windows内核安全编程》已发售
感谢你的建议。 TARGETPATH=.不加应该也是可以通过的,你的没有通过,我想可能具体环境(比如WDK的版本)有关。这本书中所有的代码例子都有三到四个作者或者审校者编译测试过。这个最简单的例子本人是自己编译过的。但是可能还是一些情况没有碰到过。 关于编译和调试环境的配置,有两种截然不同的意见。有人认为既然是这样的书就是给高手看的,填充了很多操作手顺、图片之类的占据篇幅,反而有"骗钱"“充数”的嫌疑。有人则认为介绍得越仔细越好。我是倾向后者的。但是在写的时候,并不一定能注意到所有的问题。所以写完初稿之后我是发给完全没有学过驱动的朋友让他去试用,然后又根据反馈修改过的。这其中的问题真是千奇百怪:有人装的其实是64位的Windows,但是自己却不知道,结果WinDbg的路径出现问题。有的人设置完环境变量之后,发现重启VS也不起作用。最后发现直接点开工程和打开VS再打开工程结果还不相同。总之问题是难以写完的,我们尽量覆盖吧!如果发现有什么不清楚或者导致疑惑之处,还请具体的指出,这样我们在勘误中就可以增加一些更详细的说明,也便于重印的时候修改。 |
|
[原创]《寒江独钓:Windows内核安全编程》已发售
有人已经收到书了吗? |
|
[原创]《寒江独钓:Windows内核安全编程》已发售
刚刚到货,可以直接购买了。 |
|
|
|
[原创]《寒江独钓:Windows内核安全编程》已发售
天书是搞反汇编的,这本书是做安全软件内核态编程的,二者侧重点不同,不存在先后关系。 |
|
[原创]《寒江独钓:Windows内核安全编程》已发售
今天意外发现已经可以订购了,故自己顶一下。 |
操作理由
RANk
{{ user_info.golds == '' ? 0 : user_info.golds }}
雪币
{{ experience }}
课程经验
{{ score }}
学习收益
{{study_duration_fmt}}
学习时长
基本信息
荣誉称号:
{{ honorary_title }}
能力排名:
No.{{ rank_num }}
等 级:
LV{{ rank_lv-100 }}
活跃值:
在线值:
浏览人数:{{ visits }}
最近活跃:{{ last_active_time }}
注册时间:{{ user_info.create_date_jsonfmt }}
勋章
兑换勋章
证书
证书查询 >
能力值