Function at 0x180051110
Capabilities:
Hook routines via microsoft detours

Disassembly:
xor ecx, ecx
jmp 0x180051120
push r12
sub rsp, 0x530
mov rax, qword [0x180064040]
xor rax, rsp
mov qword [rsp + 0x500], rax
mov r12, rcx
test rcx, rcx
je 0x18005114d
mov rax, qword [0x180065430]
mov qword [rcx], rax
call qword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
cmp dword [0x180065428], eax
je 0x180051165
mov eax, 0x10dd
jmp 0x1800516ed
cmp dword [0x18006542c], 0
mov qword [rsp + 0x548], rbx
mov qword [rsp + 0x528], rsi
mov qword [rsp + 0x520], rdi
je 0x1800512c4
call qword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
cmp dword [0x180065428], eax
jne 0x1800516cf
mov rdi, qword [0x180065440]
xor esi, esi
test rdi, rdi
je 0x18005122b
nop
mov rax, qword [rdi + 0x20]
lea r9, [rsp + 0x20]
mov r8d, dword [rdi + 0x28]
mov rcx, qword [rdi + 0x18]
movzx edx, byte [rax + 0x3e]
call qword [sym.imp.KERNEL32.dll_VirtualProtect]
cmp dword [rdi + 8], esi
jne 0x180051213
mov r8, qword [rdi + 0x20]
test r8, r8
je 0x180051213
xorps xmm0, xmm0
mov rdx, r8
movups xmmword [r8], xmm0
and rdx, 0xffffffffffff0000
movups xmmword [r8 + 0x10], xmm0
movups xmmword [r8 + 0x20], xmm0
movups xmmword [r8 + 0x30], xmm0
movups xmmword [r8 + 0x40], xmm0
movups xmmword [r8 + 0x50], xmm0
mov rax, qword [rdx + 0x10]
mov qword [r8 + 0x48], rax
mov qword [rdx + 0x10], r8
mov qword [rdi + 0x20], rsi
mov rbx, qword [rdi]
mov edx, 0x30
mov rcx, rdi
call fcn.180051f74
mov rdi, rbx
test rbx, rbx
jne 0x1800511b0
mov qword [0x180065440], rsi
call qword [sym.imp.KERNEL32.dll_GetCurrentProcess]
mov rbx, qword [0x180065410]
mov rdi, rax
test rbx, rbx
je 0x180051284
nop word [rax + rax]
lea r9, [rsp + 0x20]
mov edx, 0x10000
mov r8d, 0x20
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_VirtualProtect]
mov r8d, 0x10000
mov rdx, rbx
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_FlushInstructionCache]
mov rbx, qword [rbx + 8]
test rbx, rbx
jne 0x180051250
mov rdi, qword [0x180065438]
test rdi, rdi
je 0x1800512b2
mov rcx, qword [rdi + 8]
call qword [sym.imp.KERNEL32.dll_ResumeThread]
mov rbx, qword [rdi]
mov edx, 0x10
mov rcx, rdi
call fcn.180051f74
mov rdi, rbx
test rbx, rbx
jne 0x180051290
mov qword [0x180065438], rsi
mov dword [0x180065428], esi
jmp 0x1800516cf
mov rbx, qword [0x180065440]
xor esi, esi
mov qword [rsp + 0x550], rbp
mov qword [rsp + 0x518], r14
mov qword [rsp + 0x510], r15
mov r15d, esi
test rbx, rbx
je 0x18005137c
mov rdx, qword [rbx + 0x20]
cmp dword [rbx + 8], esi
je 0x180051312
movzx r8d, byte [rdx + 0x3e]
add rdx, 0x20
mov rcx, qword [rbx + 0x18]
call sub.VCRUNTIME140.dll_memcpy
mov rax, qword [rbx + 0x18]
jmp 0x180051369
mov word [rdx + 0x58], 0x25ff
lea rcx, [rdx + 0x58]
lea rax, [rcx + 6]
sub edx, eax
add edx, 0x50
mov dword [rcx + 2], edx
mov r8, qword [rbx + 0x18]
mov rcx, qword [rbx + 0x20]
add rcx, 0x58
lea rax, [r8 + 5]
mov byte [r8], 0xe9
sub ecx, eax
mov dword [r8 + 1], ecx
lea rcx, [r8 + 5]
mov rax, qword [rbx + 0x20]
mov r8, qword [rax + 0x48]
sub r8, rcx
cmp rcx, qword [rax + 0x48]
cmova r8, rsi
test r8, r8
je 0x180051365
mov dl, 0xcc
call sub.VCRUNTIME140.dll_memset
mov rax, qword [rbx + 0x20]
mov rcx, qword [rbx + 0x10]
mov qword [rcx], rax
mov rbx, qword [rbx]
test rbx, rbx
jne 0x1800512f1
mov r14, qword [0x180065438]
test r14, r14
je 0x1800514d3
nop dword [rax]
mov rcx, qword [r14 + 8]
lea rdx, [rsp + 0x30]
mov dword [rsp + 0x60], 0x100001
call qword [sym.imp.KERNEL32.dll_GetThreadContext]
test eax, eax
je 0x1800514c7
mov rbx, qword [0x180065440]
test rbx, rbx
je 0x1800514c7
mov rcx, qword [rsp + 0x128]
cmp dword [rbx + 8], esi
je 0x18005143b
mov r10, qword [rbx + 0x20]
cmp rcx, r10
jb 0x1800514bb
lea rax, [r10 + 8]
cmp rcx, rax
jae 0x1800514bb
movzx r11d, byte [rsp + 0x128]
lea r8, [r10 + 0x40]
mov eax, esi
nop word [rax + rax]
movzx r9d, byte [r8]
movzx edx, r11b
movzx ecx, r9b
sub dl, r10b
shr cl, 3
cmp cl, dl
je 0x18005142d
inc eax
inc r8
cmp eax, 8
jb 0x180051400
xor r9b, r9b
movzx eax, r9b
add rax, qword [rbx + 0x18]
jmp 0x18005149c
and r9b, 7
movzx eax, r9b
add rax, qword [rbx + 0x18]
jmp 0x18005149c
mov r10, qword [rbx + 0x18]
cmp rcx, r10
jb 0x1800514bb
mov rdi, qword [rbx + 0x20]
movzx eax, byte [rdi + 0x3e]
add rax, r10
cmp rcx, rax
jae 0x1800514bb
movzx r11d, byte [rsp + 0x128]
lea r8, [rdi + 0x40]
mov edx, esi
nop dword [rax]
nop word [rax + rax]
movzx r9d, byte [r8]
movzx ecx, r11b
movzx eax, r9b
sub cl, r10b
and al, 7
cmp al, cl
je 0x180051493
inc edx
inc r8
cmp edx, 8
jb 0x180051470
mov eax, esi
jmp 0x180051499
mov eax, r9d
shr eax, 3
add rax, rdi
mov rcx, qword [r14 + 8]
lea rdx, [rsp + 0x30]
mov qword [rsp + 0x128], rax
call qword [sym.imp.KERNEL32.dll_SetThreadContext]
mov rcx, qword [rsp + 0x128]
mov rbx, qword [rbx]
test rbx, rbx
jne 0x1800513c7
mov r14, qword [r14]
test r14, r14
jne 0x180051390
call qword [sym.imp.KERNEL32.dll_GetCurrentProcess]
mov rdi, qword [0x180065440]
mov rbp, rax
mov r14, qword [rsp + 0x518]
test rdi, rdi
je 0x18005159b
nop dword [rax]
nop dword [rax + rax]
mov rcx, qword [rdi + 0x20]
lea r9, [rsp + 0x20]
mov r8d, dword [rdi + 0x28]
movzx edx, byte [rcx + 0x3e]
mov rcx, qword [rdi + 0x18]
call qword [sym.imp.KERNEL32.dll_VirtualProtect]
mov rax, qword [rdi + 0x20]
mov rcx, rbp
mov rdx, qword [rdi + 0x18]
movzx r8d, byte [rax + 0x3e]
call qword [sym.imp.KERNEL32.dll_FlushInstructionCache]
cmp dword [rdi + 8], esi
je 0x18005157f
mov r8, qword [rdi + 0x20]
test r8, r8
je 0x18005157f
xorps xmm0, xmm0
mov rdx, r8
movups xmmword [r8], xmm0
and rdx, 0xffffffffffff0000
mov r15d, 1
movups xmmword [r8 + 0x10], xmm0
movups xmmword [r8 + 0x20], xmm0
movups xmmword [r8 + 0x30], xmm0
movups xmmword [r8 + 0x40], xmm0
movups xmmword [r8 + 0x50], xmm0
mov rax, qword [rdx + 0x10]
mov qword [r8 + 0x48], rax
mov qword [rdx + 0x10], r8
mov qword [rdi + 0x20], rsi
mov rbx, qword [rdi]
mov edx, 0x30
mov rcx, rdi
call fcn.180051f74
mov rdi, rbx
test rbx, rbx
jne 0x180051500
mov rbp, qword [rsp + 0x550]
test r15d, r15d
mov r15, qword [rsp + 0x510]
mov qword [0x180065440], rsi
je 0x18005163b
cmp dword [0x180065424], esi
jne 0x18005163b
mov rcx, qword [0x180065410]
lea rbx, [0x180065410]
test rcx, rcx
je 0x18005163b
cmp dword [rcx], 0x52727464
je 0x1800515e4
lea rbx, [rcx + 8]
jmp 0x180051633
lea r9, [rcx + 0x10000]
mov r8d, esi
lea rdx, [rcx + 0xa8]
mov rax, qword [rdx]
test rax, rax
je 0x180051607
cmp rax, rcx
jb 0x1800515de
cmp rax, r9
jae 0x1800515de
inc r8d
add rdx, 0x60
cmp r8d, 0x2a9
jb 0x1800515f5
mov rax, qword [rcx + 8]
xor edx, edx
mov r8d, 0x8000
mov qword [rbx], rax
call qword [sym.imp.KERNEL32.dll_VirtualFree]
mov qword [0x180065418], rsi
mov rcx, qword [rbx]
test rcx, rcx
jne 0x1800515d6
call qword [sym.imp.KERNEL32.dll_GetCurrentProcess]
mov rbx, qword [0x180065410]
mov rdi, rax
test rbx, rbx
je 0x180051684
lea r9, [rsp + 0x20]
mov edx, 0x10000
mov r8d, 0x20
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_VirtualProtect]
mov r8d, 0x10000
mov rdx, rbx
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_FlushInstructionCache]
mov rbx, qword [rbx + 8]
test rbx, rbx
jne 0x180051650
mov rdi, qword [0x180065438]
test rdi, rdi
je 0x1800516b2
mov rcx, qword [rdi + 8]
call qword [sym.imp.KERNEL32.dll_ResumeThread]
mov rbx, qword [rdi]
mov edx, 0x10
mov rcx, rdi
call fcn.180051f74
mov rdi, rbx
test rbx, rbx
jne 0x180051690
mov qword [0x180065438], rsi
mov dword [0x180065428], esi
test r12, r12
je 0x1800516cf
mov rax, qword [0x180065430]
mov qword [r12], rax
mov eax, dword [0x18006542c]
mov rdi, qword [rsp + 0x520]
mov rsi, qword [rsp + 0x528]
mov rbx, qword [rsp + 0x548]
mov rcx, qword [rsp + 0x500]
xor rcx, rsp
call fcn.180051f10
add rsp, 0x530
pop r12
ret