windbg指令-!drvobj

来源:互联网 发布:淘宝网卖家微淘 编辑:程序博客网 时间:2024/06/02 03:56

!drvobj
!devobj
!podev
!devstack

"!drvobj Driver Name | PDRIVER_OBJECT pointer" 列出这个驱动创建的所有设备。

kd> !drvobj /Driver/i8042prt
Driver object (82158040) is for:
 /Driver/i8042prt
Driver Extension List: (id , addr)

Device Object list:
8213c3d0  82153738 

当你有了一个设备列表,传入设备指针给!devobj或!devstack来得到更多信息。

 kd> !devobj 8213c3d0 
Device object (8213c3d0) is for:
  /Driver/i8042prt DriverObject 82158040
Current Irp 00000000 RefCount 0 Type 00000027 Flags 00002004
DevExt 8213c488 DevObjExt 8213c768
ExtensionFlags (0xe0000000)  DOE_RAW_FDO, DOE_BOTTOM_OF_FDO_STACK,
                             DOE_DESIGNATED_FDO
AttachedDevice (Upper) 8213c250 /DRIVER/VERIFIER
AttachedTo (Lower) 8213c820 /DRIVER/VERIFIER
Device queue is not busy.


如果设备是一个pnp设备对象(FDO, PDO, filter, doesn't matter),!devstack显示设备的全部堆栈。

以上参考 http://blogs.msdn.com/doronh/archive/2006/03/15/552301.aspx

dt nt!_IRP 显示IRP数据结构

kd> dt nt!_IRP
   +0x000 Type             : Int2B
   +0x002 Size             : Uint2B
   +0x004 MdlAddress       : Ptr32 _MDL
   +0x008 Flags            : Uint4B
   +0x00c AssociatedIrp    : __unnamed
   +0x010 ThreadListEntry  : _LIST_ENTRY
   +0x018 IoStatus         : _IO_STATUS_BLOCK
   +0x020 RequestorMode    : Char
   +0x021 PendingReturned  : UChar
   +0x022 StackCount       : Char
   +0x023 CurrentLocation  : Char
   +0x024 Cancel           : UChar
   +0x025 CancelIrql       : UChar
   +0x026 ApcEnvironment   : Char
   +0x027 AllocationFlags  : UChar
   +0x028 UserIosb         : Ptr32 _IO_STATUS_BLOCK
   +0x02c UserEvent        : Ptr32 _KEVENT
   +0x030 Overlay          : __unnamed
   +0x038 CancelRoutine    : Ptr32   
   +0x03c UserBuffer       : Ptr32 Void
   +0x040 Tail             : __unnamed

bu driverName!DriverEntry, 其中driverName是驱动的名字,DriverEntry是需要中断的函数名,这样如果驱动运行,就会在DriverEntry处停止。
bp MyDriver!xyz  这个断点设在模块中的一个名字(<module>!<name>);
bp f89adeaa      设置在一个给出的地址
bl 列出所有断点
bc 清除断点 后面参数是这个断点对应的数字

原创粉丝点击