现在的位置: 首页 > 综合 > 正文

内核程序中的KeTickCount

2011年05月26日 ⁄ 综合 ⁄ 共 357字 ⁄ 字号 评论关闭

在逆向的时候发现有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 }                                                    \
    }                                                                       \
}

抱歉!评论已关闭.