• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>

            tqsheng

            go.....
            隨筆 - 366, 文章 - 18, 評論 - 101, 引用 - 0
            數據加載中……

            鍵盤鉤子比較麻煩的就是得到KeyboardInterruptService 的地址,有什么方法呢

            得到i8042prt!I8042KeyboardInterruptService 地址的好方法
            http://www.cnblogs.com/adward/archive/2009/04/27/1444921.html



            鍵盤鉤子比較麻煩的就是得到KeyboardInterruptService 的地址,有什么方法呢?lkd> !idt

            Dumping IDT:

            37: 806d0728 hal!PicSpuriousService37
            3d: 806d1b70 hal!HalpApcInterrupt
            41: 806d19cc hal!HalpDispatchInterrupt
            50: 806d0800 hal!HalpApicRebootService
            62: 84d587ec atapi!IdePortInterrupt (KINTERRUPT 84d587b0)
            63: 84cebdd4 USBPORT!USBPORT_InterruptService (KINTERRUPT 84cebd98)
                      USBPORT!USBPORT_InterruptService (KINTERRUPT 84ce4988)
                      USBPORT!USBPORT_InterruptService (KINTERRUPT 84cddb78)
                      USBPORT!USBPORT_InterruptService (KINTERRUPT 84cd6d10)
                      USBPORT!USBPORT_InterruptService (KINTERRUPT 84ccfd98)
            73: 84d08044 VIDEOPRT!pVideoPortInterrupt (KINTERRUPT 84d08008)
            82: 84d58044 atapi!IdePortInterrupt (KINTERRUPT 84d58008)
            83: 84dbf67c atapi!IdePortInterrupt (KINTERRUPT 84dbf640)
                      atapi!IdePortInterrupt (KINTERRUPT 84dbf3d0)
            92: 84c0a044 serial!SerialCIsrSw (KINTERRUPT 84c0a008)
            93: 84c0bdd4 i8042prt!I8042KeyboardInterruptService (KINTERRUPT 84c0bd98)
            a3: 84c0b044 i8042prt!I8042MouseInterruptService (KINTERRUPT 84c0b008)

            lkd> dt _KINTERRUPT 84c0bd98
            nt!_KINTERRUPT
               +0x000 Type             : 22
               +0x002 Size             : 484
               +0x004 InterruptListEntry : _LIST_ENTRY [ 0x84c0bd9c - 0x84c0bd9c ]
               +0x00c ServiceRoutine   : 0xf76cc495 /*就是這兒了*/    unsigned char i8042prt!I8042KeyboardInterruptService+0
               +0x010 ServiceContext   : 0x84d5da88
               +0x014 SpinLock         : 0
               +0x018 TickCount        : 0xffffffff
               +0x01c ActualLock       : 0x84d5db48 -> 0
               +0x020 DispatchAddress : 0x80541aa0     void nt!KiInterruptDispatch+0
               +0x024 Vector           : 0x193
               +0x028 Irql             : 0x8 ''
               +0x029 SynchronizeIrql : 0x9 ''
               +0x02a FloatingSave     : 0 ''
               +0x02b Connected        : 0x1 ''
               +0x02c Number           : 0 ''
               +0x02d ShareVector      : 0 ''
               +0x030 Mode             : 1 ( Latched )
               +0x034 ServiceCount     : 0
               +0x038 DispatchCount    : 0xffffffff
               +0x03c DispatchCode     : [106] 0x56535554

            當然還可以特征碼搜索啦!也麻煩!

            rootkit上那個鍵盤王子介紹了一種很妙的方法!上代碼。

            PKINTERRUPT GetI8042PrtInterruptObject(void)
            {
            PDEVICE_OBJECT pDeviceObject = NULL; // Keyboard DeviceObject
            PFILE_OBJECT   fileObject;
            UNICODE_STRING keyName;
            // PPORT_KEYBOARD_EXTENSION KeyboardExtension;
            PKINTERRUPT ReturnValue = NULL;
              
            RtlInitUnicodeString( &keyName, NT_KEYBOARD_NAME0 );

            // Getting the DeviceObject top-of-the-stack of the kbdclass device
            IoGetDeviceObjectPointer(&keyName,
                     FILE_READ_ATTRIBUTES,
                     &fileObject,
                     &pDeviceObject);

            // if fails
            if( !pDeviceObject )
            {
               return NULL;
            }

            // Tracking the DeviceStack
            //
            //
            // If it is not a i8042prt
            while( pDeviceObject->DeviceType != FILE_DEVICE_8042_PORT )//下一個就是了,0x27
            {
               // go to the lower level object
               if (((PR_DEVOBJ_EXTENSION)pDeviceObject->DeviceObjectExtension)->AttachedTo)
                pDeviceObject = ((PR_DEVOBJ_EXTENSION)pDeviceObject->DeviceObjectExtension)->AttachedTo;
               else // here is lowest-level and couldn't find i8042prt
                  return NULL;
            }
            //
            // pDeviceObject == i8042prt's DeviceObject
            //
            ReturnValue = (PKINTERRUPT)((PPORT_KEYBOARD_EXTENSION)pDeviceObject->DeviceExtension)->InterruptObject;

            return ReturnValue;
            }

            主函數中調用

               ADDR= (ULONG)GetI8042PrtInterruptObject( );
                dprintf("keyboatserv.SYS: 0X%08X\n", ADDR);
            // +0x00c ServiceRoutine   : 0xf76cc495     unsigned char i8042prt!I8042KeyboardInterruptService+0
            // 找到了函數的地址了;
            I8042KeyboardInterruptServiceADDR=(ULONG)((PKINTERRUPT)GetI8042PrtInterruptObject()->ServiceRoutine);
            dprintf("keyboatserv.SYS: 0X%08X\n", I8042KeyboardInterruptServiceADDR);

            要用的結構

            typedef struct _R_DEVOBJ_EXTENSION
            {
            CSHORT Type;
            USHORT Size;
            PDEVICE_OBJECT DeviceObject;
            ULONG   PowerFlags;
            PVOID Dope;
            ULONG ExtensionFlags;
            PVOID DeviceNode;
            PDEVICE_OBJECT AttachedTo;
            ULONG StartIoCount;
            ULONG StartIoKey;
            ULONG StartIoFlags;
            PVOID Vpb;
            } R_DEVOBJ_EXTENSION, *PR_DEVOBJ_EXTENSION;

            typedef struct _PORT_KEYBOARD_EXTENSION {
                // Pointer back to the this extension's device object.
                PDEVICE_OBJECT      Self;
                PKINTERRUPT    InterruptObject;
            } PORT_KEYBOARD_EXTENSION, *PPORT_KEYBOARD_EXTENSION;
            typedef struct _KINTERRUPT {
                CSHORT   Type;
                CSHORT      Size;
                LIST_ENTRY          InterruptListEntry;
                ULONG               ServiceRoutine;
                ULONG               ServiceContext;
                KSPIN_LOCK          SpinLock;
                ULONG               TickCount;
                PKSPIN_LOCK         ActualLock;
                PVOID               DispatchAddress;
                ULONG         Vector;
                KIRQL               Irql;
                KIRQL               SynchronizeIrql;
                BOOLEAN             FloatingSave;
                BOOLEAN             Connected;
                CHAR                Number;
                UCHAR                ShareVector;
                KINTERRUPT_MODE     Mode;
                ULONG               ServiceCount;
                ULONG               DispatchCount;
                ULONG               DispatchCode[106];
            } KINTERRUPT, *PKINTERRUPT;

            有了函數地址大家就自己發揮了啊!什么模擬按鍵,讀取端口。

            還可以接著找鼠標的函數了,那就方便了啊

            posted on 2009-06-18 13:59 tqsheng 閱讀(299) 評論(0)  編輯 收藏 引用

            久久人人爽人人爽人人片AV高清 | 亚洲国产精品成人久久| 亚洲精品综合久久| 久久无码人妻一区二区三区午夜| 亚洲精品无码久久千人斩| 久久精品亚洲中文字幕无码麻豆 | 91精品国产高清久久久久久91 | 久久久久久a亚洲欧洲aⅴ| 久久99亚洲综合精品首页| 久久精品极品盛宴观看| 久久99国产精一区二区三区| 欧美激情精品久久久久久| 99久久er这里只有精品18| 精品久久人人爽天天玩人人妻| 久久久久亚洲AV无码专区首JN| 国产精品久久久久久| 伊人久久久AV老熟妇色| 久久本道久久综合伊人| 亚洲午夜久久久影院| 久久久精品日本一区二区三区| 精品久久久久久亚洲精品| 亚洲人成网站999久久久综合| 91久久精品国产成人久久| 久久午夜无码鲁丝片| 久久人人爽人人爽人人av东京热| 99久久无码一区人妻| 欧美日韩中文字幕久久伊人| 精品国产VA久久久久久久冰| 一本色道久久综合狠狠躁| 久久久一本精品99久久精品88| 久久99精品国产麻豆不卡| 99久久精品无码一区二区毛片| 99re久久精品国产首页2020| 精品久久久久久无码专区不卡| 色综合久久无码五十路人妻| 女人高潮久久久叫人喷水| 国产精品久久久久久久久软件| 免费一级做a爰片久久毛片潮| 久久综合九色综合久99| 伊人久久成人成综合网222| 久久无码国产专区精品|