Function at 0x140016b20
Capabilities:
Check if file exists
Create directory
Get file attributes

Disassembly:
mov qword [rsp + 8], rcx
push rsi
push rdi
sub rsp, 0xa8
mov dword [rsp + 0x58], 0
mov rax, qword [rsp + 0xc0]
mov rcx, qword [rax + 0x158]
call fcn.14001d820
mov qword [rsp + 0x70], rax
cmp qword [rsp + 0x70], 0
je 0x140016e04
mov rax, qword [rsp + 0x70]
mov qword [rsp + 0x98], rax
mov qword [rsp + 0x80], 0xffffffffffffffff
inc qword [rsp + 0x80]
mov rax, qword [rsp + 0x98]
mov rcx, qword [rsp + 0x80]
cmp word [rax + rcx*2], 0
jne 0x140016b74
mov rax, qword [rsp + 0x80]
lea rax, [rax + rax + 2]
mov qword [rsp + 0x90], rax
mov rcx, qword [rsp + 0x90]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
mov qword [rsp + 0x68], rax
cmp qword [rsp + 0x68], 0
jne 0x140016be9
mov rax, qword [rsp + 0xc0]
lea r8, str.Cant_allocate_memory_for_hardlink_target
mov edx, 0xc
mov rcx, rax
call fcn.14000a870
mov eax, 0xffffffff
jmp 0x140017316
mov rdi, qword [rsp + 0x68]
mov rsi, qword [rsp + 0x70]
mov rcx, qword [rsp + 0x90]
rep movsb byte [rdi], byte [rsi]
mov rdx, qword [rsp + 0x68]
mov rcx, qword [rsp + 0xc0]
call fcn.140017380
mov dword [rsp + 0x40], eax
cmp dword [rsp + 0x40], 0
je 0x140016c2e
mov rcx, qword [rsp + 0x68]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov eax, dword [rsp + 0x40]
jmp 0x140017316
mov rcx, qword [rsp + 0x68]
call fcn.140041ab0
mov qword [rsp + 0x88], rax
mov rcx, qword [rsp + 0x68]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov rax, qword [rsp + 0xc0]
mov rcx, qword [rax + 0x160]
call fcn.140041ab0
mov qword [rsp + 0x60], rax
cmp qword [rsp + 0x88], 0
je 0x140016c77
cmp qword [rsp + 0x60], 0
jne 0x140016c90
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
mov dword [rax], 0x16
mov dword [rsp + 0x40], 0xffffffff
jmp 0x140016d1e
mov rax, qword [rsp + 0xc0]
mov eax, dword [rax + 0x1a8]
and eax, 0x40000
test eax, eax
je 0x140016cde
mov rcx, qword [rsp + 0x60]
call qword [sym.imp.KERNEL32.dll_GetFileAttributesW]
mov dword [rsp + 0x58], eax
cmp dword [rsp + 0x58], 0xffffffff
je 0x140016cde
mov eax, dword [rsp + 0x58]
and eax, 0x10
test eax, eax
je 0x140016cd4
mov rcx, qword [rsp + 0x60]
call fcn.140016590
jmp 0x140016cde
mov rcx, qword [rsp + 0x60]
call fcn.140016520
mov rdx, qword [rsp + 0x88]
mov rcx, qword [rsp + 0x60]
call fcn.14001c140
mov dword [rsp + 0x40], eax
cmp dword [rsp + 0x40], 0
jne 0x140016d16
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, eax
call fcn.140041ed0
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
mov eax, dword [rax]
mov dword [rsp + 0x40], eax
jmp 0x140016d1e
mov dword [rsp + 0x40], 0
cmp dword [rsp + 0x40], 0
jne 0x140016d60
mov rax, qword [rsp + 0xc0]
cmp qword [rax + 0x1d0], 0
jg 0x140016d60
mov rax, qword [rsp + 0xc0]
mov dword [rax + 0x1a0], 0
mov rax, qword [rsp + 0xc0]
mov dword [rax + 0x1a4], 0
jmp 0x140016de2
cmp dword [rsp + 0x40], 0
jne 0x140016de2
mov rax, qword [rsp + 0xc0]
cmp qword [rax + 0x1d0], 0
jle 0x140016de2
mov qword [rsp + 0x30], 0
mov dword [rsp + 0x28], 0x80
mov dword [rsp + 0x20], 5
xor r9d, r9d
xor r8d, r8d
mov edx, 0x40000000
mov rcx, qword [rsp + 0x60]
call qword [sym.imp.KERNEL32.dll_CreateFileW]
mov rcx, qword [rsp + 0xc0]
mov qword [rcx + 0x1b0], rax
mov rax, qword [rsp + 0xc0]
cmp qword [rax + 0x1b0], 0xffffffffffffffff
jne 0x140016de2
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, eax
call fcn.140041ed0
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
mov eax, dword [rax]
mov dword [rsp + 0x40], eax
mov rcx, qword [rsp + 0x88]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov rcx, qword [rsp + 0x60]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov eax, dword [rsp + 0x40]
jmp 0x140017316
mov rax, qword [rsp + 0xc0]
mov rcx, qword [rax + 0x158]
call fcn.14001de00
mov qword [rsp + 0x70], rax
cmp qword [rsp + 0x70], 0
je 0x140016efc
mov rax, qword [rsp + 0xc0]
mov rcx, qword [rax + 0x160]
call qword [sym.imp.KERNEL32.dll_GetFileAttributesW]
mov dword [rsp + 0x58], eax
cmp dword [rsp + 0x58], 0xffffffff
je 0x140016e7e
mov eax, dword [rsp + 0x58]
and eax, 0x10
test eax, eax
je 0x140016e6a
mov rax, qword [rsp + 0xc0]
mov rcx, qword [rax + 0x160]
call fcn.140016590
jmp 0x140016e7e
mov rax, qword [rsp + 0xc0]
mov rcx, qword [rax + 0x160]
call fcn.140016520
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
mov dword [rax], 0
mov rax, qword [rsp + 0xc0]
mov rcx, qword [rax + 0x158]
call fcn.14001dde0
mov r8d, eax
mov rdx, qword [rsp + 0x70]
mov rax, qword [rsp + 0xc0]
mov rcx, qword [rax + 0x160]
call fcn.14001c3b0
mov dword [rsp + 0x40], eax
cmp dword [rsp + 0x40], 0
jne 0x140016eeb
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
cmp dword [rax], 0
jne 0x140016edd
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, eax
call fcn.140041ed0
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
mov eax, dword [rax]
mov dword [rsp + 0x40], eax
jmp 0x140016ef3
mov dword [rsp + 0x40], 0
mov eax, dword [rsp + 0x40]
jmp 0x140017316
mov rax, qword [rsp + 0xc0]
movzx eax, word [rax + 0x1dc]
and eax, 0xfff
mov word [rsp + 0x48], ax
movzx eax, word [rsp + 0x48]
and eax, 0x1ff
mov rcx, qword [rsp + 0xc0]
movzx ecx, word [rcx + 0x90]
not ecx
and eax, ecx
mov word [rsp + 0x44], ax
mov rax, qword [rsp + 0xc0]
movzx eax, word [rax + 0x1dc]
and eax, 0xf000
mov dword [rsp + 0x5c], eax
cmp dword [rsp + 0x5c], 0x1000
je 0x1400172cd
cmp dword [rsp + 0x5c], 0x2000
je 0x140017124
cmp dword [rsp + 0x5c], 0x4000
je 0x14001712e
cmp dword [rsp + 0x5c], 0x6000
je 0x140017124
mov rax, qword [rsp + 0xc0]
mov qword [rax + 0x180], 0
mov rax, qword [rsp + 0xc0]
mov rax, qword [rax + 0x160]
mov qword [rsp + 0x50], rax
mov qword [rsp + 0x30], 0
mov dword [rsp + 0x28], 0x80
mov dword [rsp + 0x20], 1
xor r9d, r9d
xor r8d, r8d
mov edx, 0x40000000
mov rcx, qword [rsp + 0x50]
call qword [sym.imp.KERNEL32.dll_CreateFileW]
mov rcx, qword [rsp + 0xc0]
mov qword [rcx + 0x1b0], rax
mov rax, qword [rsp + 0xc0]
cmp qword [rax + 0x1b0], 0xffffffffffffffff
jne 0x140017076
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x7b
jne 0x140017076
mov rax, qword [rsp + 0xc0]
mov rax, qword [rax + 0x160]
cmp qword [rsp + 0x50], rax
jne 0x140017076
mov rax, qword [rsp + 0xc0]
mov rcx, qword [rax + 0x160]
call fcn.140041ab0
mov qword [rsp + 0x50], rax
mov qword [rsp + 0x30], 0
mov dword [rsp + 0x28], 0x80
mov dword [rsp + 0x20], 1
xor r9d, r9d
xor r8d, r8d
mov edx, 0x40000000
mov rcx, qword [rsp + 0x50]
call qword [sym.imp.KERNEL32.dll_CreateFileW]
mov rcx, qword [rsp + 0xc0]
mov qword [rcx + 0x1b0], rax
mov rax, qword [rsp + 0xc0]
cmp qword [rax + 0x1b0], 0xffffffffffffffff
jne 0x1400170f6
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 5
jne 0x1400170df
mov rcx, qword [rsp + 0x50]
call qword [sym.imp.KERNEL32.dll_GetFileAttributesW]
mov dword [rsp + 0x78], eax
cmp dword [rsp + 0x78], 0xffffffff
jne 0x1400170b8
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, eax
call fcn.140041ed0
jmp 0x1400170dd
mov eax, dword [rsp + 0x78]
and eax, 0x10
test eax, eax
je 0x1400170d1
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
mov dword [rax], 0x15
jmp 0x1400170dd
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
mov dword [rax], 0xd
jmp 0x1400170ec
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, eax
call fcn.140041ed0
mov dword [rsp + 0x40], 1
jmp 0x1400170fe
mov dword [rsp + 0x40], 0
mov rax, qword [rsp + 0xc0]
mov rax, qword [rax + 0x160]
cmp qword [rsp + 0x50], rax
je 0x14001711f
mov rcx, qword [rsp + 0x50]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
jmp 0x1400172d4
mov eax, 0x16
jmp 0x140017316
movzx eax, word [rsp + 0x44]
or eax, 0x1c0
and eax, 0x1fd
mov word [rsp + 0x44], ax
mov rax, qword [rsp + 0xc0]
mov rax, qword [rax + 0x160]
mov qword [rsp + 0x50], rax
xor edx, edx
mov rcx, qword [rsp + 0x50]
call qword [sym.imp.KERNEL32.dll_CreateDirectoryW]
mov dword [rsp + 0x40], eax
cmp dword [rsp + 0x40], 0
jne 0x1400171b9
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x7b
jne 0x1400171b9
mov rax, qword [rsp + 0xc0]
mov rax, qword [rax + 0x160]
cmp qword [rsp + 0x50], rax
jne 0x1400171b9
mov rax, qword [rsp + 0xc0]
mov rcx, qword [rax + 0x160]
call fcn.140041ab0
mov qword [rsp + 0x50], rax
xor edx, edx
mov rcx, qword [rsp + 0x50]
call qword [sym.imp.KERNEL32.dll_CreateDirectoryW]
mov dword [rsp + 0x40], eax
cmp dword [rsp + 0x40], 0
je 0x140017295
mov dword [rsp + 0x40], 0
mov rax, qword [rsp + 0xc0]
mov eax, dword [rax + 0x1a0]
and eax, 4
mov rcx, qword [rsp + 0xc0]
mov ecx, dword [rcx + 0x1a4]
or ecx, eax
mov eax, ecx
mov rcx, qword [rsp + 0xc0]
mov dword [rcx + 0x1a4], eax
mov rax, qword [rsp + 0xc0]
mov eax, dword [rax + 0x1a0]
and eax, 0xfffffffb
mov rcx, qword [rsp + 0xc0]
mov dword [rcx + 0x1a0], eax
movzx eax, word [rsp + 0x44]
movzx ecx, word [rsp + 0x48]
cmp eax, ecx
jne 0x14001723f
mov rax, qword [rsp + 0xc0]
mov eax, dword [rax + 0x1a8]
and eax, 2
test eax, eax
je 0x140017272
mov rax, qword [rsp + 0xc0]
mov eax, dword [rax + 0x1a0]
and eax, 0x34000000
mov rcx, qword [rsp + 0xc0]
mov ecx, dword [rcx + 0x1a4]
or ecx, eax
mov eax, ecx
mov rcx, qword [rsp + 0xc0]
mov dword [rcx + 0x1a4], eax
mov rax, qword [rsp + 0xc0]
mov eax, dword [rax + 0x1a0]
and eax, 0xcbffffff
mov rcx, qword [rsp + 0xc0]
mov dword [rcx + 0x1a0], eax
jmp 0x1400172aa
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, eax
call fcn.140041ed0
mov dword [rsp + 0x40], 0xffffffff
mov rax, qword [rsp + 0xc0]
mov rax, qword [rax + 0x160]
cmp qword [rsp + 0x50], rax
je 0x1400172cb
mov rcx, qword [rsp + 0x50]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
jmp 0x1400172d4
mov eax, 0x16
jmp 0x140017316
cmp dword [rsp + 0x40], 0
je 0x1400172e5
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
mov eax, dword [rax]
jmp 0x140017316
movzx eax, word [rsp + 0x44]
movzx ecx, word [rsp + 0x48]
cmp eax, ecx
jne 0x140017314
mov rax, qword [rsp + 0xc0]
mov eax, dword [rax + 0x1a0]
and eax, 0xcbffffff
mov rcx, qword [rsp + 0xc0]
mov dword [rcx + 0x1a0], eax
xor eax, eax
add rsp, 0xa8
pop rdi
pop rsi
ret