Function at 0x1400327a8
Capabilities:
Check if file exists
Get file attributes
Write file on windows

Disassembly:
mov qword [rsp + 8], rbx
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
lea rbp, [rsp - 0x690]
sub rsp, 0x790
mov rax, qword [0x1400502a8]
xor rax, rsp
mov qword [rbp + 0x680], rax
xor r13d, r13d
mov qword [rsp + 0x78], r9
or rax, 0xffffffffffffffff
mov qword [rsp + 0x70], rcx
mov qword [rsp + 0x38], rdx
mov ebx, 1
mov dword [rsp + 0x30], r13d
mov edi, r13d
cmp rdx, rax
je 0x140032fd1
test r8, r8
mov dword [rsp + 0x28], ebx
lea rax, str.CUSTOMDESTINATION
lea r9, str.DEFAULTINSTALL
mov qword [rsp + 0x20], rax
cmovne r9, r8
lea rdx, [rsp + 0x38]
lea r8, [rbp - 0x48]
xor ecx, ecx
call fcn.140030854
test eax, eax
je 0x140032fd1
mov ecx, 0x26d6
call fcn.140015bb4
lea rcx, [rbp - 0x48]
call fcn.140030704
mov qword [rbp - 0x80], rax
mov rsi, rax
test rax, rax
je 0x140032fd1
xor edx, edx
lea rcx, [rbp + 0x260]
mov r8d, 0x208
call sub.msvcrt.dll_memset
lea rdx, [0x140043808]
mov rcx, rsi
call qword [sym.imp.msvcrt.dll_wcstok]
mov qword [rsp + 0x60], rax
mov rsi, rax
test rax, rax
je 0x140032fc0
mov r14, qword [rsp + 0x38]
mov qword [rsp + 0x40], r14
mov r8, rsi
lea rdx, str._Parsing_CustomDestination_INFSection:_S_r_n
mov ecx, 4
call fcn.1400168a8
lea rcx, str.setupapi.dll
call qword [sym.imp.KERNEL32.dll_LoadLibraryW]
test rax, rax
je 0x1400328db
lea r9, [rbp - 0x78]
mov qword [rsp + 0x20], rax
xor r8d, r8d
mov rdx, rsi
mov rcx, r14
call fcn.14001b0b0
jmp 0x1400328de
mov eax, r13d
test eax, eax
je 0x140032fa0
mov rdx, rsi
mov rcx, r14
mov r15d, 1
call fcn.14001af24
mov ecx, eax
mov dword [rsp + 0x50], eax
mov esi, eax
call fcn.140015a28
cmp esi, r15d
jb 0x140032fa0
mov ecx, r15d
call fcn.140015b2c
inc r15d
lea rcx, [rbp - 0x78]
mov dword [rsp + 0x4c], r15d
call fcn.140030704
mov qword [rsp + 0x68], rax
mov rsi, rax
test rax, rax
je 0x140032f90
lea rdx, [0x140047e08]
mov qword [rsp + 0x58], rax
mov rcx, rax
mov r14, rax
call qword [sym.imp.msvcrt.dll_wcsstr]
mov r15, rax
mov r12d, r13d
xor eax, eax
test r15, r15
je 0x140032adf
or rcx, 0xffffffffffffffff
mov rsi, rcx
inc rsi
cmp word [r15 + rsi*2], ax
jne 0x140032967
add rsi, 5
mov eax, 2
mul rsi
cmovo rax, rcx
mov rcx, rax
call fcn.14003c460
mov r14, rax
test rax, rax
je 0x140032acf
lea rdi, [r15 + 2]
jmp 0x1400329a4
cmp cx, word [rdi]
je 0x1400329b3
add rdi, 2
movzx ecx, word [rdi]
call qword [sym.imp.msvcrt.dll_iswalnum]
xor ecx, ecx
test eax, eax
je 0x14003299b
mov r8, rdi
mov rdx, rsi
mov rcx, r14
call fcn.140001470
mov edx, 0x2c
mov rcx, r14
call qword [sym.imp.msvcrt.dll_wcschr]
xor esi, esi
mov rdi, rax
test rax, rax
je 0x1400329e8
lea rcx, [rax + 2]
call fcn.140017200
mov r13d, eax
mov word [rdi], si
lea rdx, str.SourceDir
mov rcx, r14
call qword [sym.imp.msvcrt.dll__wcsicmp]
test eax, eax
jne 0x140032a3b
mov rcx, qword [rsp + 0x70]
lea rdx, [rbp + 0x260]
mov r8d, 0x103
call fcn.140016af0
mov r9, qword [rsp + 0x60]
lea r8, [rbp + 0x260]
mov r12d, 1
lea rdx, str._Assigned_destination:__S_for_section__S_r_n
lea ecx, [r12 + 3]
call fcn.1400168a8
jmp 0x140032ac1
mov dword [rsp + 0x28], esi
lea r8, [rbp - 0x60]
mov r9, r14
mov qword [rsp + 0x20], rsi
lea rdx, [rsp + 0x38]
xor ecx, ecx
call fcn.140030854
test eax, eax
je 0x140032ab7
lea rcx, [rbp - 0x60]
call fcn.140030704
mov rdi, rax
test rax, rax
je 0x140032ab7
lea r8, [rbp + 0x260]
lea rcx, [rbp - 0x60]
call fcn.14003121c
test eax, eax
je 0x140032aa3
mov r9, qword [rsp + 0x60]
lea r8, [rbp + 0x260]
mov r12d, 1
lea rdx, str._Assigned_destination:__S_for_section__S_r_n
lea ecx, [r12 + 3]
call fcn.1400168a8
mov rcx, rdi
call fcn.14003c408
mov rdi, qword [rsp + 0x38]
mov qword [rsp + 0x40], rdi
jmp 0x140032ac1
mov rax, qword [rsp + 0x38]
mov qword [rsp + 0x40], rax
mov rcx, r14
call fcn.14003c408
mov edi, dword [rsp + 0x30]
jmp 0x140032ad1
xor esi, esi
mov word [r15], si
mov rsi, qword [rsp + 0x68]
mov r14, rsi
jmp 0x140032af3
mov r8, rsi
lea rdx, str.ERROR:_CustomDestination__S_not_settable:_LDIDs_require_8_characters_previous_to__due_to_setupapi._r_n
mov ecx, 2
call fcn.1400168a8
test r12d, r12d
je 0x140032f42
xor r13d, r13d
lea r8, [0x14003f4a0]
mov edx, 0x103
lea rcx, [rbp + 0x470]
mov r12d, r13d
call fcn.140001470
test r15, r15
je 0x140032f6f
mov r8, r14
lea rcx, [rbp - 0x30]
mov edx, 0x3f
call fcn.140001470
lea rdx, [0x140043808]
lea rcx, [rbp - 0x30]
call qword [sym.imp.msvcrt.dll_wcsstr]
mov r14, rax
test rax, rax
je 0x140032b5a
add rax, 2
mov word [r14], r13w
mov qword [rsp + 0x58], rax
lea rcx, [rbp - 0x30]
call qword [sym.imp.msvcrt.dll__wtol]
mov ecx, r12d
mov esi, eax
test r12d, r12d
je 0x140032c21
sub ecx, 1
je 0x140032b89
sub ecx, 1
je 0x140032c21
cmp ecx, 1
jne 0x140032cc9
mov r15d, 0x104
lea r8, [rbp + 0x260]
mov edx, r15d
lea rcx, [rbp + 0x50]
call fcn.140001470
test eax, eax
js 0x140032cb1
or rdx, 0xffffffffffffffff
lea rcx, [rbp + 0x50]
mov rax, rdx
inc rax
cmp word [rcx + rax*2], r13w
jne 0x140032bb5
test rax, rax
je 0x140032bea
cmp word [rbp + rax*2 + 0x4e], 0x5c
jne 0x140032bea
lea rcx, [rbp + 0x50]
mov rax, rdx
inc rax
cmp word [rcx + rax*2], r13w
jne 0x140032bd3
test rax, rax
je 0x140032bea
mov word [rbp + rax*2 + 0x4e], r13w
jmp 0x140032bae
lea rcx, [rbp + 0x50]
call qword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x140032cb1
test al, 0x10
je 0x140032cb1
mov r8d, r15d
lea rdx, [rbp + 0x470]
lea rcx, [rbp + 0x260]
call qword [sym.imp.KERNEL32.dll_GetLongPathNameW]
jmp 0x140032ca8
mov r15d, 0x104
lea r8, [rbp + 0x260]
mov edx, r15d
lea rcx, [rbp + 0x50]
call fcn.140001470
test eax, eax
js 0x140032cb1
or rdx, 0xffffffffffffffff
lea rcx, [rbp + 0x50]
mov rax, rdx
inc rax
cmp word [rcx + rax*2], r13w
jne 0x140032c49
test rax, rax
je 0x140032c7e
cmp word [rbp + rax*2 + 0x4e], 0x5c
jne 0x140032c7e
lea rcx, [rbp + 0x50]
mov rax, rdx
inc rax
cmp word [rcx + rax*2], r13w
jne 0x140032c67
test rax, rax
je 0x140032c7e
mov word [rbp + rax*2 + 0x4e], r13w
jmp 0x140032c42
lea rcx, [rbp + 0x50]
call qword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x140032cb1
test al, 0x10
je 0x140032cb1
mov r8d, r15d
lea rdx, [rbp + 0x470]
lea rcx, [rbp + 0x260]
call qword [sym.imp.KERNEL32.dll_GetShortPathNameW]
dec eax
cmp eax, 0x103
jbe 0x140032cc9
lea r8, [rbp + 0x260]
mov edx, 0x103
lea rcx, [rbp + 0x470]
call fcn.140001470
lea rcx, str.setupapi.dll
inc r12d
mov edi, r13d
call qword [sym.imp.KERNEL32.dll_LoadLibraryW]
mov rbx, rax
test rax, rax
je 0x140032d21
lea rdx, str.SetupSetDirectoryIdW
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
test rax, rax
je 0x140032d0f
mov rcx, qword [rsp + 0x40]
lea r8, [rbp + 0x470]
mov edx, esi
call qword [0x14003f118]
mov edi, eax
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_FreeLibrary]
test edi, edi
je 0x140032d21
mov ebx, r13d
jmp 0x140032d47
call qword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
mov ecx, 0x57
cmove eax, ecx
movzx ebx, ax
or ebx, 0x80070000
test eax, eax
cmovle ebx, eax
test ebx, ebx
jne 0x140032f18
mov r15, qword [rsp + 0x78]
test r15, r15
je 0x140032f1e
cmp esi, 0x8000
jb 0x140032ec1
mov ecx, 0x18
call fcn.14003c414
mov rbx, rax
test rax, rax
jne 0x140032dfb
mov rcx, qword [0x140050310]
or r15, 0xffffffffffffffff
cmp rcx, r15
jne 0x140032d9b
lea edx, [rax + 2]
call fcn.140016188
mov rcx, qword [0x140050310]
cmp rcx, r15
je 0x140032dc6
cmp dword [0x1400516e0], 2
jl 0x140032dc6
lea r9, [rsp + 0x30]
mov dword [rsp + 0x30], r13d
mov r8d, 0x17
mov qword [rsp + 0x20], r13
lea rdx, str.ERROR:_Out_of_memory._r_n
call qword [sym.imp.KERNEL32.dll_WriteFile]
mov ebx, 0x8007000e
mov r9d, ebx
mov dword [rsp + 0x30], ebx
mov r8d, esi
lea rdx, str.ERROR:_Could_not_set_CustomDestination__lu._Result:_0x_x._r_n
mov ecx, 2
mov edi, ebx
call fcn.1400168a8
test r14, r14
mov r14, qword [rsp + 0x58]
jne 0x140032b23
jmp 0x140032f6f
or rcx, 0xffffffffffffffff
mov qword [rax], r13
mov rdi, rcx
lea rax, [rbp + 0x470]
inc rdi
cmp word [rax + rdi*2], r13w
jne 0x140032e0c
inc rdi
mov eax, 2
mul rdi
cmovo rax, rcx
mov rcx, rax
call fcn.14003c460
mov qword [rbx + 8], rax
test rax, rax
jne 0x140032e92
mov rcx, qword [0x140050310]
or r15, 0xffffffffffffffff
cmp rcx, r15
jne 0x140032e5a
lea edx, [rax + 2]
call fcn.140016188
mov rcx, qword [0x140050310]
cmp rcx, r15
je 0x140032e85
cmp dword [0x1400516e0], 2
jl 0x140032e85
lea r9, [rsp + 0x30]
mov dword [rsp + 0x30], r13d
mov r8d, 0x17
mov qword [rsp + 0x20], r13
lea rdx, str.ERROR:_Out_of_memory._r_n
call qword [sym.imp.KERNEL32.dll_WriteFile]
mov rcx, rbx
call fcn.14003c454
jmp 0x140032dc6
lea r8, [rbp + 0x470]
mov rdx, rdi
mov rcx, rax
call fcn.140001470
mov dword [rbx + 0x10], esi
mov rax, qword [r15 + 8]
test rax, rax
jne 0x140032eb5
mov qword [r15], rbx
jmp 0x140032eb8
mov qword [rax], rbx
mov qword [r15 + 8], rbx
mov ebx, r13d
jmp 0x140032f1e
mov rcx, qword [0x140050310]
or r15, 0xffffffffffffffff
cmp rcx, r15
jne 0x140032ee6
lea edx, [r15 + 3]
call fcn.140016188
mov rcx, qword [0x140050310]
cmp rcx, r15
je 0x140032f11
cmp dword [0x1400516e0], 2
jl 0x140032f11
lea r9, [rsp + 0x48]
mov dword [rsp + 0x48], r13d
mov r8d, 0x38
mov qword [rsp + 0x20], r13
lea rdx, str.ERROR:_Invalid_arguments_passed_to_AddDirectoryToList._r_n
call qword [sym.imp.KERNEL32.dll_WriteFile]
mov ebx, 0x80004003
test ebx, ebx
js 0x140032dcb
lea r9, [rbp + 0x470]
mov r8d, esi
lea rdx, str._Added_CustomDestination__lu_as__S._r_n
mov ecx, 4
call fcn.1400168a8
mov edi, dword [rsp + 0x30]
jmp 0x140032de8
test r13b, 2
je 0x140032f55
mov eax, 0x80070003
mov ebx, eax
mov dword [rsp + 0x30], eax
mov edi, eax
mov r9d, edi
lea rdx, str.ERROR:_Could_not_set_CustomDestination__S._Result:_0x_x._r_n
mov r8, rsi
mov ecx, 2
call fcn.1400168a8
xor r13d, r13d
mov rcx, qword [rsp + 0x68]
call fcn.14003c408
lea rdx, [rbp - 0x78]
lea rcx, [rbp - 0x78]
call qword [sym.imp.SETUPAPI.dll_SetupFindNextLine]
test eax, eax
je 0x140032f9b
mov r15d, dword [rsp + 0x4c]
cmp r15d, dword [rsp + 0x50]
jbe 0x14003290d
mov r14, qword [rsp + 0x40]
lea rdx, [0x140043808]
xor ecx, ecx
call qword [sym.imp.msvcrt.dll_wcstok]
mov qword [rsp + 0x60], rax
mov rsi, rax
test rax, rax
jne 0x14003289c
mov rcx, qword [rbp - 0x80]
call fcn.14003c408
test ebx, ebx
js 0x140032fd1
test edi, edi
jne 0x140032fd3
mov edi, ebx
mov eax, edi
mov rcx, qword [rbp + 0x680]
xor rcx, rsp
call fcn.14003c810
mov rbx, qword [rsp + 0x7d0]
add rsp, 0x790
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret