Function at 0x140039495
Capabilities:
Get common file path

Disassembly:
push r15
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x218
xor eax, eax
mov qword [rsp + 0x58], rax
mov r12d, ecx
mov r13, rdx
mov rbx, r8
mov dword [rsp + 0x278], r9d
mov qword [rsp + 0x60], rax
mov qword [rsp + 0x68], rax
test r8, r8
jne 0x1400394d6
xor ebx, ebx
jmp 0x140039ae3
mov rcx, qword [r8]
test rcx, rcx
je 0x1400394cf
cmp qword [r8 + 0x10], 0
je 0x1400394cf
cmp qword [r8 + 0x18], 0
je 0x1400394cf
mov rbp, qword [0x1400b16f0]
inc rcx
mov edx, 0x10
inc dword [rbp]
call sub.msvcrt.dll_calloc
mov rsi, rax
test rax, rax
je 0x14003989c
mov rdi, rax
mov r14, rax
xor r15d, r15d
cmp r15, qword [rbx]
jae 0x140039548
mov rax, qword [rbx + 0x10]
add r14, 0x10
mov rcx, qword [rax + r15*8]
call fcn.1400389b3
mov qword [r14 - 8], rax
mov rax, qword [rbx + 0x18]
mov rcx, qword [rax + r15*8]
inc r15
call fcn.1400389b3
mov qword [r14 - 0x10], rax
jmp 0x140039518
lea rax, [0x1400984c0]
mov ecx, 0xc23
mov qword [r14 + 8], rax
call fcn.14001d5c1
mov rcx, rax
call fcn.1400389b3
mov rcx, qword [str.P__v_]
mov qword [r14], rax
test r12d, r12d
je 0x14003957b
mov rcx, qword [str.p__v_]
lea rax, [rsp + 0x58]
mov r9, qword [str._j_v_]
mov r8d, 3
xor edx, edx
mov qword [rsp + 0x20], rax
call qword [sym.imp.ole32.dll_CoCreateInstance]
mov ecx, eax
test eax, eax
jns 0x1400395db
call qword [sym.imp.KERNEL32.DLL_SetLastError]
call fcn.140036bd7
lea rcx, str.CoCreateInstance_for_FileOpenDialog_failed:__s_n
mov rdx, rax
call fcn.140036717
mov rcx, qword [rsp + 0x58]
test rcx, rcx
je 0x1400398b2
mov rax, qword [rcx]
xor r15d, r15d
call qword [rax + 0x10]
mov qword [rsp + 0x58], r15
jmp 0x1400398b2
mov eax, dword [rbx]
mov rcx, qword [rsp + 0x58]
mov r8, rsi
lea edx, [rax + 1]
mov rax, qword [rcx]
call qword [rax + 0x20]
test r13, r13
jne 0x140039670
movabs rax, 0x4565123f374de290
xor r8d, r8d
xor edx, edx
mov qword [rsp + 0x108], rax
lea rcx, [rsp + 0x108]
lea r9, [rsp + 0x60]
movabs rax, 0x7b465e92c4396491
mov qword [rsp + 0x110], rax
call sub.SHELL32.dll_SHGetKnownFolderPath
test eax, eax
js 0x1400396ba
xor edx, edx
mov rcx, qword [rsp + 0x60]
lea r9, [rsp + 0x68]
mov r8, qword [0x1400b1170]
call qword [sym.imp.SHELL32.dll_SHCreateItemFromParsingName]
test eax, eax
js 0x140039663
mov rcx, qword [rsp + 0x58]
mov rdx, qword [rsp + 0x68]
mov rax, qword [rcx]
call qword [rax + 0x58]
mov rcx, qword [rsp + 0x60]
call qword [sym.imp.ole32.dll_CoTaskMemFree]
jmp 0x1400396ba
mov rcx, r13
call fcn.1400389b3
xor edx, edx
lea r9, [rsp + 0x68]
mov r8, qword [0x1400b1170]
mov qword [rsp + 0x60], rax
mov rcx, rax
call qword [sym.imp.SHELL32.dll_SHCreateItemFromParsingName]
test eax, eax
js 0x1400396a8
mov rcx, qword [rsp + 0x58]
mov rdx, qword [rsp + 0x68]
mov rax, qword [rcx]
call qword [rax + 0x60]
mov rcx, qword [rsp + 0x60]
xor r14d, r14d
call sub.msvcrt.dll_free
mov qword [rsp + 0x60], r14
mov rcx, qword [rbx + 8]
test rcx, rcx
jne 0x1400396ca
lea rcx, [0x1400984b5]
call fcn.1400389b3
mov r15, rax
test rax, rax
je 0x1400396e5
mov rcx, qword [rsp + 0x58]
mov rdx, r15
mov rax, qword [rcx]
call qword [rax + 0x78]
mov rcx, qword [rsp + 0x58]
mov rdx, qword [0x1400b19c0]
mov rax, qword [rcx]
mov rdx, qword [rdx]
call qword [rax + 0x18]
mov rcx, r15
xor r15d, r15d
mov r14d, eax
call sub.msvcrt.dll_free
cmp r15, qword [rbx]
jae 0x140039736
mov rcx, qword [rdi + 8]
inc r15
add rdi, 0x10
call sub.msvcrt.dll_free
xor r10d, r10d
mov rcx, qword [rdi - 0x10]
mov qword [rdi - 8], r10
call sub.msvcrt.dll_free
xor r11d, r11d
mov qword [rdi - 0x10], r11
jmp 0x140039708
mov rcx, qword [rdi]
call sub.msvcrt.dll_free
xor r9d, r9d
mov rcx, rsi
mov qword [rdi], r9
call sub.msvcrt.dll_free
test r14d, r14d
js 0x140039877
mov rcx, qword [rsp + 0x58]
lea rdx, [rsp + 0x108]
mov rax, qword [rcx]
call qword [rax + 0xa0]
test eax, eax
js 0x1400398a0
mov rcx, qword [rsp + 0x108]
lea r8, [rsp + 0x60]
mov edx, 0x80058000
mov rax, qword [rcx]
call qword [rax + 0x28]
mov ecx, eax
test eax, eax
js 0x14003984b
mov r12, qword [rsp + 0x60]
cmp word [r12], 0
jne 0x1400397b9
mov edx, 1
mov ecx, 1
call sub.msvcrt.dll_calloc
mov rbx, rax
jmp 0x14003983e
xor edx, edx
xor ecx, ecx
xor r8d, r8d
mov r13, qword [sym.imp.KERNEL32.DLL_WideCharToMultiByte]
mov qword [rsp + 0x38], rdx
or r9d, 0xffffffff
mov qword [rsp + 0x30], rdx
xor edx, edx
mov dword [rsp + 0x28], ecx
mov ecx, 0xfde9
mov qword [rsp + 0x20], r8
mov r8, r12
call r13
mov edi, eax
cmp eax, 1
jle 0x14003983c
movsxd rcx, eax
mov edx, 1
call sub.msvcrt.dll_calloc
mov rsi, rax
mov rbx, rax
test rax, rax
je 0x14003983c
xor eax, eax
or r9d, 0xffffffff
xor edx, edx
mov dword [rsp + 0x28], edi
mov qword [rsp + 0x38], rax
mov r8, r12
mov ecx, 0xfde9
mov qword [rsp + 0x30], rax
mov qword [rsp + 0x20], rsi
call r13
cmp edi, eax
je 0x14003983e
mov rcx, rsi
call sub.msvcrt.dll_free
xor ebx, ebx
mov rcx, qword [rsp + 0x60]
call qword [sym.imp.ole32.dll_CoTaskMemFree]
jmp 0x140039867
call qword [sym.imp.KERNEL32.DLL_SetLastError]
xor ebx, ebx
call fcn.140036bd7
lea rcx, str.Unable_to_access_file_path:__s_n
mov rdx, rax
call fcn.140036717
mov rcx, qword [rsp + 0x108]
mov rax, qword [rcx]
call qword [rax + 0x10]
jmp 0x1400398a2
cmp r14w, 0x4c7
je 0x1400398a0
mov ecx, r14d
call qword [sym.imp.KERNEL32.DLL_SetLastError]
call fcn.140036bd7
lea rcx, str.Could_not_show_FileOpenDialog:__s_n
mov rdx, rax
call fcn.140036717
xor esi, esi
jmp 0x1400398b2
xor ebx, ebx
mov rcx, qword [rsp + 0x58]
mov rax, qword [rcx]
call qword [rax + 0x10]
jmp 0x140039ae0
mov rcx, rsi
call sub.msvcrt.dll_free
mov rcx, qword [rsp + 0x58]
test rcx, rcx
je 0x1400398ca
mov rax, qword [rcx]
call qword [rax + 0x10]
lea rdx, [rsp + 0x74]
xor eax, eax
mov ecx, 0x25
mov r9, qword [rbx + 8]
mov rdi, rdx
mov dword [rsp + 0x70], 0x98
rep stosd dword [rdi], eax
mov rax, qword [0x1400b19c0]
mov rax, qword [rax]
mov qword [rsp + 0x78], rax
test r9, r9
jne 0x140039902
lea r9, [0x1400984b5]
lea rsi, [rsp + 0x108]
lea r8, [0x14009853b]
mov edx, 0x104
xor edi, edi
mov rcx, rsi
xor r15d, r15d
call qword [sym.imp.msvcrt.dll__snprintf]
mov ecx, 0xc23
mov byte [rsp + 0x20b], 0
mov qword [rsp + 0xa0], rsi
mov dword [rsp + 0xa8], 0x104
call fcn.14001d5c1
mov r14, rax
mov rax, qword [rbx]
mov qword [rsp + 0x40], rax
cmp qword [rsp + 0x40], r15
je 0x1400399a8
mov rax, qword [rbx + 0x18]
lea r8, [r15*8]
xor esi, esi
mov rcx, qword [rax + r15*8]
test rcx, rcx
je 0x140039984
mov qword [rsp + 0x48], r8
call sub.msvcrt.dll_strlen
mov r8, qword [rsp + 0x48]
mov rsi, rax
mov rax, qword [rbx + 0x10]
mov rcx, qword [rax + r8]
xor eax, eax
test rcx, rcx
je 0x14003999b
call sub.msvcrt.dll_strlen
add rax, rax
lea rdi, [rdi + rsi + 6]
inc r15
add rdi, rax
jmp 0x140039954
mov eax, 0xc
test r14, r14
je 0x1400399be
mov rcx, r14
call sub.msvcrt.dll_strlen
add rax, 0xc
add rdi, rax
lea rcx, [rdi + 1]
call sub.msvcrt.dll_malloc
mov rsi, rax
test rax, rax
je 0x1400394cf
mov byte [rax], 0
xor r11d, r11d
xor r15d, r15d
mov rdx, rdi
lea r8, str._s___s__r_s_r
lea rcx, [rsi + r11]
sub rdx, r11
cmp r15, qword [rbx]
jae 0x140039a29
mov rax, qword [rbx + 0x10]
mov r9, qword [rbx + 0x18]
mov qword [rsp + 0x40], r11
mov rax, qword [rax + r15*8]
mov r9, qword [r9 + r15*8]
inc r15
mov qword [rsp + 0x28], rax
mov qword [rsp + 0x20], rax
call qword [sym.imp.msvcrt.dll__snprintf]
mov r11, qword [rsp + 0x40]
cdqe
add r11, rax
jmp 0x1400399df
mov r9, r14
lea r8, str._s__.__r._r
call qword [sym.imp.msvcrt.dll__snprintf]
xor eax, eax
cmp rax, rdi
je 0x140039a4f
cmp byte [rsi + rax], 0xd
jne 0x140039a4a
mov byte [rsi + rax], 0
inc rax
jmp 0x140039a3b
mov eax, dword [rsp + 0x278]
mov qword [rsp + 0x88], rsi
mov edx, 1
lea rcx, [rsp + 0x70]
mov dword [rsp + 0x9c], 1
or eax, 2
test r12d, r12d
mov qword [rsp + 0xc0], r13
mov dword [rsp + 0xd0], eax
jne 0x140039a8c
xor edx, edx
call fcn.140038ac9
test eax, eax
je 0x140039aa8
lea rcx, [rsp + 0x108]
call qword [sym.imp.msvcrt.dll__strdup]
mov rbx, rax
jmp 0x140039ad8
call qword [sym.imp.comdlg32.dll_CommDlgExtendedError]
mov r8d, eax
test eax, eax
je 0x140039ad6
test r12d, r12d
lea rdx, [0x1400984bb]
lea rax, str.save
cmovne rdx, rax
lea rcx, str.Could_not_select_file_for__s._Error__X_n
call fcn.140036717
xor ebx, ebx
mov rcx, rsi
call sub.msvcrt.dll_free
dec dword [rbp]
mov rax, rbx
add rsp, 0x218
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret