Function at 0x140059028
Capabilities:
Get common file path

Disassembly:
test rdx, rdx
je 0x14005939b
mov rax, rsp
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
lea rbp, [rax - 0x1e8]
sub rsp, 0x2b0
mov qword [rsp + 0x40], 0xfffffffffffffffe
mov qword [rax + 0x18], rbx
mov rax, qword [0x140216b40]
xor rax, rsp
mov qword [rbp + 0x1a0], rax
mov rbx, rdx
mov r13, rcx
xor r12d, r12d
mov rdi, qword [rdx + 0x18]
test rdi, rdi
je 0x140059081
mov al, byte [rdi]
jmp 0x140059084
mov al, byte [rdx + 0x20]
test al, al
je 0x140059372
lea r15, [0x1401cc718]
test rdi, rdi
je 0x1400590a8
add rdi, 8
cmp qword [rdi + 0x18], 8
jb 0x1400590ab
mov rdi, qword [rdi]
jmp 0x1400590ab
mov rdi, r15
mov qword [rbp - 0x80], r12
mov qword [rbp - 0x78], r12
mov eax, 7
mov qword [rbp - 0x78], rax
mov qword [rbp - 0x80], r12
mov word [rsp + 0x70], r12w
mov qword [rsp + 0x60], r12
mov qword [rsp + 0x68], r12
mov qword [rsp + 0x68], rax
mov qword [rsp + 0x60], r12
mov word [rsp + 0x50], r12w
mov rcx, rdi
call qword [sym.imp.SHLWAPI.dll_PathIsFileSpecW]
lea rsi, [r13 + 0x110]
test eax, eax
je 0x140059157
mov qword [rsp + 0x20], rsi
xor r9d, r9d
xor r8d, r8d
mov edx, 0x8023
xor ecx, ecx
call qword [sym.imp.SHELL32.dll_SHGetFolderPathW]
or r14, 0xffffffffffffffff
cmp word [rsi], r12w
jne 0x14005911b
mov r8, r12
jmp 0x140059128
mov r8, r14
inc r8
cmp word [rsi + r8*2], r12w
jne 0x14005911e
mov rdx, rsi
lea rcx, [rsp + 0x70]
call fcn.14003c268
cmp word [rdi], r12w
jne 0x140059140
mov r8, r12
jmp 0x14005914d
mov r8, r14
inc r8
cmp word [rdi + r8*2], r12w
jne 0x140059143
mov rdx, rdi
lea rcx, [rsp + 0x50]
jmp 0x1400591c2
mov r8, rdi
mov edx, 0x104
mov rcx, rsi
call fcn.14010411c
mov rcx, rsi
call qword [sym.imp.SHLWAPI.dll_PathFindFileNameW]
or r14, 0xffffffffffffffff
cmp word [rax], r12w
jne 0x14005917f
mov r8, r12
jmp 0x14005918c
mov r8, r14
inc r8
cmp word [rax + r8*2], r12w
jne 0x140059182
mov rdx, rax
lea rcx, [rsp + 0x50]
call fcn.14003c268
mov rcx, rsi
call qword [sym.imp.SHLWAPI.dll_PathRemoveFileSpecW]
cmp word [rsi], r12w
jne 0x1400591ad
mov r8, r12
jmp 0x1400591ba
mov r8, r14
inc r8
cmp word [rsi + r8*2], r12w
jne 0x1400591b0
mov rdx, rsi
lea rcx, [rsp + 0x70]
call fcn.14003c268
test dword [rbx + 0x10], 0x20000
je 0x14005924b
lea rdx, [rsp + 0x50]
cmp qword [rsp + 0x68], 8
cmovae rdx, qword [rsp + 0x50]
lea rcx, [rsp + 0x70]
cmp qword [rbp - 0x78], 8
cmovae rcx, qword [rsp + 0x70]
mov r9, rsi
xor r8d, r8d
call qword [sym.imp.KERNEL32.dll_GetTempFileNameW]
test eax, eax
je 0x14005924b
mov r8d, 0x104
lea rdx, [rbp - 0x70]
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_GetLongPathNameW]
test eax, eax
je 0x14005924b
mov rax, qword [rbx + 0x18]
test rax, rax
je 0x14005924b
lea rcx, [rax + 8]
cmp word [rbp - 0x70], r12w
jne 0x140059231
mov r8, r12
jmp 0x140059242
lea rax, [rbp - 0x70]
mov r8, r14
inc r8
cmp word [rax + r8*2], r12w
jne 0x140059238
lea rdx, [rbp - 0x70]
call fcn.14003c268
mov rax, qword [rbx + 0x18]
test rax, rax
je 0x140059262
lea r15, [rax + 8]
cmp qword [r15 + 0x18], 8
jb 0x140059262
mov r15, qword [r15]
mov rcx, r15
call fcn.14016bfdc
test rax, rax
je 0x140059314
mov qword [rsp + 0x30], r12
xor r9d, r9d
xor r8d, r8d
mov edx, 0x40000000
mov rcx, r15
mov dword [rsp + 0x28], 0x80
test dword [rbx + 0x10], 0x10000
je 0x1400592a1
mov dword [rsp + 0x20], 2
jmp 0x1400592a9
mov dword [rsp + 0x20], 4
call qword [sym.imp.KERNEL32.dll_CreateFileW]
mov rdi, rax
cmp rax, r14
je 0x140059314
lea rax, [rsp + 0x48]
mov qword [rsp + 0x28], rax
mov qword [rsp + 0x20], rsi
mov r9d, 0x104
xor r8d, r8d
mov rdx, r15
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_SearchPathW]
test eax, eax
je 0x14005930b
mov rax, qword [rbx + 0x18]
test rax, rax
je 0x14005930b
lea rcx, [rax + 8]
cmp word [rsi], r12w
jne 0x1400592f6
mov r14, r12
jmp 0x140059300
inc r14
cmp word [rsi + r14*2], r12w
jne 0x1400592f6
mov r8, r14
mov rdx, rsi
call fcn.14003c268
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_CloseHandle]
test dword [rbx + 0xc], 0x40000000
je 0x140059341
mov rdx, rbx
mov rcx, r13
call fcn.140058be0
test dword [rbx + 0x10], 0x100000
je 0x140059341
call qword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
mov edx, eax
mov rcx, r13
call fcn.140058b20
mov rax, qword [rbx + 0x18]
test rax, rax
je 0x14005934f
mov byte [rax], r12b
jmp 0x140059353
mov byte [rbx + 0x20], r12b
xor r8d, r8d
mov dl, 1
lea rcx, [rsp + 0x50]
call fcn.14003d54c
nop
xor r8d, r8d
mov dl, 1
lea rcx, [rsp + 0x70]
call fcn.14003d54c
mov rcx, qword [rbp + 0x1a0]
xor rcx, rsp
call fcn.1400dd830
mov rbx, qword [rsp + 0x300]
add rsp, 0x2b0
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret