Function at 0x1400326b8
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 0x140032edd
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.140030764
test eax, eax
je 0x140032edd
mov ecx, 0x26d6
call fcn.140015b74
lea rcx, [rbp - 0x48]
call fcn.140030614
mov qword [rbp - 0x80], rax
mov rsi, rax
test rax, rax
je 0x140032edd
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 0x140032ecc
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.140016868
lea rcx, str.setupapi.dll
call qword [sym.imp.KERNEL32.dll_LoadLibraryW]
test rax, rax
je 0x1400327eb
lea r9, [rbp - 0x78]
mov qword [rsp + 0x20], rax
xor r8d, r8d
mov rdx, rsi
mov rcx, r14
call fcn.14001b05c
jmp 0x1400327ee
mov eax, r13d
test eax, eax
je 0x140032eac
mov rdx, rsi
mov rcx, r14
mov r15d, 1
call fcn.14001aed0
mov ecx, eax
mov dword [rsp + 0x50], eax
mov esi, eax
call fcn.1400159e8
cmp esi, r15d
jb 0x140032eac
mov ecx, r15d
call fcn.140015aec
inc r15d
lea rcx, [rbp - 0x78]
mov dword [rsp + 0x4c], r15d
call fcn.140030614
mov qword [rsp + 0x68], rax
mov rsi, rax
test rax, rax
je 0x140032e9c
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 0x1400329ef
or rcx, 0xffffffffffffffff
mov rsi, rcx
inc rsi
cmp word [r15 + rsi*2], ax
jne 0x140032877
add rsi, 5
mov eax, 2
mul rsi
cmovo rax, rcx
mov rcx, rax
call fcn.14003c310
mov r14, rax
test rax, rax
je 0x1400329df
lea rdi, [r15 + 2]
jmp 0x1400328b4
cmp cx, word [rdi]
je 0x1400328c3
add rdi, 2
movzx ecx, word [rdi]
call qword [sym.imp.msvcrt.dll_iswalnum]
xor ecx, ecx
test eax, eax
je 0x1400328ab
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 0x1400328f8
lea rcx, [rax + 2]
call fcn.1400171c0
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 0x14003294b
mov rcx, qword [rsp + 0x70]
lea rdx, [rbp + 0x260]
mov r8d, 0x103
call fcn.140016ab0
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.140016868
jmp 0x1400329d1
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.140030764
test eax, eax
je 0x1400329c7
lea rcx, [rbp - 0x60]
call fcn.140030614
mov rdi, rax
test rax, rax
je 0x1400329c7
lea r8, [rbp + 0x260]
lea rcx, [rbp - 0x60]
call fcn.14003112c
test eax, eax
je 0x1400329b3
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.140016868
mov rcx, rdi
call fcn.14003c2b8
mov rdi, qword [rsp + 0x38]
mov qword [rsp + 0x40], rdi
jmp 0x1400329d1
mov rax, qword [rsp + 0x38]
mov qword [rsp + 0x40], rax
mov rcx, r14
call fcn.14003c2b8
mov edi, dword [rsp + 0x30]
jmp 0x1400329e1
xor esi, esi
mov word [r15], si
mov rsi, qword [rsp + 0x68]
mov r14, rsi
jmp 0x140032a03
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.140016868
test r12d, r12d
je 0x140032e4e
xor r13d, r13d
lea r8, [0x14003f4a0]
mov edx, 0x103
lea rcx, [rbp + 0x470]
mov r12d, r13d
call fcn.140001470
test r15, r15
je 0x140032e7b
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 0x140032a6a
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 0x140032b2f
sub ecx, 1
je 0x140032a99
sub ecx, 1
je 0x140032b2f
cmp ecx, 1
jne 0x140032bd5
mov edi, 0x104
lea r8, [rbp + 0x260]
mov edx, edi
lea rcx, [rbp + 0x50]
call fcn.140001470
test eax, eax
js 0x140032bbd
or rbx, 0xffffffffffffffff
lea rcx, [rbp + 0x50]
mov rax, rbx
inc rax
cmp word [rcx + rax*2], r13w
jne 0x140032ac3
test rax, rax
je 0x140032af8
cmp word [rbp + rax*2 + 0x4e], 0x5c
jne 0x140032af8
lea rcx, [rbp + 0x50]
mov rax, rbx
inc rax
cmp word [rcx + rax*2], r13w
jne 0x140032ae1
test rax, rax
je 0x140032af8
mov word [rbp + rax*2 + 0x4e], r13w
jmp 0x140032abc
lea rcx, [rbp + 0x50]
call qword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x140032bbd
test al, 0x10
je 0x140032bbd
mov r8d, edi
lea rdx, [rbp + 0x470]
lea rcx, [rbp + 0x260]
call qword [sym.imp.KERNEL32.dll_GetLongPathNameW]
jmp 0x140032bb4
mov edi, 0x104
lea r8, [rbp + 0x260]
mov edx, edi
lea rcx, [rbp + 0x50]
call fcn.140001470
test eax, eax
js 0x140032bbd
or rbx, 0xffffffffffffffff
lea rcx, [rbp + 0x50]
mov rax, rbx
inc rax
cmp word [rcx + rax*2], r13w
jne 0x140032b55
test rax, rax
je 0x140032b8a
cmp word [rbp + rax*2 + 0x4e], 0x5c
jne 0x140032b8a
lea rcx, [rbp + 0x50]
mov rax, rbx
inc rax
cmp word [rcx + rax*2], r13w
jne 0x140032b73
test rax, rax
je 0x140032b8a
mov word [rbp + rax*2 + 0x4e], r13w
jmp 0x140032b4e
lea rcx, [rbp + 0x50]
call qword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x140032bbd
test al, 0x10
je 0x140032bbd
mov r8d, edi
lea rdx, [rbp + 0x470]
lea rcx, [rbp + 0x260]
call qword [sym.imp.KERNEL32.dll_GetShortPathNameW]
dec eax
cmp eax, 0x103
jbe 0x140032bd5
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 0x140032c2d
lea rdx, str.SetupSetDirectoryIdW
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
test rax, rax
je 0x140032c1b
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 0x140032c2d
mov ebx, r13d
jmp 0x140032c53
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 0x140032e24
mov r15, qword [rsp + 0x78]
test r15, r15
je 0x140032e2a
cmp esi, 0x8000
jb 0x140032dcd
mov ecx, 0x18
call fcn.14003c2c4
mov rbx, rax
test rax, rax
jne 0x140032d07
mov rcx, qword [0x140050310]
or r15, 0xffffffffffffffff
cmp rcx, r15
jne 0x140032ca7
lea edx, [rax + 2]
call fcn.140016148
mov rcx, qword [0x140050310]
cmp rcx, r15
je 0x140032cd2
cmp dword [0x1400516e0], 2
jl 0x140032cd2
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.140016868
test r14, r14
mov r14, qword [rsp + 0x58]
jne 0x140032a33
jmp 0x140032e7b
or rcx, 0xffffffffffffffff
mov qword [rax], r13
mov rdi, rcx
lea rax, [rbp + 0x470]
inc rdi
cmp word [rax + rdi*2], r13w
jne 0x140032d18
inc rdi
mov eax, 2
mul rdi
cmovo rax, rcx
mov rcx, rax
call fcn.14003c310
mov qword [rbx + 8], rax
test rax, rax
jne 0x140032d9e
mov rcx, qword [0x140050310]
or r15, 0xffffffffffffffff
cmp rcx, r15
jne 0x140032d66
lea edx, [rax + 2]
call fcn.140016148
mov rcx, qword [0x140050310]
cmp rcx, r15
je 0x140032d91
cmp dword [0x1400516e0], 2
jl 0x140032d91
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.14003c304
jmp 0x140032cd2
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 0x140032dc1
mov qword [r15], rbx
jmp 0x140032dc4
mov qword [rax], rbx
mov qword [r15 + 8], rbx
mov ebx, r13d
jmp 0x140032e2a
mov rcx, qword [0x140050310]
or r15, 0xffffffffffffffff
cmp rcx, r15
jne 0x140032df2
lea edx, [r15 + 3]
call fcn.140016148
mov rcx, qword [0x140050310]
cmp rcx, r15
je 0x140032e1d
cmp dword [0x1400516e0], 2
jl 0x140032e1d
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 0x140032cd7
lea r9, [rbp + 0x470]
mov r8d, esi
lea rdx, str._Added_CustomDestination__lu_as__S._r_n
mov ecx, 4
call fcn.140016868
mov edi, dword [rsp + 0x30]
jmp 0x140032cf4
test r13b, 2
je 0x140032e61
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.140016868
xor r13d, r13d
mov rcx, qword [rsp + 0x68]
call fcn.14003c2b8
lea rdx, [rbp - 0x78]
lea rcx, [rbp - 0x78]
call qword [sym.imp.SETUPAPI.dll_SetupFindNextLine]
test eax, eax
je 0x140032ea7
mov r15d, dword [rsp + 0x4c]
cmp r15d, dword [rsp + 0x50]
jbe 0x14003281d
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 0x1400327ac
mov rcx, qword [rbp - 0x80]
call fcn.14003c2b8
test ebx, ebx
js 0x140032edd
test edi, edi
jne 0x140032edf
mov edi, ebx
mov eax, edi
mov rcx, qword [rbp + 0x680]
xor rcx, rsp
call fcn.14003c6c0
mov rbx, qword [rsp + 0x7d0]
add rsp, 0x790
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret