Function at 0x5a8330
Capabilities:
Resume thread
Suspend thread

Disassembly:
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x70
mov rbx, qword [0x00644b10]
test rbx, rbx
je 0x5a81b1
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [rbx]
mov esi, eax
call qword [sym.imp.KERNEL32.dll_TlsGetValue]
mov ecx, esi
mov rbx, rax
call qword [sym.imp.KERNEL32.dll_SetLastError]
test rbx, rbx
je 0x5a81b1
mov rbx, qword [rbx + 0x10]
test rbx, rbx
je 0x5a80e3
mov eax, dword [rbx + 0x28]
cmp eax, 3
je 0x5a80f2
add rsp, 0x70
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
ret
mov qword [rsp + 0x68], 0
lea rax, [rbx + 0x38]
lea rsi, [rsp + 0x50]
mov qword [rsp + 0x50], rax
mov qword [rsp + 0x60], 0
mov rdx, rsi
mov qword [rsp + 0x58], 0
xchg qword [rax], rdx
test rdx, rdx
je 0x5a815f
mov qword [rdx + 8], rsi
xor eax, eax
add rdx, 0x18
mov rcx, 0xffffffffffffffff
lock cmpxchg qword [rdx], rcx
test rax, rax
mov rcx, rax
je 0x5a814a
call qword [sym.imp.KERNEL32.dll_SetEvent]
lea rbp, [rsi + 0x10]
xor edi, edi
lock xadd qword [rbp], rdi
test rdi, rdi
je 0x5a8260
cmp dword [rbx + 0x18c], 1
jne 0x5a82f7
mov r8, qword [rsp + 0x50]
lea rcx, [rsi + 8]
xor edx, edx
lock xadd qword [rcx], rdx
test rdx, rdx
mov rcx, rdx
je 0x5a82b0
add rcx, 0x10
xor eax, eax
mov rdx, 0xffffffffffffffff
lock cmpxchg qword [rcx], rdx
test rax, rax
mov rcx, rax
je 0x5a80e3
call qword [sym.imp.KERNEL32.dll_SetEvent]
jmp 0x5a80e3
lea rdi, [rsp + 0x40]
mov rcx, rdi
call fcn.0059e050
mov rsi, qword [rsp + 0x40]
mov r13, qword [rsp + 0x48]
test rsi, rsi
mov rbx, rsi
je 0x5a80e3
or byte [rsi + 0x194], 1
mov dword [rsi + 0x184], 1
call qword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov rbp, qword [sym.imp.KERNEL32.dll_GetCurrentProcess]
mov dword [rsi + 0x198], eax
call rbp
mov r14, rax
call qword [sym.imp.KERNEL32.dll_GetCurrentThread]
mov r12, rax
call rbp
mov dword [rsp + 0x30], 2
mov r8, r14
mov rdx, r12
mov dword [rsp + 0x28], 0
lea r9, [rsi + 8]
mov rcx, rax
mov dword [rsp + 0x20], 0
call qword [sym.imp.KERNEL32.dll_DuplicateHandle]
test eax, eax
je 0x5a8290
mov rcx, qword [rsi + 8]
call qword [sym.imp.KERNEL32.dll_GetThreadPriority]
mov rcx, qword [0x00644b10]
mov rdx, rsi
mov dword [rsi + 0x188], eax
call fcn.005a0630
jmp 0x5a80db
xor r9d, r9d
xor r8d, r8d
xor edx, edx
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_CreateEventA]
mov r12, rax
mov rax, rdi
lock cmpxchg qword [rbp], r12
test rax, rax
je 0x5a82e0
mov rcx, r12
call qword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x5a815f
mov rcx, rdi
mov qword [rsp + 0x40], rsi
mov qword [rsp + 0x48], r13
call fcn.0059deb0
jmp 0x5a80e3
mov rax, rsi
lock cmpxchg qword [r8], rdx
cmp rsi, rax
je 0x5a80e3
lea rcx, [rsi + 0x18]
lock xadd qword [rcx], rdx
test rdx, rdx
je 0x5a82f0
add rsi, 8
xor ecx, ecx
lock xadd qword [rsi], rcx
jmp 0x5a8188
mov edx, 0xffffffff
mov rcx, r12
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
jmp 0x5a8281
call fcn.0059c6a0
jmp 0x5a82cf
mov rcx, qword [rbx + 0x40]
call qword [sym.imp.KERNEL32.dll_ResetEvent]
mov rcx, rsi
mov dword [rbx + 0x28], 4
mov dword [rbx + 0x18c], 1
call fcn.0059c6f0
mov ecx, 2
call fcn.005a7950
nop
nop word cs:[rax + rax]
push r15
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x68
lea rax, [0x00644ad8]
mov rsi, qword [rcx]
mov rdi, qword [rcx + 8]
lea rbx, [rsp + 0x40]
mov qword [rsp + 0x40], rax
mov qword [rsp + 0x58], 0
mov rcx, rbx
mov qword [rsp + 0x50], 0
mov qword [rsp + 0x48], 0
xchg qword [rax], rcx
test rcx, rcx
je 0x5a83b7
mov qword [rcx + 8], rbx
lea rdx, [rcx + 0x18]
xor eax, eax
mov rcx, 0xffffffffffffffff
lock cmpxchg qword [rdx], rcx
test rax, rax
mov rcx, rax
je 0x5a83a2
call qword [sym.imp.KERNEL32.dll_SetEvent]
lea r12, [rbx + 0x10]
xor ebp, ebp
lock xadd qword [r12], rbp
test rbp, rbp
je 0x5a8594
test rsi, rsi
mov ebp, 3
je 0x5a83ca
cmp edi, dword [rsi + 0x18]
je 0x5a85d0
mov r8, qword [rsp + 0x40]
lea rcx, [rbx + 8]
xor edx, edx
lock xadd qword [rcx], rdx
test rdx, rdx
mov rcx, rdx
je 0x5a8640
add rcx, 0x10
xor eax, eax
mov rdx, 0xffffffffffffffff
lock cmpxchg qword [rcx], rdx
test rax, rax
mov rcx, rax
je 0x5a8406
call qword [sym.imp.KERNEL32.dll_SetEvent]
test ebp, ebp
mov r14d, ebp
je 0x5a8421
mov eax, r14d
add rsp, 0x68
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret
lea rcx, [rsp + 0x30]
call fcn.005a0bd0
mov r12, qword [rsp + 0x30]
mov r13, qword [rsp + 0x38]
test r12, r12
je 0x5a8670
mov qword [rsp + 0x58], 0
lea rax, [rsi + 0x38]
mov rcx, rbx
mov qword [rsp + 0x40], rax
mov qword [rsp + 0x50], 0
mov qword [rsp + 0x48], 0
xchg qword [rax], rcx
test rcx, rcx
je 0x5a84a6
mov qword [rcx + 8], rbx
lea rdx, [rcx + 0x18]
xor eax, eax
mov rcx, 0xffffffffffffffff
lock cmpxchg qword [rdx], rcx
test rax, rax
mov rcx, rax
je 0x5a8491
call qword [sym.imp.KERNEL32.dll_SetEvent]
lea r15, [rbx + 0x10]
xor r14d, r14d
lock xadd qword [r15], r14
test r14, r14
je 0x5a85e0
mov eax, dword [rsi + 0x190]
test eax, eax
jne 0x5a8533
mov r14d, dword [rsi + 0x18c]
test r14d, r14d
jne 0x5a8533
mov eax, dword [rsi + 0x28]
cmp eax, 3
ja 0x5a8533
cmp edi, r13d
jne 0x5a84d6
cmp r12, rsi
je 0x5a86fc
mov rdi, qword [rsi + 8]
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_SuspendThread]
xor edx, edx
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
cmp eax, 0x102
jne 0x5a840d
xor r8d, r8d
mov rdx, rdi
mov dword [rsi + 0x28], 4
mov dword [rsi + 0x18c], 1
lea rcx, [0x005a7a40]
call qword [0x00644ae0]
mov rcx, rbx
call fcn.0059c6f0
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_ResumeThread]
jmp 0x5a840d
mov eax, dword [rsi + 0x28]
cmp eax, 2
jbe 0x5a8620
mov eax, dword [rsi + 0x28]
cmp eax, 3
jbe 0x5a854c
mov ebp, 3
mov r8, qword [rsp + 0x40]
lea rcx, [rbx + 8]
xor edx, edx
lock xadd qword [rcx], rdx
test rdx, rdx
mov rcx, rdx
je 0x5a86a0
add rcx, 0x10
xor eax, eax
mov rdx, 0xffffffffffffffff
lock cmpxchg qword [rcx], rdx
test rax, rax
mov rcx, rax
mov r14d, ebp
je 0x5a840d
call qword [sym.imp.KERNEL32.dll_SetEvent]
jmp 0x5a840d
xor r9d, r9d
xor r8d, r8d
xor edx, edx
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_CreateEventA]
mov r13, rax
mov rax, rbp
lock cmpxchg qword [r12], r13
test rax, rax
je 0x5a8680
mov rcx, r13
call qword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x5a83b7
cmp qword [rsi + 8], 1
sbb ebp, ebp
and ebp, 3
jmp 0x5a83ca
xor r8d, r8d
xor r9d, r9d
xor edx, edx
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_CreateEventA]
mov r8, rax
mov rax, r14
lock cmpxchg qword [r15], r8
test rax, rax
je 0x5a86d0
mov rcx, r8
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [rsi + 0x190]
test eax, eax
jne 0x5a8533
jmp 0x5a84b4
mov dword [rsi + 0x28], 3
mov rcx, qword [rsi + 0x40]
call qword [sym.imp.KERNEL32.dll_SetEvent]
test eax, eax
jne 0x5a854c
jmp 0x5a8547
mov rax, rbx
lock cmpxchg qword [r8], rdx
cmp rbx, rax
je 0x5a8406
lea rcx, [rbx + 0x18]
lock xadd qword [rcx], rdx
test rdx, rdx
je 0x5a8693
lea rax, [rbx + 8]
xor ecx, ecx
lock xadd qword [rax], rcx
jmp 0x5a83e6
mov r14d, 0xc
jmp 0x5a840d
mov edx, 0xffffffff
mov rcx, r13
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
jmp 0x5a85b9
call fcn.0059c6a0
jmp 0x5a865f
mov rax, rbx
lock cmpxchg qword [r8], rdx
cmp rbx, rax
je 0x5a86f4
lea rcx, [rbx + 0x18]
lock xadd qword [rcx], rdx
test rdx, rdx
je 0x5a86ed
add rbx, 8
xor ecx, ecx
lock xadd qword [rbx], rcx
jmp 0x5a8568
mov rcx, r8
mov qword [rsp + 0x28], r8
mov edx, 0xffffffff
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov r8, qword [rsp + 0x28]
jmp 0x5a8604
call fcn.0059c6a0
jmp 0x5a86bb
mov r14d, ebp
jmp 0x5a840d
mov rcx, rbx
mov dword [rsi + 0x28], 4
mov dword [rsi + 0x18c], 1
call fcn.0059c6f0
mov ecx, 2
call fcn.005a7950
nop
push r15
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x88
test rcx, rcx
je 0x5a87d0
mov rsi, qword [rcx]
mov ebx, dword [rcx + 8]
test rsi, rsi
jne 0x5a874f
test ebx, ebx
je 0x5a8810
mov rdi, qword [0x00644b10]
test rdi, rdi
je 0x5a8913
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [rdi]
mov ebp, eax
call qword [sym.imp.KERNEL32.dll_TlsGetValue]
mov ecx, ebp
mov rdi, rax
call qword [sym.imp.KERNEL32.dll_SetLastError]
test rdi, rdi
je 0x5a8913
mov rdi, qword [rdi + 0x10]
test rdi, rdi
je 0x5a8800
add ebx, 0xf423f
mov edx, 0x431bde83
mov eax, ebx
sar ebx, 0x1f
imul esi, esi, 0x3e8
imul edx
sar edx, 0x12
sub edx, ebx
mov ebx, dword [rdi + 0x18c]
lea ecx, [rdx + rsi]
test ebx, ebx
jne 0x5a87f0
mov edx, ecx
mov rsi, qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov rcx, qword [rdi + 0x40]
call rsi
test eax, eax
je 0x5a8824
cmp eax, 0x102
je 0x5a87d5
mov ebx, 0x16
mov eax, ebx
add rsp, 0x88
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret
call qword [sym.imp.KERNEL32.dll_Sleep]
xor ebx, ebx
jmp 0x5a87d5
mov ebx, 0xc
jmp 0x5a87d5
call fcn.005a8090
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_Sleep]
call fcn.005a8090
jmp 0x5a87d5
mov qword [rsp + 0x78], 0
lea rax, [rdi + 0x38]
lea rbx, [rsp + 0x60]
mov qword [rsp + 0x60], rax
mov qword [rsp + 0x70], 0
mov rdx, rbx
mov qword [rsp + 0x68], 0
xchg qword [rax], rdx
test rdx, rdx
je 0x5a888d
mov qword [rdx + 8], rbx
xor eax, eax
add rdx, 0x18
mov rcx, 0xffffffffffffffff
lock cmpxchg qword [rdx], rcx
test rax, rax
mov rcx, rax
je 0x5a887c
call qword [sym.imp.KERNEL32.dll_SetEvent]
lea r12, [rbx + 0x10]
xor ebp, ebp
lock xadd qword [r12], rbp
test rbp, rbp
je 0x5a88e0
mov eax, dword [rdi + 0x28]
cmp eax, 3
jbe 0x5a8a25
mov r8, qword [rsp + 0x60]
lea rax, [rbx + 8]
xor edx, edx
lock xadd qword [rax], rdx
test rdx, rdx
mov rcx, rdx
je 0x5a89e0
add rcx, 0x10
xor eax, eax
mov rdx, 0xffffffffffffffff
lock cmpxchg qword [rcx], rdx
test rax, rax
mov rcx, rax
je 0x5a88d5
call qword [sym.imp.KERNEL32.dll_SetEvent]
mov ebx, 3
jmp 0x5a87d5
xor r9d, r9d
xor r8d, r8d
xor edx, edx
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_CreateEventA]
mov r13, rax
mov rax, rbp
lock cmpxchg qword [r12], r13
test rax, rax
je 0x5a8a0f
mov rcx, r13
call qword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x5a888d
lea r12, [rsp + 0x50]
mov rcx, r12
call fcn.0059e050
mov rbp, qword [rsp + 0x50]
mov r14, qword [rsp + 0x58]
test rbp, rbp
mov rdi, rbp
je 0x5a8800
or byte [rbp + 0x194], 1
mov dword [rbp + 0x184], 1
call qword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov r13, qword [sym.imp.KERNEL32.dll_GetCurrentProcess]
mov dword [rbp + 0x198], eax
call r13
mov qword [rsp + 0x48], rax
call qword [sym.imp.KERNEL32.dll_GetCurrentThread]
mov r15, rax
call r13
lea r9, [rbp + 8]
mov r8, qword [rsp + 0x48]
mov rdx, r15
mov dword [rsp + 0x30], 2
mov rcx, rax
mov dword [rsp + 0x28], 0
mov dword [rsp + 0x20], 0
call qword [sym.imp.KERNEL32.dll_DuplicateHandle]
test eax, eax
je 0x5a89c3
mov rcx, qword [rbp + 8]
call qword [sym.imp.KERNEL32.dll_GetThreadPriority]
mov rcx, qword [0x00644b10]
mov rdx, rbp
mov dword [rbp + 0x188], eax
call fcn.005a0630
jmp 0x5a878c
mov rcx, r12
mov qword [rsp + 0x50], rbp
mov ebx, 0xc
mov qword [rsp + 0x58], r14
call fcn.0059deb0
jmp 0x5a87d5
mov rax, rbx
lock cmpxchg qword [r8], rdx
cmp rbx, rax
je 0x5a88d5
lea rcx, [rbx + 0x18]
lock xadd qword [rcx], rdx
test rdx, rdx
je 0x5a8a1e
add rbx, 8
xor ecx, ecx
lock xadd qword [rbx], rcx
jmp 0x5a88b5
mov edx, 0xffffffff
mov rcx, r13
call rsi
jmp 0x5a8905
call fcn.0059c6a0
jmp 0x5a89ff
mov rcx, rbx
mov dword [rdi + 0x28], 4
mov dword [rdi + 0x18c], 1
call fcn.0059c6f0
mov ecx, 2
call fcn.005a7950
nop
nop dword [rax]
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
add rsp, 0xffffffffffffff80
mov rbx, qword [0x00644b10]
test rbx, rbx
mov qword [rsp + 0x50], rcx
je 0x5a8c93
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [rbx]
mov esi, eax
call qword [sym.imp.KERNEL32.dll_TlsGetValue]
mov ecx, esi
mov rbx, rax
call qword [sym.imp.KERNEL32.dll_SetLastError]
test rbx, rbx
je 0x5a8c93
mov rbx, qword [rbx + 0x10]
test rbx, rbx
je 0x5a8c45
mov eax, dword [rbx + 0x18c]
test eax, eax
je 0x5a8be0
mov ecx, 1
lea rdx, [rsp + 0x50]
xor r8d, r8d
mov r9d, 0xffffffff
call qword [sym.imp.KERNEL32.dll_WaitForMultipleObjects]
test eax, eax
mov edx, eax
je 0x5a8c22
cmp eax, 1
jne 0x5a8c00
mov rcx, qword [rsp + 0x58]
lea rdi, [rsp + 0x60]
call qword [sym.imp.KERNEL32.dll_ResetEvent]
lea rax, [rbx + 0x38]
mov rcx, rdi
mov qword [rsp + 0x78], 0
mov qword [rsp + 0x60], rax
mov qword [rsp + 0x70], 0
mov qword [rsp + 0x68], 0
xchg qword [rax], rcx
test rcx, rcx
je 0x5a8b80
mov qword [rcx + 8], rdi
lea rdx, [rcx + 0x18]
xor eax, eax
mov rcx, 0xffffffffffffffff
lock cmpxchg qword [rdx], rcx
test rax, rax
mov rcx, rax
je 0x5a8b41
call qword [sym.imp.KERNEL32.dll_SetEvent]
lea rbp, [rdi + 0x10]
xor esi, esi
lock xadd qword [rbp], rsi
test rsi, rsi
jne 0x5a8b80
xor r9d, r9d
xor r8d, r8d
xor edx, edx
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_CreateEventA]
mov r12, rax
mov rax, rsi
lock cmpxchg qword [rbp], r12
test rax, rax
je 0x5a8d40
mov rcx, r12
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [rbx + 0x28]
cmp eax, 3
jbe 0x5a8d89
mov r8, qword [rsp + 0x60]
lea rcx, [rdi + 8]
xor edx, edx
lock xadd qword [rcx], rdx
test rdx, rdx
mov rcx, rdx
je 0x5a8d53
add rcx, 0x10
xor eax, eax
mov rdx, 0xffffffffffffffff
lock cmpxchg qword [rcx], rdx
test rax, rax
mov rcx, rax
je 0x5a8bc8
call qword [sym.imp.KERNEL32.dll_SetEvent]
mov eax, 0x16
sub rsp, 0xffffffffffffff80
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
ret
mov rax, qword [rbx + 0x40]
mov ecx, 2
test rax, rax
mov qword [rsp + 0x58], rax
jne 0x5a8ab7
jmp 0x5a8ab2
cmp edx, 0x102
mov eax, 0x8a
mov edx, 0x16
cmovne eax, edx
sub rsp, 0xffffffffffffff80
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
ret
xor eax, eax
sub rsp, 0xffffffffffffff80
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
ret
mov rcx, rdi
mov qword [rsp + 0x40], rsi
mov qword [rsp + 0x48], r13
call fcn.0059deb0
lea rdx, [rsp + 0x50]
xor r8d, r8d
mov ecx, 1
mov qword [rsp + 0x58], 0
mov r9d, 0xffffffff
call qword [sym.imp.KERNEL32.dll_WaitForMultipleObjects]
mov edx, eax
xor eax, eax
test edx, edx
je 0x5a8c13
cmp edx, 1
jne 0x5a8c00
mov rcx, qword [rsp + 0x58]
call qword [sym.imp.KERNEL32.dll_ResetEvent]
mov eax, 0x16
sub rsp, 0xffffffffffffff80
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
ret
lea rdi, [rsp + 0x40]
mov rcx, rdi
call fcn.0059e050
mov rsi, qword [rsp + 0x40]
mov r13, qword [rsp + 0x48]
test rsi, rsi
mov rbx, rsi
je 0x5a8c45
or byte [rsi + 0x194], 1
mov dword [rsi + 0x184], 1
call qword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov rbp, qword [sym.imp.KERNEL32.dll_GetCurrentProcess]
mov dword [rsi + 0x198], eax
call rbp
mov r14, rax
call qword [sym.imp.KERNEL32.dll_GetCurrentThread]
mov r12, rax
call rbp
mov dword [rsp + 0x30], 2
mov r8, r14
mov rdx, r12
mov dword [rsp + 0x28], 0
lea r9, [rsi + 8]
mov rcx, rax
mov dword [rsp + 0x20], 0
call qword [sym.imp.KERNEL32.dll_DuplicateHandle]
test eax, eax
je 0x5a8c33
mov rcx, qword [rsi + 8]
call qword [sym.imp.KERNEL32.dll_GetThreadPriority]
mov rcx, qword [0x00644b10]
mov rdx, rsi
mov dword [rsi + 0x188], eax
call fcn.005a0630
jmp 0x5a8aa4
mov edx, 0xffffffff
mov rcx, r12
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
jmp 0x5a8b77
mov rax, rdi
lock cmpxchg qword [r8], rdx
cmp rdi, rax
je 0x5a8bc8
lea rcx, [rdi + 0x18]
lock xadd qword [rcx], rdx
test rdx, rdx
je 0x5a8d82
add rdi, 8
xor ecx, ecx
lock xadd qword [rdi], rcx
jmp 0x5a8ba8
call fcn.0059c6a0
jmp 0x5a8d72
mov rcx, rdi
mov dword [rbx + 0x28], 4
mov dword [rbx + 0x18c], 1
call fcn.0059c6f0
mov ecx, 2
call fcn.005a7950
nop
nop dword [rax]
push r15
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x88
mov rbx, qword [0x00644b10]
test rbx, rbx
mov esi, edx
mov qword [rsp + 0x50], rcx
je 0x5a8fe0
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [rbx]
mov edi, eax
call qword [sym.imp.KERNEL32.dll_TlsGetValue]
mov ecx, edi
mov rbx, rax
call qword [sym.imp.KERNEL32.dll_SetLastError]
test rbx, rbx
je 0x5a8fe0
mov rbx, qword [rbx + 0x10]
test rbx, rbx
je 0x5a8fa0
mov eax, dword [rbx + 0x18c]
test eax, eax
je 0x5a8f33
mov ecx, 1
lea rdx, [rsp + 0x50]
xor r8d, r8d
mov r9d, esi
call qword [sym.imp.KERNEL32.dll_WaitForMultipleObjects]
test eax, eax
mov edx, eax
je 0x5a8f80
cmp eax, 1
jne 0x5a8f50
mov rcx, qword [rsp + 0x58]
lea rdi, [rsp + 0x60]
call qword [sym.imp.KERNEL32.dll_ResetEvent]
lea rax, [rbx + 0x38]
mov rcx, rdi
mov qword [rsp + 0x78], 0
mov qword [rsp + 0x60], rax
mov qword [rsp + 0x70], 0
mov qword [rsp + 0x68], 0
xchg qword [rax], rcx
test rcx, rcx
je 0x5a8ee4
mov qword [rcx + 8], rdi
lea rdx, [rcx + 0x18]
xor eax, eax
mov rcx, 0xffffffffffffffff
lock cmpxchg qword [rdx], rcx
test rax, rax
mov rcx, rax
je 0x5a8ea5
call qword [sym.imp.KERNEL32.dll_SetEvent]
lea rbp, [rdi + 0x10]
xor esi, esi
lock xadd qword [rbp], rsi
test rsi, rsi
jne 0x5a8ee4
xor r9d, r9d
xor r8d, r8d
xor edx, edx
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_CreateEventA]
mov r12, rax
mov rax, rsi
lock cmpxchg qword [rbp], r12
test rax, rax
je 0x5a9090
mov rcx, r12
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [rbx + 0x28]
cmp eax, 3
jbe 0x5a90d9
mov r8, qword [rsp + 0x60]
lea rcx, [rdi + 8]
xor edx, edx
lock xadd qword [rcx], rdx
test rdx, rdx
mov rcx, rdx
je 0x5a90a3
add rcx, 0x10
xor eax, eax
mov rdx, 0xffffffffffffffff
lock cmpxchg qword [rcx], rdx
test rax, rax
mov rcx, rax
je 0x5a8f2c
call qword [sym.imp.KERNEL32.dll_SetEvent]
mov eax, 0x16
jmp 0x5a8f63
mov rax, qword [rbx + 0x40]
mov ecx, 2
test rax, rax
mov qword [rsp + 0x58], rax
jne 0x5a8e1e
jmp 0x5a8e19
cmp edx, 0x102
mov eax, 0x8a
mov edx, 0x16
cmovne eax, edx
add rsp, 0x88
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret
xor eax, eax
jmp 0x5a8f63
mov rcx, rbp
mov qword [rsp + 0x40], rdi
mov qword [rsp + 0x48], r13
call fcn.0059deb0
nop word cs:[rax + rax]
lea rdx, [rsp + 0x50]
xor r8d, r8d
mov r9d, esi
mov qword [rsp + 0x58], 0
mov ecx, 1
call qword [sym.imp.KERNEL32.dll_WaitForMultipleObjects]
mov edx, eax
xor eax, eax
test edx, edx
je 0x5a8f63
cmp edx, 1
jne 0x5a8f50
mov rcx, qword [rsp + 0x58]
call qword [sym.imp.KERNEL32.dll_ResetEvent]
mov eax, 0x16
jmp 0x5a8f63
lea rbp, [rsp + 0x40]
mov rcx, rbp
call fcn.0059e050
mov rdi, qword [rsp + 0x40]
mov r13, qword [rsp + 0x48]
test rdi, rdi
mov rbx, rdi
je 0x5a8fa0
or byte [rdi + 0x194], 1
mov dword [rdi + 0x184], 1
call qword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov r12, qword [sym.imp.KERNEL32.dll_GetCurrentProcess]
mov dword [rdi + 0x198], eax
call r12
mov r15, rax
call qword [sym.imp.KERNEL32.dll_GetCurrentThread]
mov r14, rax
call r12
lea r9, [rdi + 8]
mov r8, r15
mov rdx, r14
mov rcx, rax
mov dword [rsp + 0x30], 2
mov dword [rsp + 0x28], 0
mov dword [rsp + 0x20], 0
call qword [sym.imp.KERNEL32.dll_DuplicateHandle]
test eax, eax
je 0x5a8f84
mov rcx, qword [rdi + 8]
call qword [sym.imp.KERNEL32.dll_GetThreadPriority]
mov rcx, qword [0x00644b10]
mov rdx, rdi
mov dword [rdi + 0x188], eax
call fcn.005a0630
jmp 0x5a8e0b
mov edx, 0xffffffff
mov rcx, r12
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
jmp 0x5a8edb
mov rax, rdi
lock cmpxchg qword [r8], rdx
cmp rdi, rax
je 0x5a8f2c
lea rcx, [rdi + 0x18]
lock xadd qword [rcx], rdx
test rdx, rdx
je 0x5a90d2
add rdi, 8
xor ecx, ecx
lock xadd qword [rdi], rcx
jmp 0x5a8f0c
call fcn.0059c6a0
jmp 0x5a90c2
mov rcx, rdi
mov dword [rbx + 0x28], 4
mov dword [rbx + 0x18c], 1
call fcn.0059c6f0
mov ecx, 2
call fcn.005a7950
nop
nop dword [rax]