UINT_PTR __fastcall NtUserSetTimer(HWND hWnd, UINT_PTR
id
, unsigned
int
elapse, UINT_PTR proc, unsigned
int
unk_flags)
{
UINT_PTR timerId;
/
/
rbx
__int64 v10;
/
/
rax
__int64 CurrentThreadWin32Thread;
/
/
rax
UINT64 window_instance;
/
/
rbp
unsigned
int
_elapse;
/
/
edi
unsigned
int
_unk_flags;
/
/
esi
__int64 CurrentProcessWin32Process;
/
/
rax
__int64 CurrentProcessWin32Process_1;
/
/
r8
__int64 v17;
/
/
rax
__int64 errcode;
/
/
rcx
EnterCrit(
0i64
,
0i64
);
timerId
=
0i64
;
if
( !
*
(_QWORD
*
)(SGDGetUserSessionState()
+
8
)
|| (v10
=
SGDGetUserSessionState(), !ExIsResourceAcquiredSharedLite(
*
(PERESOURCE
*
)(v10
+
8
))) )
{
if
( (gdwExtraInstrumentations &
1
) !
=
0
)
KeBugCheckEx(
0x164u
,
0x2Aui64
,
0i64
,
0i64
,
0i64
);
DbgkWerCaptureLiveKernelDump(aNtuser,
400i64
,
42i64
,
0i64
,
0i64
,
0i64
,
0i64
,
0i64
,
0
);
}
CurrentThreadWin32Thread
=
PsGetCurrentThreadWin32Thread();
+
+
*
(_DWORD
*
)(CurrentThreadWin32Thread
+
48
);
if
( !hWnd )
{
window_instance
=
0i64
;
hwnd_valid:
_elapse
=
10
;
if
( elapse >
=
10
)
/
/
如果间隔小于
10ms
,那就赋值
10
,因为时钟中断
_elapse
=
elapse;
_unk_flags
=
unk_flags;
if
( _elapse >
0x7FFFFFFF
)
_elapse
=
0x7FFFFFFF
;
if
( unk_flags
=
=
0x7FFFFFF5
)
/
/
正常调用是
0
{
_unk_flags
=
0x7FFFFFFF
-
_elapse;
}
else
if
( unk_flags !
=
-
1
&& (_elapse
+
unk_flags < _elapse || _elapse
+
unk_flags >
0x7FFFFFFF
) )
{
errcode
=
87i64
;
goto error;
}
if
( !window_instance )
goto driectly_set;
/
/
hwnd是一 直接设置
CurrentProcessWin32Process
=
PsGetCurrentProcessWin32Process(
0x7FFFFFFFi64
);
CurrentProcessWin32Process_1
=
CurrentProcessWin32Process;
if
( CurrentProcessWin32Process )
CurrentProcessWin32Process_1
=
-
(__int64)(
*
(_QWORD
*
)CurrentProcessWin32Process !
=
0i64
) & CurrentProcessWin32Process;
if
( CurrentProcessWin32Process_1
=
=
*
(_QWORD
*
)(
*
(_QWORD
*
)(window_instance
+
0x10
)
+
0x1A0i64
) )
/
/
不能跨进程设置 tagWND
*
spwndParent;
{
driectly_set:
timerId
=
InternalSetTimer((void
*
)window_instance,
id
, _elapse, (void
*
)proc, _unk_flags,
0
);
goto LABEL_18;
}
errcode
=
5i64
;
error:
UserSetLastError(errcode);
goto LABEL_18;
}
window_instance
=
ValidateHwnd(hWnd);
/
/
把hwnd转换成指针 tagWND
if
( window_instance )
goto hwnd_valid;
LABEL_18:
v17
=
PsGetCurrentThreadWin32Thread();
-
-
*
(_DWORD
*
)(v17
+
48
);
UserSessionSwitchLeaveCrit();
return
timerId;
}