Function at 0x140065c42
Capabilities:
Terminate thread

Disassembly:
push r12
push r13
push r14
push r15
push rbp
sub rsp, 0x190
mov ebp, edx
mov r15d, r9d
mov r12d, r8d
mov r13, rcx
cmp ebp, 0xfffffffd
je 0x1400656a5
cmp ebp, 0xfffffffe
je 0x1400656a5
mov rcx, qword [r13 + 0x30]
add rcx, 0x30
call qword [sym.imp.KERNEL32.dll_EnterCriticalSection]
test ebp, ebp
jl 0x1400656a5
mov rax, qword [r13 + 0x30]
movsxd rbp, ebp
mov rdx, qword [rax]
lea rcx, [rbp + rbp*4]
test byte [rdx + rcx*8 + 0x20], 4
je 0x1400656a5
mov r8d, 1
jmp 0x1400656a8
xor r8d, r8d
mov rcx, qword [r13 + 0xb8]
lea rdx, [rsp + 0x58]
mov r14d, dword [r13 + 0x1b0]
test cl, 3
je 0x1400656d3
mov al, byte [rcx]
inc rcx
test al, al
mov byte [rdx], al
je 0x1400656d8
inc rdx
test cl, 3
jne 0x1400656c0
call fcn.14009efc0
cmp r15d, 0xfffffffe
je 0x140065d1b
cmp r15d, 0x10c
je 0x140065d1b
cmp r15d, 0x2f6
je 0x140065d1b
cmp r15d, 0xffffffff
je 0x140065870
cmp r15d, 0x18
je 0x140065870
cmp r15d, 0x1b
je 0x140065870
cmp r15d, 0x265
je 0x140065870
cmp r15d, 0x3f
jne 0x1400657d1
test r8d, r8d
jne 0x140065744
test byte [r13 + 0x24b], 8
je 0x140065960
mov eax, dword [rsp + 0x1e0]
test eax, eax
mov edx, eax
mov rcx, qword [r13 + 0x198]
cmovne r15d, edx
test rcx, rcx
je 0x14006592f
mov edx, 2
mov r8d, r14d
mov ecx, dword [rsp + 0x1e0]
lea r9, [rsp + 0x58]
call fcn.140068074
mov r9, rax
mov rdx, r9
mov rcx, rdx
and rdx, 0xfffffffffffffff0
pxor xmm0, xmm0
pcmpeqb xmm0, xmmword [rdx]
pmovmskb eax, xmm0
and ecx, 0xf
shr eax, cl
bsf eax, eax
jne 0x1400657aa
mov rax, rdx
add rdx, rcx
call fcn.14009ef90
movsxd r12, eax
mov r8, qword [r13 + 0x198]
cmp r12, r8
jb 0x1400658ff
mov rdx, r9
mov rcx, qword [r13 + 0x100]
call fcn.14009ef60
jmp 0x14006592f
test r8d, r8d
jne 0x1400657e3
test r12d, 9
je 0x140065960
mov eax, dword [rsp + 0x1e0]
test eax, eax
mov edx, eax
mov rcx, qword [r13 + 0x198]
cmovne r15d, edx
test rcx, rcx
je 0x14006592f
mov edx, 2
mov r8d, r14d
mov ecx, dword [rsp + 0x1e0]
lea r9, [rsp + 0x58]
call fcn.140068074
mov r9, rax
mov rdx, r9
mov rcx, rdx
and rdx, 0xfffffffffffffff0
pxor xmm0, xmm0
pcmpeqb xmm0, xmmword [rdx]
pmovmskb eax, xmm0
and ecx, 0xf
shr eax, cl
bsf eax, eax
jne 0x140065849
mov rax, rdx
add rdx, rcx
call fcn.14009ef90
movsxd r12, eax
mov r8, qword [r13 + 0x198]
cmp r12, r8
jb 0x1400658ff
mov rdx, r9
mov rcx, qword [r13 + 0x100]
call fcn.14009ef60
jmp 0x14006592f
test r8d, r8d
jne 0x140065882
test r12d, 0xa
je 0x140065960
mov rax, qword [r13 + 0x198]
mov r15d, 0xffffffff
test rax, rax
je 0x14006592f
mov edx, 2
mov r8d, r14d
mov ecx, dword [rsp + 0x1e0]
lea r9, [rsp + 0x58]
call fcn.140068074
mov r9, rax
mov rdx, r9
mov rcx, rdx
and rdx, 0xfffffffffffffff0
pxor xmm0, xmm0
pcmpeqb xmm0, xmmword [rdx]
pmovmskb eax, xmm0
and ecx, 0xf
shr eax, cl
bsf eax, eax
jne 0x1400658df
mov rax, rdx
add rdx, rcx
call fcn.14009ef90
movsxd r12, eax
mov r8, qword [r13 + 0x198]
cmp r12, r8
jb 0x1400658ff
mov rdx, r9
mov rcx, qword [r13 + 0x100]
call fcn.14009ef60
jmp 0x14006592f
mov rdx, r9
mov r8, r12
mov rcx, qword [r13 + 0x100]
call fcn.14009ef60
mov rcx, qword [r13 + 0x100]
mov edx, reloc.LMGR10.dll_Ordinal_32
mov r8, qword [r13 + 0x198]
add rcx, r12
sub r8, r12
call fcn.14009ef10
cmp ebp, 0xfffffffe
je 0x140065a50
cmp ebp, 0xfffffffd
je 0x140065a3c
mov rcx, qword [r13 + 0x30]
add rcx, 0x30
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov ecx, dword [r13 + 0x1b0]
call fcn.140060f70
jmp 0x140065a3c
movabs r12, 0
mov qword [rsp + 0x168], r12
mov qword [rsp + 0x170], r12
mov qword [rsp + 0x178], r12
mov rax, qword [r13 + 0x198]
mov rdx, qword [r13 + 0x100]
mov rcx, qword [r13 + 0x30]
add rcx, 0x30
mov qword [0x1400ec870], rax
mov qword [0x1400ec868], rdx
or byte [r13 + 0x249], 0x80
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov rdx, r13
lea rcx, [rsp + 0x168]
call fcn.140072580
lea rcx, [0x1400ec5e8]
call qword [sym.imp.KERNEL32.dll_EnterCriticalSection]
cmp r14d, 0xfffffffa
lea eax, [r14 + 5]
lea rdx, [0x140000000]
cmovle eax, r14d
and eax, 0x7f
mov rbp, qword [rdx + rax*8 + 0x12ca480]
test rbp, rbp
je 0x140065a03
cmp r14d, dword [rbp + 0x40]
je 0x140065a75
mov rbp, qword [rbp + 0x38]
test rbp, rbp
jne 0x1400659f4
cmp dword [0x1400ec620], 0
je 0x140065a1a
call qword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
cmp eax, dword [0x1400ec620]
jne 0x140065a60
lea rcx, [0x1400ec5e8]
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov ecx, r15d
mov edx, 2
mov r8d, r14d
lea r9, [rsp + 0x58]
call fcn.14006765c
mov eax, r15d
add rsp, 0x190
pop rbp
pop r15
pop r14
pop r13
pop r12
ret
mov rcx, qword [r13 + 0x30]
add rcx, 0x30
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
jmp 0x140065a3c
lea rcx, [0x1400ec5e8]
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_ExitThread]
mov rcx, qword [rbp + 0x30]
test rcx, rcx
je 0x140065a1a
add rcx, 0x30
call qword [sym.imp.KERNEL32.dll_EnterCriticalSection]
test byte [rbp + 0x245], 0x18
jne 0x140065b1d
mov eax, dword [rbp + 0x40]
cmp eax, 0xfffffffa
lea rcx, [0x140000000]
lea edx, [rax + 5]
cmovle edx, eax
and edx, 0x7f
mov r8, qword [rcx + rdx*8 + 0x12ca480]
cmp eax, dword [r8 + 0x40]
jne 0x140065ae5
cmp eax, 0xfffffffa
lea edx, [rax + 5]
lea rcx, [0x140000000]
cmovg eax, edx
mov r10, rcx
and eax, 0x7f
mov r8, qword [rcx + rax*8 + 0x12ca480]
mov r9, qword [r8 + 0x38]
mov qword [r10 + rax*8 + 0x12ca480], r9
jmp 0x140065b1d
cmp eax, 0xfffffffa
lea edx, [rax + 5]
lea rcx, [0x140000000]
cmovle edx, eax
and edx, 0x7f
mov rcx, qword [rcx + rdx*8 + 0x12ca480]
mov rdx, qword [rcx + 0x38]
cmp eax, dword [rdx + 0x40]
je 0x140065b15
mov rcx, rdx
mov rdx, qword [rdx + 0x38]
cmp eax, dword [rdx + 0x40]
jne 0x140065b09
mov rax, qword [rdx + 0x38]
mov qword [rcx + 0x38], rax
call qword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
lea rcx, [0x1400ec5e8]
mov dword [0x1400ec620], eax
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov rax, qword [rbp + 0xc0]
test rax, rax
mov qword [rbp + 0xc0], 0
je 0x140065b55
mov qword [rax + 8], 0
mov r9, qword [rbp + 0x30]
mov rax, qword [r9 + 0x30]
mov qword [rsp + 0x30], rax
mov rdx, qword [r9 + 0x38]
mov qword [rsp + 0x38], rdx
mov rcx, qword [r9 + 0x40]
mov qword [rsp + 0x40], rcx
mov r8, qword [r9 + 0x48]
mov qword [rsp + 0x48], r8
mov r10, qword [r9 + 0x50]
mov qword [rsp + 0x50], r10
mov rdx, qword [rbp + 0x30]
mov rax, qword [rdx + 0x60]
test rax, rax
je 0x140065be6
mov rcx, qword [rax]
mov qword [rdx + 0x60], rcx
mov rdx, qword [rax + 8]
test rdx, rdx
je 0x140065bd9
mov rdx, qword [rax + 8]
mov qword [rsp + 0x180], rdx
mov rax, qword [rax + 0x10]
mov qword [rsp + 0x188], rax
mov rcx, qword [rsp + 0x180]
xor edx, edx
call qword [sym.imp.KERNEL32.dll_TerminateThread]
mov rcx, qword [rsp + 0x180]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rdx, qword [rbp + 0x30]
mov rax, qword [rdx + 0x60]
test rax, rax
jne 0x140065b93
xor eax, eax
mov rcx, qword [rdx + 8]
xor r13d, r13d
test rcx, rcx
jle 0x140065c42
mov qword [rsp + 0x160], rdi
mov rdi, rax
mov r8, qword [rdx]
test byte [r13 + r8 + 0x20], 4
je 0x140065c2e
mov rdx, qword [r13 + r8 + 8]
mov dword [rdx], 1
mov r8, qword [rbp + 0x30]
mov r9, qword [r8]
mov rcx, qword [r9 + r13]
call qword [sym.imp.KERNEL32.dll_SetEvent]
mov rdx, qword [rbp + 0x30]
mov rcx, qword [rdx + 8]
inc rdi
add r13, 0x28
cmp rdi, rcx
jl 0x140065bff
mov rdi, qword [rsp + 0x160]
cmp dword [rdx + 0x18], 0
je 0x140065c8e
call qword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov rdx, qword [rbp + 0x30]
cmp eax, dword [rdx + 0x18]
je 0x140065c8e
mov rax, qword [rdx + 0x10]
test rax, rax
je 0x140065c8e
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 [rbp + 0x30]
mov rcx, qword [rdx]
call fcn.1400719c0
mov rcx, qword [rbp + 0x30]
call fcn.1400719c0
test byte [rbp + 0x245], 0x18
je 0x140065cf7
mov edx, dword [rbp + 0x1b0]
mov eax, 0x258
mov qword [rbp + rax - 8], r12
mov qword [rbp + rax - 0x10], r12
mov qword [rbp + rax - 0x18], r12
mov qword [rbp + rax - 0x20], r12
mov qword [rbp + rax - 0x28], r12
sub rax, 0x28
jne 0x140065cb3
movzx eax, byte [rbp + 0x245]
and eax, 0xffffffe7
or eax, 8
or byte [rbp + 0x24e], 4
mov byte [rbp + 0x245], al
mov dword [rbp + 0x1b0], edx
mov dword [rbp + 0x40], edx
jmp 0x140065cff
mov rcx, rbp
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]
nop
jmp 0x140065a27
test r8d, r8d
jne 0x140065d2d
test r12d, 0xc
je 0x140065960
mov rax, qword [r13 + 0x198]
mov r15d, 0xfffffffe
test rax, rax
je 0x14006592f
mov edx, 2
mov r8d, r14d
mov ecx, dword [rsp + 0x1e0]
lea r9, [rsp + 0x58]
call fcn.140068074
mov r9, rax
mov rdx, r9
mov rcx, rdx
and rdx, 0xfffffffffffffff0
pxor xmm0, xmm0
pcmpeqb xmm0, xmmword [rdx]
pmovmskb eax, xmm0
and ecx, 0xf
shr eax, cl
bsf eax, eax
jne 0x140065d8a
mov rax, rdx
add rdx, rcx
call fcn.14009ef90
movsxd r12, eax
mov r8, qword [r13 + 0x198]
cmp r12, r8
jb 0x1400658ff
mov rdx, r9
mov rcx, qword [r13 + 0x100]
call fcn.14009ef60
nop
jmp 0x14006592f