Function at 0x140033130
Capabilities:
Hijack thread execution
Resume thread
Suspend thread

Disassembly:
push r13
push r12
push rsi
push rbx
sub rsp, 0x4f8
mov rsi, rcx
test rcx, rcx
je 0x14003301e
lea r12, [0x14027b208]
mov rcx, r12
call fcn.14002ff60
mov rcx, rsi
call fcn.140031380
mov rcx, r12
mov rbx, rax
call fcn.140030280
test rbx, rbx
je 0x14003301e
mov rcx, qword [rbx + 0x28]
lea rax, [rcx - 1]
cmp rax, 0xfffffffffffffffd
ja 0x14003301e
lea r12, [rsp + 0x20]
mov rdx, r12
call qword [sym.imp.KERNEL32.dll_GetHandleInformation]
test eax, eax
je 0x14003301e
lea r13, [rbx + 0x38]
mov rcx, r13
call fcn.14002ff60
call fcn.140031ee0
test rax, rax
je 0x140032fbb
cmp rsi, qword [rax + 0x1d8]
je 0x140033038
mov edx, dword [rbx + 0x44]
movzx eax, byte [rbx + 0x40]
and edx, 3
cmp edx, 3
je 0x140033090
test al, 3
jne 0x140033010
and eax, 0xfffffffc
or eax, 1
mov byte [rbx + 0x40], al
lock add dword [0x1403f79c8], 1
mov rcx, qword [rbx + 0x30]
test rcx, rcx
je 0x140032ff2
call qword [sym.imp.KERNEL32.dll_SetEvent]
mov rcx, r13
call fcn.140030280
xor eax, eax
add rsp, 0x4f8
pop rbx
pop rsi
pop r12
pop r13
ret
mov rcx, r13
call fcn.140030280
test byte [rbx + 0x40], 0xc
je 0x140032ffa
mov eax, 3
add rsp, 0x4f8
pop rbx
pop rsi
pop r12
pop r13
ret
movzx eax, byte [rbx + 0x40]
test al, 3
jne 0x140033010
and eax, 0xfffffffc
or eax, 1
mov byte [rbx + 0x40], al
lock add dword [0x1403f79c8], 1
mov rcx, qword [rbx + 0x30]
test rcx, rcx
je 0x140033060
call qword [sym.imp.KERNEL32.dll_SetEvent]
mov eax, dword [rbx + 0x44]
mov edx, eax
and edx, 3
cmp edx, 3
jne 0x140032ff2
and eax, 0xfffffffe
mov rcx, r13
mov dword [rbx + 0x44], eax
movzx eax, byte [rbx + 0x40]
and eax, 0xfffffff3
or eax, 4
mov byte [rbx + 0x40], al
call fcn.140030280
call fcn.140032c90
nop dword [rax]
test al, 0xc
jne 0x140033010
test al, 0xf
jne 0x14003301e
mov rcx, qword [rbx + 0x28]
mov dword [rsp + 0x50], 0x100001
call qword [sym.imp.KERNEL32.dll_SuspendThread]
xor edx, edx
mov rcx, qword [rbx + 0x28]
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
cmp eax, 0x102
jne 0x140032ff2
mov rcx, qword [rbx + 0x28]
mov rdx, r12
call qword [sym.imp.KERNEL32.dll_GetThreadContext]
lea rax, [fcn.140032c90]
mov rcx, qword [rbx + 0x28]
mov rdx, r12
mov qword [rsp + 0x118], rax
call qword [sym.imp.KERNEL32.dll_SetThreadContext]
movzx eax, byte [rbx + 0x40]
and dword [rbx + 0x44], 0xfffffffe
and eax, 0xfffffff0
or eax, 5
mov byte [rbx + 0x40], al
lock add dword [0x1403f79c8], 1
mov rcx, qword [rbx + 0x30]
test rcx, rcx
je 0x140033116
call qword [sym.imp.KERNEL32.dll_SetEvent]
mov rcx, r13
call fcn.140030280
mov rcx, qword [rbx + 0x28]
call qword [sym.imp.KERNEL32.dll_ResumeThread]
jmp 0x140032ff2
push r13
push r12
push rbx
sub rsp, 0x20
lea r13, [0x14027b208]
mov r12, rcx
mov rcx, r13
mov ebx, edx
call fcn.14002ff60
mov rcx, r12
call fcn.140031380
test rax, rax
je 0x1400331b0
cmp qword [rax + 0x1d8], r12
jne 0x1400331b0
test byte [rax + 0x40], 0xc
jne 0x1400331b0
mov edx, dword [rax + 0xbc]
test edx, edx
jne 0x1400331b0
mov rax, qword [rax + 0x28]
sub rax, 1
cmp rax, 0xfffffffffffffffd
ja 0x1400331b0
mov rcx, r13
call fcn.140030280
test ebx, ebx
je 0x1400331d0
lea edx, [rbx - 2]
cmp edx, 0x15
ja 0x1400331d8
mov rcx, r12
add rsp, 0x20
pop rbx
pop r12
pop r13
jmp 0x140032f30
mov rcx, r13
call fcn.140030280
mov eax, 3
add rsp, 0x20
pop rbx
pop r12
pop r13
ret
xor eax, eax
jmp 0x1400331bd
mov eax, 0x16
jmp 0x1400331bd