Function at 0x140020ea0
Capabilities:
Hook routines via microsoft detours

Disassembly:
mov qword [rsp + 8], rcx
sub rsp, 0x58
lea r8, [rsp + 0x40]
lea rdx, [rsp + 0x38]
mov rcx, qword [rsp + 0x60]
call fcn.140021400
mov qword [rsp + 0x30], 0
cmp qword [0x14004be18], 0
jne 0x140020ee8
cmp qword [0x14004be10], 0
je 0x140020ee8
mov rax, qword [0x14004be10]
mov qword [0x14004be18], rax
cmp qword [0x14004be18], 0
je 0x140020f8e
mov rax, qword [0x14004be18]
cmp qword [rax + 0x10], 0
je 0x140020f8e
mov rax, qword [0x14004be18]
mov rcx, qword [rsp + 0x38]
cmp qword [rax + 0x10], rcx
jb 0x140020f8e
mov rax, qword [0x14004be18]
mov rcx, qword [rsp + 0x40]
cmp qword [rax + 0x10], rcx
ja 0x140020f8e
mov rax, qword [0x14004be18]
mov rax, qword [rax + 0x10]
mov qword [rsp + 0x30], rax
mov rax, qword [rsp + 0x38]
cmp qword [rsp + 0x30], rax
jb 0x140020f54
mov rax, qword [rsp + 0x40]
cmp qword [rsp + 0x30], rax
jbe 0x140020f5b
xor eax, eax
jmp 0x1400211fd
mov rax, qword [0x14004be18]
mov rcx, qword [rsp + 0x30]
mov rcx, qword [rcx + 0x48]
mov qword [rax + 0x10], rcx
mov r8d, 0x60
mov edx, 0xcc
mov rcx, qword [rsp + 0x30]
call sub.msvcrt.dll_memset
mov rax, qword [rsp + 0x30]
jmp 0x1400211fd
mov rax, qword [0x14004be10]
mov qword [0x14004be18], rax
jmp 0x140020fb0
mov rax, qword [0x14004be18]
mov rax, qword [rax + 8]
mov qword [0x14004be18], rax
cmp qword [0x14004be18], 0
je 0x140020ffd
cmp qword [0x14004be18], 0
je 0x140020ffb
mov rax, qword [0x14004be18]
cmp qword [rax + 0x10], 0
je 0x140020ffb
mov rax, qword [0x14004be18]
mov rcx, qword [rsp + 0x38]
cmp qword [rax + 0x10], rcx
jb 0x140020ffb
mov rax, qword [0x14004be18]
mov rcx, qword [rsp + 0x40]
cmp qword [rax + 0x10], rcx
ja 0x140020ffb
jmp 0x140020f2c
jmp 0x140020f9e
mov rcx, qword [rsp + 0x60]
call fcn.140023030
and eax, 0xffff
mov eax, eax
mov rcx, qword [rsp + 0x60]
sub rcx, rax
mov rax, rcx
mov qword [rsp + 0x60], rax
mov qword [rsp + 0x28], 0
cmp qword [rsp + 0x28], 0
jne 0x140021057
cmp qword [rsp + 0x60], 0x40000000
jbe 0x140021057
mov rax, qword [rsp + 0x60]
sub rax, 0x40000000
mov rdx, rax
mov rcx, qword [rsp + 0x38]
call fcn.140020bf0
mov qword [rsp + 0x28], rax
cmp qword [rsp + 0x28], 0
jne 0x14002108d
movabs rax, 0xffffffff40000000
cmp qword [rsp + 0x60], rax
jae 0x14002108d
mov rax, qword [rsp + 0x60]
add rax, 0x40000000
mov rdx, qword [rsp + 0x40]
mov rcx, rax
call fcn.140020d00
mov qword [rsp + 0x28], rax
cmp qword [rsp + 0x28], 0
jne 0x1400210bd
cmp qword [rsp + 0x60], 0x40000000
jbe 0x1400210bd
mov rax, qword [rsp + 0x60]
sub rax, 0x40000000
mov rdx, qword [rsp + 0x60]
mov rcx, rax
call fcn.140020d00
mov qword [rsp + 0x28], rax
cmp qword [rsp + 0x28], 0
jne 0x1400210f3
movabs rax, 0xffffffff40000000
cmp qword [rsp + 0x60], rax
jae 0x1400210f3
mov rax, qword [rsp + 0x60]
add rax, 0x40000000
mov rdx, rax
mov rcx, qword [rsp + 0x60]
call fcn.140020bf0
mov qword [rsp + 0x28], rax
cmp qword [rsp + 0x28], 0
jne 0x14002110f
mov rdx, qword [rsp + 0x60]
mov rcx, qword [rsp + 0x38]
call fcn.140020bf0
mov qword [rsp + 0x28], rax
cmp qword [rsp + 0x28], 0
jne 0x14002112b
mov rdx, qword [rsp + 0x40]
mov rcx, qword [rsp + 0x60]
call fcn.140020d00
mov qword [rsp + 0x28], rax
cmp qword [rsp + 0x28], 0
je 0x1400211fb
mov rax, qword [rsp + 0x28]
mov qword [0x14004be18], rax
mov rax, qword [0x14004be18]
mov dword [rax], 0x52727464
mov rax, qword [0x14004be18]
mov qword [rax + 0x10], 0
mov rax, qword [0x14004be18]
mov rcx, qword [0x14004be10]
mov qword [rax + 8], rcx
mov rax, qword [0x14004be18]
mov qword [0x14004be10], rax
mov qword [rsp + 0x48], 0
mov rax, qword [0x14004be18]
add rax, 0x60
mov qword [rsp + 0x30], rax
mov dword [rsp + 0x20], 0x2a8
jmp 0x1400211ac
mov eax, dword [rsp + 0x20]
dec eax
mov dword [rsp + 0x20], eax
cmp dword [rsp + 0x20], 1
jle 0x1400211e6
movsxd rax, dword [rsp + 0x20]
imul rax, rax, 0x60
mov rcx, qword [rsp + 0x30]
mov rdx, qword [rsp + 0x48]
mov qword [rcx + rax + 0x48], rdx
movsxd rax, dword [rsp + 0x20]
imul rax, rax, 0x60
mov rcx, qword [rsp + 0x30]
add rcx, rax
mov rax, rcx
mov qword [rsp + 0x48], rax
jmp 0x1400211a2
mov rax, qword [0x14004be18]
mov rcx, qword [rsp + 0x48]
mov qword [rax + 0x10], rcx
jmp 0x140020f2c
xor eax, eax
add rsp, 0x58
ret