Function at 0x1400022e0
Capabilities:
Check for foreground window switch
Check for time delay via gettickcount

Disassembly:
push rsi
push rdi
push r12
push r13
push r15
sub rsp, 0x860
mov rax, qword [section..data]
xor rax, rsp
mov qword [rsp + 0x840], rax
xor r13d, r13d
lea rax, str.Windows.UI.Core.CoreWindow
mov r12, r9
mov r15, r8
mov rsi, rdx
mov edi, r13d
test rax, rax
je 0x14000254a
mov qword [rsp + 0x858], rbp
call qword [sym.imp.KERNEL32.dll_GetTickCount]
mov ebp, eax
call qword [sym.imp.KERNEL32.dll_GetTickCount]
sub eax, ebp
cmp eax, 0x1388
jae 0x140002540
mov qword [rsp + 0x890], rbx
mov qword [rsp + 0x850], r14
mov r14d, dword [rsp + 0x8b0]
nop dword [rax]
xor edx, edx
lea rcx, [rsp + 0x40]
mov r8d, 0x800
call fcn.140006860
lea rax, [rsp + 0x40]
test rax, rax
je 0x1400023cf
call qword [sym.imp.USER32.dll_GetForegroundWindow]
xor ecx, ecx
mov rbx, rax
call qword [sym.imp.KERNEL32.dll_SetLastError]
test rbx, rbx
je 0x1400023cf
mov r8d, 0x400
lea rdx, [rsp + 0x40]
mov rcx, rbx
call qword [sym.imp.USER32.dll_GetClassNameW]
test eax, eax
jne 0x1400023b4
call qword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x1400023cf
lea rdx, str.Windows.UI.Core.CoreWindow
lea rcx, [rsp + 0x40]
call qword [sym.imp.SHLWAPI.dll_StrCmpW]
mov ebx, 1
test eax, eax
je 0x1400023d2
mov ebx, r13d
call qword [sym.imp.USER32.dll_GetForegroundWindow]
lea rdx, [rsp + 0x30]
mov dword [rsp + 0x30], r13d
mov rcx, rax
mov rdi, rax
call qword [sym.imp.USER32.dll_GetWindowThreadProcessId]
test ebx, ebx
je 0x14000257f
cmp dword [rsp + 0x30], r14d
jne 0x14000257f
mov r8, rdi
mov rdx, r12
mov rcx, r15
call fcn.140002180
test rax, rax
mov qword [rsi], rax
mov edi, r13d
mov rcx, rax
setne dil
test edi, edi
je 0x140002578
mov dword [rsp + 0x34], r13d
lea rdx, [rsp + 0x34]
mov dword [rsp + 0x38], r13d
mov qword [rsp + 0x28], r13
mov rax, qword [rax]
call qword [rax + 0xe0]
test eax, eax
js 0x14000256a
mov rcx, qword [rsi]
lea rdx, [rsp + 0x38]
mov rax, qword [rcx]
call qword [rax + 0xd8]
test eax, eax
js 0x14000256a
mov edi, 1
cmp dword [rsp + 0x34], r13d
je 0x14000256d
cmp dword [rsp + 0x38], r13d
je 0x14000256d
mov rcx, qword [rsi]
lea r8, [rsp + 0x28]
mov edx, 0x271f
mov rax, qword [rcx]
call qword [rax + 0x80]
test eax, eax
mov edi, r13d
setns dil
test edi, edi
je 0x1400024db
mov rcx, qword [rsp + 0x28]
lea rdx, [rsp + 0x3c]
mov rax, qword [rcx]
call qword [rax + 0x20]
test eax, eax
mov edi, r13d
setns dil
test edi, edi
je 0x1400024cb
cmp dword [rsp + 0x3c], 1
ja 0x140002582
mov rcx, qword [rsp + 0x28]
test rcx, rcx
je 0x1400024db
mov rax, qword [rcx]
call qword [rax + 0x10]
mov dword [rsp + 0x20], r13d
call qword [sym.imp.USER32.dll_GetForegroundWindow]
mov rcx, rax
lea rdx, [rsp + 0x20]
mov rbx, rax
call qword [sym.imp.USER32.dll_GetWindowThreadProcessId]
test rbx, rbx
je 0x140002530
mov r8d, dword [rsp + 0x20]
test r8d, r8d
je 0x140002530
xor edx, edx
mov ecx, 0x100000
call qword [sym.imp.KERNEL32.dll_OpenProcess]
mov rbx, rax
test rax, rax
je 0x140002530
or edx, 0xffffffff
mov rcx, rax
call qword [sym.imp.USER32.dll_WaitForInputIdle]
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rbx, qword [rsp + 0x890]
mov r14, qword [rsp + 0x850]
mov rbp, qword [rsp + 0x858]
mov eax, edi
mov rcx, qword [rsp + 0x840]
xor rcx, rsp
call fcn.140005570
add rsp, 0x860
pop r15
pop r13
pop r12
pop rdi
pop rsi
ret
mov edi, r13d
mov rcx, qword [rsi]
mov rax, qword [rcx]
call qword [rax + 0x10]
jmp 0x140002582
test rax, rax
je 0x140002530
jmp 0x140002582
mov edi, r13d
mov ecx, 0xa
call qword [sym.imp.KERNEL32.dll_Sleep]
call qword [sym.imp.KERNEL32.dll_GetTickCount]
sub eax, ebp
cmp eax, 0x1388
jb 0x140002360
jmp 0x140002530