Function at 0x140040840
Capabilities:
Check if file exists
Get file attributes

Disassembly:
mov qword [rsp + 8], rbx
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0x60
mov rbx, rcx
xor esi, esi
mov r14d, esi
mov dword [rsp + 0xa8], esi
xor bpl, bpl
cmp dword [0x1401eb6c0], 0xb23a8c33
je 0x1400408a2
mov ecx, 0x6c0
call fcn.1400f2ce0
mov qword [rsp + 0xa8], rax
test rax, rax
je 0x140040896
mov rcx, rax
call fcn.1400302c0
mov rcx, rax
jmp 0x140040899
mov rcx, rsi
mov qword [0x1401f7b90], rcx
jmp 0x1400408a9
mov rcx, qword [0x1401f7b90]
mov rax, qword [rcx]
mov byte [rsp + 0x30], 1
mov byte [rsp + 0x28], 0
mov byte [rsp + 0x20], 0
mov edi, 0xffffffff
mov r9d, edi
mov r8d, edi
mov rdx, rbx
call qword [rax + 0x28]
mov rbx, rax
mov qword [rsp + 0xa8], rax
lea r13d, [rdi + 2]
lea r12, [0x140194508]
cmp dword [rax - 0x10], 0x104
jl 0x140040956
lea r8d, [rdi + 5]
lea rdx, [rsp + 0xb8]
lea rcx, [rsp + 0xa8]
call fcn.140032840
mov r14d, r13d
mov r9, qword [rax]
test r9, r9
je 0x140040950
movzx eax, word [r9]
cmp ax, 0x5c
jne 0x140040950
mov r8d, esi
mov rdx, rsi
mov rcx, rsi
cmp ax, word [rcx + r12]
jne 0x14004093d
inc r8d
inc rdx
lea rcx, [rdx + rdx]
movzx eax, word [rcx + r9]
test ax, ax
jne 0x140040922
movsxd rax, r8d
lea rcx, [rax + rax]
movzx eax, word [rcx + r12]
cmp word [rcx + r9], ax
je 0x140040956
movzx r15d, r13b
jmp 0x140040959
xor r15b, r15b
test r13b, r14b
je 0x14004099a
mov rdx, qword [rsp + 0xb8]
add rdx, 0xffffffffffffffe8
mov eax, dword [rdx + 0x10]
cmp eax, 0x7ffffc17
je 0x140040992
mov eax, dword [rdx + 0x10]
cmp eax, 0xffffffff
je 0x140040988
mov eax, edi
lock xadd dword [rdx + 0x10], eax
sub eax, 1
jg 0x140040992
mov rcx, qword [rdx]
mov rax, qword [rcx]
call qword [rax + reloc.OLEAUT32.dll_VariantClear]
nop
mov rbx, qword [rsp + 0xa8]
test r15b, r15b
je 0x140040aef
cmp dword [0x1401eb6c0], 0xb23a8c33
je 0x1400409da
mov ecx, 0x6c0
call fcn.1400f2ce0
mov qword [rsp + 0xb0], rax
test rax, rax
je 0x1400409d1
mov rcx, rax
call fcn.1400302c0
mov rsi, rax
mov qword [0x1401f7b90], rsi
jmp 0x1400409e1
mov rsi, qword [0x1401f7b90]
mov rax, qword [rsi]
mov byte [rsp + 0x30], 1
mov byte [rsp + 0x28], 0
mov byte [rsp + 0x20], 0
mov r9d, edi
mov r8d, edi
mov rdx, r12
mov rcx, rsi
call qword [rax + 0x28]
mov qword [rsp + 0xb0], rax
lea rdx, [rsp + 0xa8]
lea rcx, [rsp + 0x40]
call fcn.140006c10
mov rdx, rax
lea rcx, [rsp + 0x50]
call fcn.140043030
nop
mov r8, rax
lea rdx, [rsp + 0xb0]
lea rcx, [rsp + 0x48]
call fcn.140038110
nop
mov rdx, rax
lea rcx, [rsp + 0xa8]
call fcn.140030d70
nop
mov rdx, qword [rsp + 0x48]
add rdx, 0xffffffffffffffe8
mov eax, dword [rdx + 0x10]
cmp eax, 0x7ffffc17
je 0x140040a82
mov eax, dword [rdx + 0x10]
cmp eax, 0xffffffff
je 0x140040a78
mov eax, edi
lock xadd dword [rdx + 0x10], eax
sub eax, 1
jg 0x140040a82
mov rcx, qword [rdx]
mov rax, qword [rcx]
call qword [rax + reloc.OLEAUT32.dll_VariantClear]
nop
mov rdx, qword [rsp + 0x50]
add rdx, 0xffffffffffffffe8
mov eax, dword [rdx + 0x10]
cmp eax, 0x7ffffc17
je 0x140040ab3
mov eax, dword [rdx + 0x10]
cmp eax, 0xffffffff
je 0x140040aa9
mov eax, edi
lock xadd dword [rdx + 0x10], eax
sub eax, 1
jg 0x140040ab3
mov rcx, qword [rdx]
mov rax, qword [rcx]
call qword [rax + reloc.OLEAUT32.dll_VariantClear]
nop
mov rdx, qword [rsp + 0xb0]
add rdx, 0xffffffffffffffe8
mov eax, dword [rdx + 0x10]
cmp eax, 0x7ffffc17
je 0x140040ae7
mov eax, dword [rdx + 0x10]
cmp eax, 0xffffffff
je 0x140040add
mov eax, edi
lock xadd dword [rdx + 0x10], eax
sub eax, 1
jg 0x140040ae7
mov rcx, qword [rdx]
mov rax, qword [rcx]
call qword [rax + reloc.OLEAUT32.dll_VariantClear]
nop
mov rbx, qword [rsp + 0xa8]
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x140040b07
test al, 0x10
movzx ebp, bpl
cmove ebp, r13d
lea rdx, [rbx - 0x18]
mov eax, dword [rdx + 0x10]
cmp eax, 0x7ffffc17
je 0x140040b31
mov ecx, dword [rdx + 0x10]
cmp ecx, 0xffffffff
je 0x140040b27
lock xadd dword [rdx + 0x10], edi
sub edi, 1
jg 0x140040b31
mov rcx, qword [rdx]
mov rax, qword [rcx]
call qword [rax + reloc.OLEAUT32.dll_VariantClear]
nop
movzx eax, bpl
mov rbx, qword [rsp + 0xa0]
add rsp, 0x60
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret