Function at 0x140064640
Capabilities:
Terminate thread

Disassembly:
push r13
push r14
push r15
push rbp
sub rsp, 0x68
mov r15d, ecx
lea rcx, [0x1400ec5e8]
mov r13d, edx
lea rbp, [0x140000000]
call qword [sym.imp.KERNEL32.dll_EnterCriticalSection]
cmp r15d, 0xfffffffa
lea eax, [r15 + 5]
cmovle eax, r15d
and eax, 0x7f
mov r14, qword [rbp + rax*8 + 0x12ca480]
test r14, r14
je 0x140064690
cmp r15d, dword [r14 + 0x40]
je 0x1400646d7
mov r14, qword [r14 + 0x38]
test r14, r14
jne 0x140064681
cmp dword [0x1400ec620], 0
je 0x1400646a7
call qword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
cmp eax, dword [0x1400ec620]
jne 0x1400646c2
lea rcx, [0x1400ec5e8]
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
xor eax, eax
add rsp, 0x68
pop rbp
pop r15
pop r14
pop r13
ret
lea rcx, [0x1400ec5e8]
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_ExitThread]
mov rcx, qword [r14 + 0x30]
test rcx, rcx
je 0x1400646a7
add rcx, 0x30
call qword [sym.imp.KERNEL32.dll_EnterCriticalSection]
test r13d, r13d
je 0x140064777
test byte [r14 + 0x245], 0x18
jne 0x14006476d
mov eax, dword [r14 + 0x40]
cmp eax, 0xfffffffa
lea edx, [rax + 5]
cmovle edx, eax
and edx, 0x7f
mov rcx, qword [rbp + rdx*8 + 0x12ca480]
cmp eax, dword [rcx + 0x40]
jne 0x14006473c
cmp eax, 0xfffffffa
lea edx, [rax + 5]
cmovg eax, edx
and eax, 0x7f
mov rcx, qword [rbp + rax*8 + 0x12ca480]
mov r8, qword [rcx + 0x38]
mov qword [rbp + rax*8 + 0x12ca480], r8
jmp 0x14006476d
cmp eax, 0xfffffffa
lea edx, [rax + 5]
cmovle edx, eax
and edx, 0x7f
mov rcx, qword [rbp + rdx*8 + 0x12ca480]
mov rdx, qword [rcx + 0x38]
cmp eax, dword [rdx + 0x40]
je 0x140064765
mov rcx, rdx
mov rdx, qword [rdx + 0x38]
cmp eax, dword [rdx + 0x40]
jne 0x140064759
mov rax, qword [rdx + 0x38]
mov qword [rcx + 0x38], rax
cmp r13d, 2
je 0x140064a9c
lea rcx, [0x1400ec5e8]
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov rax, qword [r14 + 0xc0]
test rax, rax
mov qword [r14 + 0xc0], 0
je 0x1400647a3
mov qword [rax + 8], 0
test r13d, r13d
je 0x140064968
mov rdx, qword [r14 + 0x30]
cmp r13d, 1
mov rax, qword [rdx + 0x30]
mov rcx, qword [rdx + 0x38]
mov rbp, qword [rdx + 0x40]
mov r8, qword [rdx + 0x48]
mov r9, qword [rdx + 0x50]
mov qword [rsp + 0x30], rax
mov qword [rsp + 0x38], rcx
mov qword [rsp + 0x40], rbp
mov qword [rsp + 0x48], r8
mov qword [rsp + 0x50], r9
mov rax, qword [rdx + 0x60]
je 0x140064aad
test rax, rax
je 0x140064837
mov rcx, qword [rax]
mov qword [rdx + 0x60], rcx
mov rdx, qword [rax + 8]
test rdx, rdx
je 0x14006482a
mov rdx, qword [rax + 8]
mov qword [rsp + 0x58], rdx
mov rax, qword [rax + 0x10]
mov qword [rsp + 0x60], rax
mov rcx, qword [rsp + 0x58]
xor edx, edx
call qword [sym.imp.KERNEL32.dll_TerminateThread]
mov rcx, qword [rsp + 0x58]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rdx, qword [r14 + 0x30]
mov rax, qword [rdx + 0x60]
test rax, rax
jne 0x1400647f0
xor r13d, r13d
mov rax, qword [rdx + 8]
xor ebp, ebp
test rax, rax
jle 0x14006487f
mov rcx, qword [rdx]
test byte [rbp + rcx + 0x20], 4
je 0x140064873
mov rax, qword [rbp + rcx + 8]
mov dword [rax], 1
mov rdx, qword [r14 + 0x30]
mov r8, qword [rdx]
mov rcx, qword [r8 + rbp]
call qword [sym.imp.KERNEL32.dll_SetEvent]
mov rdx, qword [r14 + 0x30]
mov rax, qword [rdx + 8]
inc r13
add rbp, 0x28
cmp r13, rax
jl 0x140064845
cmp dword [rdx + 0x18], 0
je 0x1400648cb
call qword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov rdx, qword [r14 + 0x30]
cmp eax, dword [rdx + 0x18]
je 0x1400648cb
mov rax, qword [rdx + 0x10]
test rax, rax
je 0x1400648cb
mov rax, qword [rdx + 0x10]
mov qword [rsp + 0x20], rax
mov rdx, qword [rdx + 0x18]
mov qword [rsp + 0x28], rdx
mov rcx, qword [rsp + 0x20]
xor edx, edx
call qword [sym.imp.KERNEL32.dll_TerminateThread]
mov rcx, qword [rsp + 0x20]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rdx, qword [r14 + 0x30]
mov rcx, qword [rdx]
call fcn.1400719c0
mov rcx, qword [r14 + 0x30]
call fcn.1400719c0
test byte [r14 + 0x245], 0x18
je 0x140064945
mov ecx, dword [r14 + 0x1b0]
movabs rdx, 0
mov eax, 0x258
mov qword [r14 + rax - 8], rdx
mov qword [r14 + rax - 0x10], rdx
mov qword [r14 + rax - 0x18], rdx
mov qword [r14 + rax - 0x20], rdx
mov qword [r14 + rax - 0x28], rdx
sub rax, 0x28
jne 0x1400648fc
movzx eax, byte [r14 + 0x245]
and eax, 0xffffffe7
or eax, 8
or byte [r14 + 0x24e], 4
mov byte [r14 + 0x245], al
mov dword [r14 + 0x1b0], ecx
mov dword [r14 + 0x40], ecx
jmp 0x14006494d
mov rcx, r14
call fcn.1400719c0
lea rcx, [rsp + 0x30]
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
lea rcx, [rsp + 0x30]
call qword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
jmp 0x1400646b4
mov rax, qword [r14 + 0x30]
mov dword [rax + 0x18], 0
movzx ecx, byte [r14 + 0x24f]
test cl, 1
je 0x1400649a9
movzx eax, byte [r14 + 0x247]
mov edx, eax
shr eax, 6
and edx, 0xffffffdf
and eax, 1
and ecx, 0xfffffffe
shl eax, 5
or edx, eax
mov byte [r14 + 0x247], dl
mov byte [r14 + 0x24f], cl
test cl, 2
je 0x1400649c7
movzx eax, byte [r14 + 0x23e]
and ecx, 0xfffffffd
mov byte [r14 + 0x23d], al
mov byte [r14 + 0x24f], cl
test cl, 4
je 0x1400649e5
movzx eax, byte [r14 + 0x236]
and ecx, 0xfffffffb
mov byte [r14 + 0x235], al
mov byte [r14 + 0x24f], cl
test cl, 8
je 0x140064a12
movzx eax, byte [r14 + 0x24a]
mov edx, eax
shr eax, 2
and edx, 0xfffffffd
and eax, 1
and ecx, 0xfffffff7
add eax, eax
or edx, eax
mov byte [r14 + 0x24a], dl
mov byte [r14 + 0x24f], cl
test cl, 0x10
je 0x140064a30
movzx eax, byte [r14 + 0x23c]
and ecx, 0xffffffef
mov byte [r14 + 0x23b], al
mov byte [r14 + 0x24f], cl
test cl, 0x20
je 0x140064a4e
movzx eax, byte [r14 + 0x240]
and ecx, 0xffffffdf
mov byte [r14 + 0x23f], al
mov byte [r14 + 0x24f], cl
mov rbp, qword [r14 + 0x30]
mov rcx, qword [rbp + 0x10]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
and byte [rbp + 0x74], 0xfe
mov rcx, qword [r14 + 0x30]
test byte [rcx + 0x74], 2
jne 0x1400646b4
mov rdx, qword [rcx + 0x60]
test rdx, rdx
je 0x140064a8d
mov rax, qword [rdx]
mov qword [rcx + 0x60], rax
mov rcx, qword [rdx + 0x18]
call qword [sym.imp.KERNEL32.dll_SetEvent]
jmp 0x1400646b4
add rcx, 0x30
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
jmp 0x1400646b4
call qword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov dword [0x1400ec620], eax
jmp 0x140064777
test rax, rax
je 0x1400648cb
mov rbp, qword [rax]
mov qword [rdx + 0x60], rbp
mov rcx, qword [rax + 0x18]
call qword [sym.imp.KERNEL32.dll_SetEvent]
mov rdx, qword [r14 + 0x30]
mov rax, qword [rdx + 0x60]
test rax, rax
jne 0x140064ab6
jmp 0x1400648cb