• <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 閱讀(294) 評論(0)  編輯 收藏 引用

            成人亚洲欧美久久久久| 久久综合久久综合久久| 久久综合一区二区无码| 亚洲精品第一综合99久久| 一本久道久久综合狠狠爱| 99久久国产热无码精品免费| 久久久久国产一区二区| 久久精品国产亚洲77777| 老司机国内精品久久久久| 久久国产亚洲精品| 老司机国内精品久久久久| 国产香蕉久久精品综合网| 日本道色综合久久影院| 亚洲精品无码久久久久| 久久精品国产一区二区三区| 91精品国产高清91久久久久久| 欧美麻豆久久久久久中文| 久久精品国产亚洲一区二区| 97久久国产综合精品女不卡| 国产午夜精品理论片久久| 国产欧美久久一区二区| 日韩精品久久久肉伦网站| 久久久久久午夜精品| 久久久久久久久久免免费精品| 国产一区二区三区久久精品| 久久亚洲AV成人无码| 亚洲午夜无码AV毛片久久| 色8激情欧美成人久久综合电| 99久久99久久精品国产片| 久久亚洲国产精品一区二区| 无码超乳爆乳中文字幕久久| 久久久精品人妻一区二区三区蜜桃| 久久精品亚洲乱码伦伦中文| a级毛片无码兔费真人久久 | 成人国内精品久久久久影院VR| 亚洲va久久久噜噜噜久久男同 | 99久久精品国产一区二区蜜芽| 久久亚洲AV成人出白浆无码国产 | 岛国搬运www久久| 伊人久久综在合线亚洲2019| 久久精品国产秦先生|