Function at 0x140037af0
Capabilities:
Check os version
Get common file path
Get file attributes

Disassembly:
mov qword [rsp + 8], rbx
mov qword [rsp + 0x10], rdx
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
lea rbp, [rsp - 0x740]
sub rsp, 0x840
bt qword [0x140057bc8], 0
mov rdi, rdx
mov rbx, rcx
lea rdx, str.LoadLibraryExW
lea rcx, [0x14006f0c0]
mov esi, r8d
call fcn.1400389c8
xor r12d, r12d
mov qword [rsp + 0x20], rax
mov r14, rax
test rax, rax
jne 0x140037b5b
mov ecx, 0x65b
call qword [sym.imp.KERNEL32.dll_SetLastError]
xor eax, eax
jmp 0x140037fa8
test esi, esi
je 0x140037f9c
bt qword [0x140057ba0], 0
lea rdx, str.AddDllDirectory
lea rcx, [0x14006f098]
call fcn.1400389c8
test rax, rax
jne 0x140037f9c
test sil, 0x60
je 0x140037baa
mov rax, qword gs:[0x30]
mov rcx, qword [rax + 0x60]
cmp dword [rcx + 0x118], 6
jae 0x140037baa
and esi, 0xffffff9f
or esi, 2
mov r14d, esi
and r14d, 0xffffff00
je 0x140037c4b
test esi, 0xffffe00c
jne 0x140037f92
test rbx, rbx
je 0x140037f92
test rdi, rdi
jne 0x140037f92
movzx esi, sil
mov eax, 0xe00
bt r14d, 0xc
jae 0x140037bf0
btr r14d, 0xc
or r14d, eax
cmp r14d, eax
je 0x140037c4b
bt qword [0x140057b78], 0
lea rdx, str.RtlDetermineDosPathNameType_U
lea rcx, [0x14006f070]
call fcn.1400389c8
test rax, rax
je 0x140037c1d
mov rcx, rbx
call rax
jmp 0x140037c20
mov eax, r12d
mov r13d, r14d
mov ecx, 0x29
and r13d, 0x100
je 0x140037c5d
cmp eax, 5
ja 0x140037c3f
bt ecx, eax
jb 0x140037f92
cmp r14d, 0xf00
jne 0x140037c5d
or esi, 8
mov r8d, esi
mov rdx, rdi
mov rcx, rbx
call qword [rsp + 0x20]
jmp 0x140037f87
mov r15d, 0x400
test r15d, r14d
jne 0x140037f92
test sil, 0x62
je 0x140037d9b
cmp eax, 5
ja 0x140037c4b
bt ecx, eax
jae 0x140037c4b
or edi, 0xffffffff
mov r12d, 0x5c
bt r14d, 9
jae 0x140037d24
mov r8d, r15d
lea rdx, [rsp + 0x40]
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
mov edx, eax
lea ecx, [rdx - 1]
cmp ecx, 0x3fe
ja 0x140037b49
xor r13d, r13d
movzx eax, word [rsp + rdx*2 + 0x40]
cmp ax, r12w
je 0x140037cd5
cmp ax, 0x2f
je 0x140037cd5
test edx, edx
je 0x140037b49
add edx, edi
jmp 0x140037cb8
inc edx
mov r8, rbx
cmp word [rbx], r13w
je 0x140037cfe
cmp edx, r15d
jae 0x140037b49
movzx eax, word [r8]
add r8, 2
mov word [rsp + rdx*2 + 0x40], ax
inc edx
cmp word [r8], r13w
jne 0x140037ce0
lea rcx, [rsp + 0x40]
mov word [rsp + rdx*2 + 0x40], r13w
call qword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, edi
je 0x140037d24
mov rdi, qword [rbp + 0x788]
lea rbx, [rsp + 0x40]
jmp 0x140037c4b
bt r14d, 0xb
jae 0x140037d91
mov edx, r15d
lea rcx, [rsp + 0x40]
call qword [sym.imp.KERNEL32.dll_GetSystemDirectoryW]
mov edx, eax
lea ecx, [rdx - 1]
cmp ecx, 0x3fe
ja 0x140037b49
cmp word [rsp + rdx*2 + 0x40], r12w
je 0x140037d5a
inc edx
mov word [rsp + rdx*2 + 0x40], r12w
xor r12d, r12d
jmp 0x140037d76
cmp edx, r15d
jae 0x140037b49
movzx eax, word [rbx]
add rbx, 2
mov word [rsp + rdx*2 + 0x40], ax
inc edx
cmp word [rbx], r12w
jne 0x140037d5f
lea rcx, [rsp + 0x40]
mov word [rsp + rdx*2 + 0x40], r12w
call qword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, edi
jne 0x140037d13
mov ecx, 0x7e
jmp 0x140037b4e
bt qword [0x140057b98], 0
lea rdx, str.LdrLoadDll
lea rcx, [0x14006f090]
call fcn.1400389c8
xor r9d, r9d
mov qword [rsp + 0x20], rax
test rax, rax
je 0x140037b49
lea r12d, [r9 + 0x5c]
mov edi, r9d
lea r10d, [r9 + 0x3b]
test r13d, r13d
je 0x140037e39
mov rdx, rbx
cmp word [rbx], r9w
je 0x140037b49
mov r8d, edi
cmp edi, r15d
jae 0x140037b49
movzx ecx, word [rdx]
add rdx, 2
mov eax, edi
inc edi
mov word [rsp + rax*2 + 0x40], cx
cmp word [rdx], r9w
jne 0x140037de5
test edi, edi
je 0x140037b49
mov edi, r8d
jmp 0x140037e29
cmp cx, 0x2f
je 0x140037e2f
test edi, edi
je 0x140037b49
dec edi
movzx ecx, word [rsp + rdi*2 + 0x40]
cmp cx, r12w
jne 0x140037e14
inc edi
mov word [rsp + rdi*2 + 0x40], r10w
inc edi
bt r14d, 9
jae 0x140037e9f
mov eax, edi
lea rdx, [rsp + 0x40]
mov r13d, r15d
xor ecx, ecx
sub r13d, edi
mov r8d, r13d
lea rdx, [rdx + rax*2]
call qword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
xor r9d, r9d
test eax, eax
je 0x140037b49
cmp eax, r13d
jae 0x140037b49
dec edi
add edi, eax
jmp 0x140037e86
cmp cx, 0x2f
je 0x140037e91
test edi, edi
je 0x140037b49
dec edi
movzx ecx, word [rsp + rdi*2 + 0x40]
cmp cx, r12w
jne 0x140037e76
inc edi
mov ecx, 0x3b
mov word [rsp + rdi*2 + 0x40], cx
inc edi
bt r14d, 0xb
jae 0x140037ed3
mov eax, edi
lea rcx, [rsp + 0x40]
sub r15d, edi
mov edx, r15d
lea rcx, [rcx + rax*2]
call qword [sym.imp.KERNEL32.dll_GetSystemDirectoryW]
xor r9d, r9d
test eax, eax
je 0x140037b49
cmp eax, r15d
jae 0x140037b49
add edi, eax
mov eax, edi
mov ecx, 2
mov qword [rsp + 0x38], rbx
mov word [rsp + rax*2 + 0x40], r9w
mov rax, rbx
cmp word [rbx], r9w
je 0x140037ef3
add rbx, rcx
jmp 0x140037ee8
sub rbx, rax
sar rbx, 1
add rbx, rbx
lea rax, [rbx + 2]
cmp rax, 0xffff
ja 0x140037f92
mov word [rsp + 0x30], bx
mov eax, r9d
add bx, cx
mov qword [rsp + 0x28], r9
mov word [rsp + 0x32], bx
mov dword [rbp + 0x798], r9d
test sil, 1
je 0x140037f36
mov dword [rbp + 0x798], ecx
mov eax, ecx
test sil, 0x10
je 0x140037f46
bts eax, 0xc
mov dword [rbp + 0x798], eax
test sil, sil
jns 0x140037f55
bts eax, 0x17
mov dword [rbp + 0x798], eax
lea r9, [rsp + 0x28]
lea r8, [rsp + 0x30]
lea rdx, [rbp + 0x798]
lea rcx, [rsp + 0x40]
call qword [rsp + 0x20]
test eax, eax
jns 0x140037f82
mov ecx, eax
call fcn.140038468
mov ecx, eax
call qword [sym.imp.KERNEL32.dll_SetLastError]
mov rax, qword [rsp + 0x28]
test rax, rax
je 0x140037b54
jmp 0x140037fa8
mov ecx, 0x57
jmp 0x140037b4e
mov r8d, esi
mov rdx, rdi
mov rcx, rbx
call r14
mov rbx, qword [rsp + 0x880]
add rsp, 0x840
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret