Function at 0x180016870
Capabilities:
Resume thread

Disassembly:
xor ecx, ecx
jmp 0x180016870
push r14
sub rsp, 0x520
mov rax, qword [0x180057080]
xor rax, rsp
mov qword [rsp + 0x500], rax
mov r14, rcx
test rcx, rcx
je 0x18001689d
mov rax, qword [0x180058140]
mov qword [rcx], rax
call qword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
cmp dword [0x180058120], eax
je 0x1800168b5
mov eax, 0x10dd
jmp 0x180016c1c
cmp dword [0x180058138], 0
je 0x1800168c8
call fcn.180016680
jmp 0x180016c16
mov qword [rsp + 0x538], rbx
mov rbx, qword [0x180058150]
mov qword [rsp + 0x540], rbp
xor ebp, ebp
mov qword [rsp + 0x518], rsi
mov qword [rsp + 0x510], rdi
test rbx, rbx
je 0x1800169f6
nop word [rax + rax]
cmp dword [rbx + 8], ebp
je 0x18001696a
mov rdx, qword [rbx + 0x20]
mov edi, ebp
cmp byte [rdx + 0x1f], bpl
jbe 0x180016943
movsxd rcx, edi
lea r9, [rsp + 0x20]
add rcx, qword [rbx + 0x18]
xor r8d, r8d
mov dword [rsp + 0x20], ebp
call fcn.180017270
mov rdx, rax
cmp dword [rsp + 0x20], ebp
jne 0x180016943
mov edi, eax
mov rax, qword [rbx + 0x20]
sub edi, dword [rbx + 0x20]
movzx ecx, byte [rax + 0x1f]
cmp edi, ecx
jl 0x180016911
mov rax, qword [rbx + 0x20]
movzx ecx, byte [rax + 0x1f]
cmp edi, ecx
je 0x180016964
mov rax, qword [rbx + 0x10]
mov qword [0x180058140], rax
mov dword [0x180058138], 0xd
mov rax, qword [rbx + 0x18]
jmp 0x1800169e3
mov rax, qword [rbx + 0x20]
mov word [rax + 0x30], 0x25ff
lea rcx, [rax + 0x30]
lea rdx, [rax + 0x28]
lea rax, [rcx + 6]
sub edx, eax
mov dword [rcx + 2], edx
mov r9, qword [rbx + 0x18]
mov rcx, qword [rbx + 0x20]
add rcx, 0x30
mov byte [r9], 0xe9
lea rax, [r9 + 5]
inc r9
sub ecx, eax
mov dword [r9], ecx
lea rdx, [r9 + 4]
mov rax, qword [rbx + 0x20]
mov r8, qword [rax + 0x20]
sub r8, rdx
cmp rdx, qword [rax + 0x20]
cmova r8, rbp
test r8, r8
je 0x1800169df
mov rax, rdx
sub rax, r9
sub rax, 4
nop word [rax + rax]
inc rax
mov byte [rdx], 0xcc
lea rdx, [rdx + 1]
cmp rax, r8
jb 0x1800169d0
mov rax, qword [rbx + 0x20]
mov rcx, qword [rbx + 0x10]
mov qword [rcx], rax
mov rbx, qword [rbx]
test rbx, rbx
jne 0x180016900
mov rdi, qword [0x180058148]
test rdi, rdi
je 0x180016ac3
mov rcx, qword [rdi + 8]
lea rdx, [rsp + 0x30]
mov dword [rsp + 0x60], 0x100001
call qword [sym.imp.KERNEL32.dll_GetThreadContext]
test eax, eax
je 0x180016ab7
mov rbx, qword [0x180058150]
test rbx, rbx
je 0x180016ab7
mov rdx, qword [rsp + 0x128]
nop dword [rax]
cmp dword [rbx + 8], ebp
je 0x180016a68
mov rcx, qword [rbx + 0x20]
cmp rdx, rcx
jb 0x180016aaf
lea rax, [rcx + 8]
cmp rdx, rax
jae 0x180016aaf
sub rdx, rcx
mov qword [rsp + 0x128], rdx
add rdx, qword [rbx + 0x18]
jmp 0x180016a90
mov r8, qword [rbx + 0x18]
cmp rdx, r8
jb 0x180016aaf
mov rax, qword [rbx + 0x20]
movzx ecx, byte [rax + 0x1f]
add rcx, r8
cmp rdx, rcx
jae 0x180016aaf
sub rdx, r8
mov qword [rsp + 0x128], rdx
add rdx, qword [rbx + 0x20]
mov rcx, qword [rdi + 8]
mov qword [rsp + 0x128], rdx
lea rdx, [rsp + 0x30]
call qword [sym.imp.KERNEL32.dll_SetThreadContext]
mov rdx, qword [rsp + 0x128]
mov rbx, qword [rbx]
test rbx, rbx
jne 0x180016a40
mov rdi, qword [rdi]
test rdi, rdi
jne 0x180016a06
call qword [sym.imp.KERNEL32.dll_GetCurrentProcess]
mov rdi, qword [0x180058150]
mov rsi, rax
test rdi, rdi
je 0x180016b72
nop dword [rax]
mov rcx, qword [rdi + 0x20]
lea r9, [rsp + 0x20]
mov r8d, dword [rdi + 0x28]
movzx edx, byte [rcx + 0x1f]
mov rcx, qword [rdi + 0x18]
call qword [sym.imp.KERNEL32.dll_VirtualProtect]
mov rax, qword [rdi + 0x20]
mov rcx, rsi
mov rdx, qword [rdi + 0x18]
movzx r8d, byte [rax + 0x1f]
call qword [sym.imp.KERNEL32.dll_FlushInstructionCache]
cmp dword [rdi + 8], ebp
je 0x180016b56
mov r8, qword [rdi + 0x20]
test r8, r8
je 0x180016b56
mov rdx, r8
and rdx, 0xffffffffffff0000
xor eax, eax
mov qword [r8], rax
mov qword [r8 + 8], rax
mov qword [r8 + 0x10], rax
mov qword [r8 + 0x18], rax
mov qword [r8 + 0x20], rax
mov qword [r8 + 0x28], rax
mov qword [r8 + 0x30], rax
mov rax, qword [rdx + 0x10]
mov qword [r8 + 0x20], rax
mov qword [rdx + 0x10], r8
mov qword [rdi + 0x20], rbp
mov rbx, qword [rdi]
mov edx, 0x30
mov rcx, rdi
call fcn.180018aa4
mov rdi, rbx
test rbx, rbx
jne 0x180016ae0
mov rbx, qword [0x180058128]
mov rsi, qword [rsp + 0x518]
mov qword [0x180058150], rbp
test rbx, rbx
je 0x180016bb2
nop dword [rax]
lea r9, [rsp + 0x24]
mov edx, 0x10000
mov r8d, 0x20
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_VirtualProtect]
mov rbx, qword [rbx + 8]
test rbx, rbx
jne 0x180016b90
mov rdi, qword [0x180058148]
test rdi, rdi
je 0x180016be2
nop
mov rcx, qword [rdi + 8]
call qword [sym.imp.KERNEL32.dll_ResumeThread]
mov rbx, qword [rdi]
mov edx, 0x10
mov rcx, rdi
call fcn.180018aa4
mov rdi, rbx
test rbx, rbx
jne 0x180016bc0
mov rdi, qword [rsp + 0x510]
mov rbx, qword [rsp + 0x538]
mov qword [0x180058148], rbp
mov dword [0x180058120], ebp
mov rbp, qword [rsp + 0x540]
test r14, r14
je 0x180016c16
mov rax, qword [0x180058140]
mov qword [r14], rax
mov eax, dword [0x180058138]
mov rcx, qword [rsp + 0x500]
xor rcx, rsp
call fcn.180018b40
add rsp, 0x520
pop r14
ret