Function at 0x14038ca40
Capabilities:
Terminate thread

Disassembly:
jmp 0x14038ca40
push r14
push rsi
push rdi
push rbx
sub rsp, 0x68
mov edi, edx
mov ebx, ecx
mov rax, qword [0x14056a550]
xor rax, rsp
mov qword [rsp + 0x60], rax
lea rcx, [0x140704458]
call qword [sym.imp.KERNEL32.dll_EnterCriticalSection]
lea eax, [rbx + 6]
cmp ebx, 0xfffffffa
cmovl eax, ebx
and eax, 0x7f
lea r14, [0x1407044a0]
mov rsi, qword [r14 + rax*8]
test rsi, rsi
je 0x14038ca9e
nop word cs:[rax + rax]
cmp dword [rsi + 0x40], ebx
je 0x14038cad7
mov rsi, qword [rsi + 0x38]
test rsi, rsi
jne 0x14038ca90
mov esi, dword [0x1407048a0]
test esi, esi
je 0x14038cb20
call qword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
cmp esi, eax
je 0x14038cb20
lea rsi, [0x140704458]
mov rcx, qword [rsp + 0x60]
xor rcx, rsp
call fcn.140003706
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_ExitThread]
mov rcx, qword [rsi + 0x30]
test rcx, rcx
je 0x14038cb20
add rcx, 0x30
call qword [sym.imp.KERNEL32.dll_EnterCriticalSection]
test edi, edi
je 0x14038cbb9
test byte [rsi + 0x291], 0x18
jne 0x14038cba8
mov edx, dword [rsi + 0x40]
lea ecx, [rdx + 6]
cmp edx, 0xfffffffa
cmovl ecx, edx
and ecx, 0x7f
mov rax, qword [r14 + rcx*8]
cmp dword [rax + 0x40], edx
jne 0x14038cb46
lea rcx, [r14 + rcx*8]
jmp 0x14038cba1
lea rcx, [0x140704458]
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov rcx, qword [rsp + 0x60]
xor rcx, rsp
call fcn.140003706
xor eax, eax
add rsp, 0x68
pop rbx
pop rdi
pop rsi
pop r14
ret
mov rcx, qword [rax + 0x38]
cmp dword [rcx + 0x40], edx
je 0x14038cb94
mov rax, qword [rcx + 0x38]
cmp dword [rax + 0x40], edx
je 0x14038cb8e
mov rcx, qword [rax + 0x38]
cmp dword [rcx + 0x40], edx
je 0x14038cb94
mov rax, qword [rcx + 0x38]
cmp dword [rax + 0x40], edx
je 0x14038cb8e
mov rcx, qword [rax + 0x38]
cmp dword [rcx + 0x40], edx
je 0x14038cb94
mov rax, qword [rcx + 0x38]
cmp dword [rax + 0x40], edx
je 0x14038cb8e
mov rcx, qword [rax + 0x38]
cmp dword [rcx + 0x40], edx
je 0x14038cb94
mov rax, qword [rcx + 0x38]
cmp dword [rax + 0x40], edx
jne 0x14038cb46
add rcx, 0x38
jmp 0x14038cba1
mov rdx, rax
add rdx, 0x38
mov rax, rcx
mov rcx, rdx
mov rax, qword [rax + 0x38]
mov qword [rcx], rax
cmp edi, 2
jne 0x14038cbb9
call qword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov dword [0x1407048a0], eax
lea rcx, [0x140704458]
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov rax, qword [rsi + 0xd8]
mov qword [rsi + 0xd8], 0
test rax, rax
je 0x14038cbe5
mov qword [rax + 8], 0
test edi, edi
je 0x14038cc52
mov rcx, qword [rsi + 0x30]
mov rax, qword [rcx + 0x50]
mov qword [rsp + 0x50], rax
movups xmm0, xmmword [rcx + 0x30]
movups xmm1, xmmword [rcx + 0x40]
movaps xmmword [rsp + 0x40], xmm1
movaps xmmword [rsp + 0x30], xmm0
mov rax, qword [rcx + 0x60]
cmp edi, 1
jne 0x14038cd04
test rax, rax
je 0x14038cdb4
add rcx, 0x60
mov rdi, qword [sym.imp.KERNEL32.dll_SetEvent]
nop dword [rax]
mov rdx, qword [rax]
mov qword [rcx], rdx
mov rcx, qword [rax + 0x18]
call rdi
mov rcx, qword [rsi + 0x30]
mov rax, qword [rcx + 0x60]
add rcx, 0x60
test rax, rax
jne 0x14038cc30
jmp 0x14038cdb4
mov rax, qword [rsi + 0x30]
mov dword [rax + 0x18], 0
mov ecx, dword [rsi + 0x298]
test ecx, 0x1000000
jne 0x14038ce2b
test ecx, 0x2000000
jne 0x14038ce65
test ecx, 0x4000000
jne 0x14038ce8a
test ecx, 0x8000000
jne 0x14038ceaf
test ecx, 0x10000000
jne 0x14038cee9
test ecx, 0x20000000
je 0x14038ccc0
movzx edx, byte [rsi + 0x28c]
mov byte [rsi + 0x28b], dl
and ecx, 0xdfffffff
mov dword [rsi + 0x298], ecx
mov rcx, qword [rax + 0x10]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rcx, qword [rsi + 0x30]
mov eax, dword [rcx + 0x74]
mov edx, eax
and edx, 0xfffffffe
mov dword [rcx + 0x74], edx
test al, 2
jne 0x14038cb2d
mov rax, qword [rcx + 0x60]
test rax, rax
je 0x14038cf13
mov rdx, qword [rax]
mov qword [rcx + 0x60], rdx
mov rcx, qword [rax + 0x18]
call qword [sym.imp.KERNEL32.dll_SetEvent]
jmp 0x14038cb2d
test rax, rax
je 0x14038cd1e
mov edx, 1
call fcn.14049f2f0
mov rcx, qword [rsi + 0x30]
cmp qword [rcx + 0x60], 0
jne 0x14038cd09
cmp qword [rcx + 8], 0
jle 0x14038cd6e
xor edi, edi
mov rbx, qword [sym.imp.KERNEL32.dll_SetEvent]
xor r14d, r14d
jmp 0x14038cd4d
inc r14
add rdi, 0x28
cmp qword [rcx + 8], r14
jle 0x14038cd6e
mov rax, qword [rcx]
test byte [rax + rdi + 0x20], 4
je 0x14038cd40
mov rcx, qword [rax + rdi + 8]
mov dword [rcx], 1
mov rcx, qword [rax + rdi]
call rbx
mov rcx, qword [rsi + 0x30]
jmp 0x14038cd40
mov edi, dword [rcx + 0x18]
test edi, edi
je 0x14038cdb4
call qword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
cmp edi, eax
je 0x14038cdb4
mov rax, qword [rsi + 0x30]
cmp qword [rax + 0x10], 0
je 0x14038cdb4
mov rcx, qword [rax + 0x10]
mov qword [rsp + 0x20], rcx
mov rax, qword [rax + 0x18]
mov qword [rsp + 0x28], rax
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 rax, qword [rsi + 0x30]
mov rcx, qword [rax]
call fcn.140001b0e
mov rcx, qword [rsi + 0x30]
call fcn.140001b0e
test byte [rsi + 0x291], 0x18
je 0x14038ce07
mov edi, dword [rsi + 0x1e0]
mov r8d, 0x2a8
mov rcx, rsi
xor edx, edx
call fcn.1400020b8
mov dword [rsi + 0x290], 0x800
mov dword [rsi + 0x298], 0x40000
mov dword [rsi + 0x1e0], edi
mov dword [rsi + 0x40], edi
jmp 0x14038ce0f
mov rcx, rsi
call fcn.140001b0e
lea rsi, [rsp + 0x30]
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
jmp 0x14038cb2d
mov edx, dword [rsi + 0x290]
mov r8d, edx
shr r8d, 1
and r8d, 0x20000000
and edx, 0xdfffffff
or edx, r8d
mov dword [rsi + 0x290], edx
and ecx, 0xfeffffff
mov dword [rsi + 0x298], ecx
test ecx, 0x2000000
je 0x14038cc7b
movzx edx, byte [rsi + 0x28a]
mov byte [rsi + 0x289], dl
and ecx, 0xfdffffff
mov dword [rsi + 0x298], ecx
test ecx, 0x4000000
je 0x14038cc87
movzx edx, byte [rsi + 0x282]
mov byte [rsi + 0x281], dl
and ecx, 0xfbffffff
mov dword [rsi + 0x298], ecx
test ecx, 0x8000000
je 0x14038cc93
mov edx, dword [rsi + 0x294]
mov r8d, edx
shr r8d, 1
and r8d, 0x20000
and edx, 0xfffdffff
or edx, r8d
mov dword [rsi + 0x294], edx
and ecx, 0xf7ffffff
mov dword [rsi + 0x298], ecx
test ecx, 0x10000000
je 0x14038cc9f
movzx edx, byte [rsi + 0x288]
mov byte [rsi + 0x287], dl
and ecx, 0xefffffff
mov dword [rsi + 0x298], ecx
test ecx, 0x20000000
jne 0x14038cca7
jmp 0x14038ccc0
add rcx, 0x30
jmp 0x14038cb27