首页
社区
课程
招聘
[求助]WIN7 KTHREAD Alertable状态的问题
2014-6-3 20:40 5575

[求助]WIN7 KTHREAD Alertable状态的问题

2014-6-3 20:40
5575
这几天一直在研究EPROCESS KPROCESS ETHREAD KTHREAD 这几个结构。我就是对KTHREAD Alertable这个结构比较疑惑。

在windows xp中,Alertable是一个char的值,比较好判断。
但是在windows 7中,Alertable是一个位,第五位的样子

kd> dt nt!_KTHREAD
   +0x000 Header           : _DISPATCHER_HEADER
   +0x010 CycleTime        : Uint8B
   +0x018 HighCycleTime    : Uint4B
   +0x020 QuantumTarget    : Uint8B
   +0x028 InitialStack     : Ptr32 Void
   +0x02c StackLimit       : Ptr32 Void
   +0x030 KernelStack      : Ptr32 Void
   +0x034 ThreadLock       : Uint4B
   +0x038 WaitRegister     : _KWAIT_STATUS_REGISTER
   +0x039 Running          : UChar
   +0x03a Alerted          : [2] UChar
   +0x03c KernelStackResident : Pos 0, 1 Bit
   +0x03c ReadyTransition  : Pos 1, 1 Bit
   +0x03c ProcessReadyQueue : Pos 2, 1 Bit
   +0x03c WaitNext         : Pos 3, 1 Bit
   +0x03c SystemAffinityActive : Pos 4, 1 Bit
   +0x03c Alertable        : Pos 5, 1 Bit
   +0x03c GdiFlushActive   : Pos 6, 1 Bit
   +0x03c UserStackWalkActive : Pos 7, 1 Bit
   +0x03c ApcInterruptRequest : Pos 8, 1 Bit
   +0x03c ForceDeferSchedule : Pos 9, 1 Bit
   +0x03c QuantumEndMigrate : Pos 10, 1 Bit
   +0x03c UmsDirectedSwitchEnable : Pos 11, 1 Bit
   +0x03c TimerActive      : Pos 12, 1 Bit
   +0x03c SystemThread     : Pos 13, 1 Bit
   +0x03c Reserved         : Pos 14, 18 Bits

我在遍历进程的时候发现无论如何0x03c这个便宜都是等于CC的,二进制的话是11001100。请问各位大神有没有什么好的方法能够判断线程是否是Alertable状态。

[培训]《安卓高级研修班(网课)》月薪三万计划,掌 握调试、分析还原ollvm、vmp的方法,定制art虚拟机自动化脱壳的方法

收藏
点赞0
打赏
分享
最新回复 (3)
雪    币: 2072
活跃值: (630)
能力值: ( LV7,RANK:100 )
在线值:
发帖
回帖
粉丝
sidyhe 1 2014-6-3 21:28
2
0
你是想插APC吗?
直接KeAlertThread就可以了
雪    币: 19
活跃值: (100)
能力值: ( LV5,RANK:60 )
在线值:
发帖
回帖
粉丝
曹小杰 1 2014-6-4 08:17
3
0
我在网上看了,资料很少。MSDN上也没有看到相关资料。能否给出相关的资料或者链接?
雪    币: 2072
活跃值: (630)
能力值: ( LV7,RANK:100 )
在线值:
发帖
回帖
粉丝
sidyhe 1 2014-6-4 09:52
4
0
WRK
BOOLEAN
KeAlertThread (
    __inout PKTHREAD Thread,
    __in KPROCESSOR_MODE AlertMode
    )

/*++

Routine Description:

    This function attempts to alert a thread and cause its execution to
    be continued if it is currently in an alertable Wait state. Otherwise
    it just sets the alerted variable for the specified processor mode.

Arguments:

    Thread  - Supplies a pointer to a dispatcher object of type thread.

    AlertMode - Supplies the processor mode for which the thread is
        to be alerted.

Return Value:

    The previous state of the alerted variable for the specified processor
    mode.

--*/
游客
登录 | 注册 方可回帖
返回