随笔分类 - Windows Driver Dev
摘要:void ReadRegistry(){	NTSTATUS nStatus;	ULONG default_value = 0;	static RTL_QUERY_REGISTRY_TABLE table[3];//必须比实际元素多一个,即N+1		KdPrint(("ReadRegistry\n"));	table[0].Flags = RTL_QUERY_REGISTRY_D...
        阅读全文
                
摘要:wacom_features数组记录着各类wacom手写板型号的信息 其中第28个元素,和我这个手写板型号一样。且VendorID为USB_VENDOR_ID_WACOM,ProductID为0x65 其中函数wacom_graphire_irq是对手写板数据读取的重要函数。  x = data[2] | ((__u32)data[3] << 8); y = data[4] | ((_...
        阅读全文
                
摘要:两个函数都是提供原子操作的函数。ExInterlockedXXXX需要自旋锁InterlockedXXXX不需要自旋锁
        阅读全文
                
摘要:Windbg/KD配置可以参见xIkUg的文章1,调试动态加载的驱动,如果有符号,则可以在驱动加载前,在Windbg/KD中执行如下命令 bu mydriver!DriverEntry,驱动在载入的时候就会被断在DriverEntry函数入口. 2,如果没有符号,1种办法是,在系统调用DriverEntry处下断,因为操作系统不同,所以其具体位置也不一样, 不过目前win2k,xp,2k3 都在n...
        阅读全文
                
摘要:bp 命令是在某个地址下断点, 可以 bp 0x7783FEB 也可以 bp MyApp!SomeFunction 。 对于后者,WinDBG 会自动找到MyApp!SomeFunction 对应的地址并设置断点。但是使用bp的问题在于:1)当代码修改之后,函数地址改变,该断点仍然保持在相同位置,不一定继续有效; 2)WinDBG 不会把bp断点保存工作空间中 。 所以,我比较喜欢用bu 命令。b...
        阅读全文
                
摘要:Windbg对过滤驱动DriverEntry函数下断点技巧 方法1: 1> 先用DeviceTree.exe查看指定的过滤驱动的Load Address(加载地址) 2> 再用LordPE.EXE查看指定过滤驱动文件的入口点地址 3> 计算过滤驱动的DriverEntry函数内存地址 DriverEntry函数内存地址 = Load Address + 入口点地址 例子: 1&g...
        阅读全文
                
摘要:The operating system, drivers, and device installation components store information about drivers and devices in the registry. In general, drivers and device installation components should use the reg...
        阅读全文
                
摘要:会注册GUID_DEVINTERFACE_HID(GUID_CLASS_INPUT),和GUID_DEVINTERFACE_USB_DEVICE(GUID_CLASS_USB_DEVICE)其中USBView就是利用注册GUID_CLASS_USB_DEVICE来实现观察USB设备的
        阅读全文
                
摘要:安装设备时候可以用这个命令devcon install xx.inf “hardward id”注册表HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class,代表这个设备所属的类别HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\DeviceClasses,代表...
        阅读全文
                
摘要:HKCRAbbreviation for HKEY_CLASSES_ROOTHKCUAbbreviation for HKEY_CURRENT_USERHKLMAbbreviation for HKEY_LOCAL_MACHINEHKUAbbreviation for HKEY_USERSHKRRelative root − that is, keys specified using ...
        阅读全文
                
摘要:在Interface Descriptor中,Class被设为HID,SubClass被设为Subclass Code Description 0 No Subclass 1 Boot Interface Subclass 2 - 255 Reserved而具体是鼠标还是键盘,这些不用Class描述,而用HID Report Descriptor描述
        阅读全文
                
摘要:USB HID设备所需要的描述符 其中 Physical descriptor是可选的,一般不用。
        阅读全文
                
摘要:Using USB terminology, a device may send or receive a transaction every USB frame (1 millisecond). A transaction may be made up of multiple packets (token, data, handshake) but is limited in size to 8...
        阅读全文
                
摘要:software key A system-generated, device-specific, registry subkey that contains information about the driver software associated with a device. Also called a driver key.hardware key A system-generated...
        阅读全文
                
摘要:The following trees in the registry are of particular interest to driver writers (where HKLM represents HKEY_LOCAL_MACHINE):The HKLM\SYSTEM\CurrentControlSet\Services TreeThe HKLM\SYSTEM\CurrentContro...
        阅读全文
                
摘要:1.Registry Key Object RoutinesA driver can manipulate a registry-key object by performing the following steps:Open a handle to the registry-key object. For more information, see Opening a Handle to a ...
        阅读全文
                
摘要:在逆向的时候发现有KeTickCount,它其实是应该调用KeQueryTickCount时产生的。KeQueryTickCount其实是个宏#define KeQueryTickCount(CurrentCount ) { \ volatile PKSYSTEM_TIME _TickCount = *((PKSYSTEM_TIME *)(&KeTickCount)); \ while (...
        阅读全文
                
摘要:IopCreateFile=>IoMountVolume=>IopMountFileSystemIopMountFileSystem构造IRP StackPtr->MajorFunction = IRP_MJ_FILE_SYSTEM_CONTROL; StackPtr->MinorFunction = IRP_MN_MOUNT_VOLUME; 然后依次查询注册过的分区驱动,...
        阅读全文
                
摘要:1.查看寄存器 r r eax r gdtr 2.查看pcr !pcr 3.查看idt表 !idt
        阅读全文
                
                    
                
浙公网安备 33010602011771号