Function at 0x18009d330
Capabilities:
Hook routines via microsoft detours

Disassembly:
xor ecx, ecx
jmp 0x18009d340
push r12
sub rsp, 0x530
mov rax, qword [0x1801548a8]
xor rax, rsp
mov qword [rsp + 0x500], rax
mov r12, rcx
test rcx, rcx
je 0x18009d36d
mov rax, qword [0x180165fc8]
mov qword [rcx], rax
call qword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
cmp dword [0x180165fc0], eax
je 0x18009d385
mov eax, 0x10dd
jmp 0x18009d895
cmp dword [0x180165fc4], 0
mov qword [rsp + 0x548], rbx
mov qword [rsp + 0x550], rbp
mov qword [rsp + 0x528], rsi
mov qword [rsp + 0x520], rdi
je 0x18009d487
call qword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
cmp dword [0x180165fc0], eax
jne 0x18009d86f
mov rbx, qword [0x180165fd8]
xor esi, esi
test rbx, rbx
je 0x18009d43b
mov rax, qword [rbx + 0x20]
lea r9, [rsp + 0x20]
mov r8d, dword [rbx + 0x28]
mov rcx, qword [rbx + 0x18]
movzx edx, byte [rax + 0x3e]
call qword [sym.imp.KERNEL32.dll_VirtualProtect]
cmp dword [rbx + 8], esi
jne 0x18009d423
mov rbp, qword [rbx + 0x20]
test rbp, rbp
je 0x18009d423
xor edx, edx
mov rdi, rbp
and rdi, 0xffffffffffff0000
mov rcx, rbp
lea r8d, [rdx + 0x60]
call fcn.1800c61d0
mov rax, qword [rdi + 0x10]
mov qword [rbp + 0x48], rax
mov qword [rdi + 0x10], rbp
mov qword [rbx + 0x20], rsi
mov rdi, qword [rbx]
mov edx, 0x30
mov rcx, rbx
call fcn.1800965cc
mov rbx, rdi
test rdi, rdi
jne 0x18009d3d2
mov qword [0x180165fd8], rsi
call fcn.18009cdb0
mov rbx, qword [0x180165fd0]
test rbx, rbx
je 0x18009d475
mov rcx, qword [rbx + 8]
call qword [sym.imp.KERNEL32.dll_ResumeThread]
mov rdi, qword [rbx]
mov edx, 0x10
mov rcx, rbx
call fcn.1800965cc
mov rbx, rdi
test rdi, rdi
jne 0x18009d453
mov qword [0x180165fd0], rsi
mov dword [0x180165fc0], esi
jmp 0x18009d86f
mov rbx, qword [0x180165fd8]
xor esi, esi
mov qword [rsp + 0x518], r14
mov qword [rsp + 0x510], r15
mov r15d, esi
test rbx, rbx
je 0x18009d540
nop dword [rax]
mov rdx, qword [rbx + 0x20]
cmp dword [rbx + 8], esi
je 0x18009d4d8
movzx r8d, byte [rdx + 0x3e]
add rdx, 0x20
mov rcx, qword [rbx + 0x18]
call fcn.1800c5d60
mov rcx, qword [rbx + 0x10]
mov rax, qword [rbx + 0x18]
mov qword [rcx], rax
jmp 0x18009d534
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 rdx, qword [rbx + 0x18]
mov rcx, qword [rbx + 0x20]
add rcx, 0x58
mov byte [rdx], 0xe9
lea rdi, [rdx + 5]
lea rax, [rdx + 5]
sub ecx, eax
mov dword [rdx + 1], ecx
mov r8, qword [rbx + 0x20]
mov rcx, qword [r8 + 0x48]
sub rcx, rdi
cmp rdi, qword [r8 + 0x48]
cmova rcx, rsi
test rcx, rcx
je 0x18009d52d
mov eax, 0xcc
rep stosb byte [rdi], al
mov r8, qword [rbx + 0x20]
mov rax, qword [rbx + 0x10]
mov qword [rax], r8
mov rbx, qword [rbx]
test rbx, rbx
jne 0x18009d4b0
mov r14, qword [0x180165fd0]
test r14, r14
je 0x18009d694
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 0x18009d688
mov rbx, qword [0x180165fd8]
test rbx, rbx
je 0x18009d688
mov rcx, qword [rsp + 0x128]
cmp dword [rbx + 8], esi
je 0x18009d5fb
mov r9, qword [rbx + 0x20]
cmp rcx, r9
jb 0x18009d67c
lea rax, [r9 + 8]
cmp rcx, rax
jae 0x18009d67c
movzx r10d, byte [rsp + 0x128]
lea rdi, [r9 + 0x40]
mov eax, esi
nop word [rax + rax]
movzx r8d, byte [rdi]
movzx edx, r10b
movzx ecx, r8b
sub dl, r9b
shr cl, 3
cmp cl, dl
je 0x18009d5ed
inc eax
inc rdi
cmp eax, 8
jb 0x18009d5c0
xor r8b, r8b
movzx eax, r8b
add rax, qword [rbx + 0x18]
jmp 0x18009d65d
and r8b, 7
movzx eax, r8b
add rax, qword [rbx + 0x18]
jmp 0x18009d65d
mov r9, qword [rbx + 0x18]
cmp rcx, r9
jb 0x18009d67c
mov r11, qword [rbx + 0x20]
movzx eax, byte [r11 + 0x3e]
add rax, r9
cmp rcx, rax
jae 0x18009d67c
movzx r10d, byte [rsp + 0x128]
lea rdi, [r11 + 0x40]
mov edx, esi
nop dword [rax]
nop dword [rax + rax]
movzx r8d, byte [rdi]
movzx ecx, r10b
movzx eax, r8b
sub cl, r9b
and al, 7
cmp al, cl
je 0x18009d653
inc edx
inc rdi
cmp edx, 8
jb 0x18009d630
mov eax, esi
jmp 0x18009d65a
movzx eax, r8b
shr eax, 3
add rax, r11
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 0x18009d587
mov r14, qword [r14]
test r14, r14
jne 0x18009d550
call qword [sym.imp.KERNEL32.dll_GetCurrentProcess]
mov rbx, qword [0x180165fd8]
mov r14, rax
test rbx, rbx
je 0x18009d739
nop dword [rax]
mov rcx, qword [rbx + 0x20]
lea r9, [rsp + 0x20]
mov r8d, dword [rbx + 0x28]
movzx edx, byte [rcx + 0x3e]
mov rcx, qword [rbx + 0x18]
call qword [sym.imp.KERNEL32.dll_VirtualProtect]
mov rax, qword [rbx + 0x20]
mov rcx, r14
mov rdx, qword [rbx + 0x18]
movzx r8d, byte [rax + 0x3e]
call qword [sym.imp.KERNEL32.dll_FlushInstructionCache]
cmp dword [rbx + 8], esi
je 0x18009d71d
mov rbp, qword [rbx + 0x20]
test rbp, rbp
je 0x18009d71d
xor edx, edx
mov rdi, rbp
and rdi, 0xffffffffffff0000
mov rcx, rbp
lea r8d, [rdx + 0x60]
call fcn.1800c61d0
mov rax, qword [rdi + 0x10]
mov r15d, 1
mov qword [rbp + 0x48], rax
mov qword [rdi + 0x10], rbp
mov qword [rbx + 0x20], rsi
mov rdi, qword [rbx]
mov edx, 0x30
mov rcx, rbx
call fcn.1800965cc
mov rbx, rdi
test rdi, rdi
jne 0x18009d6b0
mov r14, qword [rsp + 0x518]
test r15d, r15d
mov r15, qword [rsp + 0x510]
mov qword [0x180165fd8], rsi
je 0x18009d7d2
cmp dword [0x180165fbc], esi
jne 0x18009d7d2
mov rcx, qword [0x180165fa8]
lea rbx, [0x180165fa8]
test rcx, rcx
je 0x18009d7d2
cmp dword [rcx], 0x52727464
jne 0x18009d7c6
lea r8, [rcx + 0x10000]
mov edi, esi
lea rdx, [rcx + 0xa8]
mov rax, qword [rdx]
test rax, rax
je 0x18009d79a
cmp rax, rcx
jb 0x18009d7c6
cmp rax, r8
jae 0x18009d7c6
inc edi
add rdx, 0x60
cmp edi, 0x2a9
jb 0x18009d788
mov rax, qword [rcx + 8]
xor edx, edx
mov r8d, 0x8000
mov qword [rbx], rax
call qword [sym.imp.KERNEL32.dll_VirtualFree]
mov qword [0x180165fb0], rsi
jmp 0x18009d7ca
lea rbx, [rcx + 8]
mov rcx, qword [rbx]
test rcx, rcx
jne 0x18009d770
call qword [sym.imp.KERNEL32.dll_GetCurrentProcess]
mov rdi, qword [0x180165fa8]
mov rbx, rax
test rdi, rdi
je 0x18009d824
nop word [rax + rax]
lea r9, [rsp + 0x20]
mov edx, 0x10000
mov r8d, 0x20
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_VirtualProtect]
mov r8d, 0x10000
mov rdx, rdi
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_FlushInstructionCache]
mov rdi, qword [rdi + 8]
test rdi, rdi
jne 0x18009d7f0
mov rbx, qword [0x180165fd0]
test rbx, rbx
je 0x18009d852
mov rcx, qword [rbx + 8]
call qword [sym.imp.KERNEL32.dll_ResumeThread]
mov rdi, qword [rbx]
mov edx, 0x10
mov rcx, rbx
call fcn.1800965cc
mov rbx, rdi
test rdi, rdi
jne 0x18009d830
mov qword [0x180165fd0], rsi
mov dword [0x180165fc0], esi
test r12, r12
je 0x18009d86f
mov rax, qword [0x180165fc8]
mov qword [r12], rax
mov eax, dword [0x180165fc4]
mov rdi, qword [rsp + 0x520]
mov rsi, qword [rsp + 0x528]
mov rbp, qword [rsp + 0x550]
mov rbx, qword [rsp + 0x548]
mov rcx, qword [rsp + 0x500]
xor rcx, rsp
call fcn.180096b80
add rsp, 0x530
pop r12
ret