内核程序中的KeTickCount

在逆向的时候发现有KeTickCount,它其实是应该调用KeQueryTickCount时产生的。

KeQueryTickCount其实是个宏

#define KeQueryTickCount(CurrentCount ) { \
    volatile PKSYSTEM_TIME _TickCount = *((PKSYSTEM_TIME *)(&KeTickCount)); \
    while (TRUE) {                                                          \
        (CurrentCount)->HighPart = _TickCount->High1Time;                   \
        (CurrentCount)->LowPart = _TickCount->LowPart;                      \
        if ((CurrentCount)->HighPart == _TickCount->High2Time) break;       \
        _asm { rep nop }                                                    \
    }                                                                       \
}
posted @ 2009-07-13 15:33  Fan Zhang  阅读(1592)  评论(0编辑  收藏  举报