Function at 0x140002820
Capabilities:
Get common file path

Disassembly:
mov qword [rsp + 0x10], rbx
mov qword [rsp + 0x18], rsi
push rbp
push rdi
push r14
lea rbp, [rsp - 0x15c0]
mov eax, 0x16c0
call fcn.140007640
sub rsp, rax
mov rax, qword [0x14003e020]
xor rax, rsp
mov qword [rbp + 0x15b0], rax
mov rsi, rcx
xor edx, edx
lea rcx, [rbp + 0x190]
mov r8d, 0x208
call fcn.1400095e0
xor edx, edx
lea rcx, [rbp + 0xba0]
mov r8d, 0x208
call fcn.1400095e0
xor edx, edx
lea rcx, [rsp + 0x40]
mov r8d, 0x250
call fcn.1400095e0
xor edi, edi
mov qword [rsp + 0x20], rsi
xor r9d, r9d
mov dword [rsp + 0x34], edi
xor r8d, r8d
mov dword [rsp + 0x30], edi
mov edx, 0x8005
xor ecx, ecx
call qword [sym.imp.SHELL32.dll_SHGetFolderPathW]
xor edx, edx
lea rcx, [rbp + 0x3a0]
mov ebx, eax
mov r8d, 0x800
test eax, eax
jne 0x1400029cd
call fcn.1400095e0
mov r9, rsi
lea r8, str.GetPortName::_CSIDL_PERSONAL_is_:
lea rdx, str._s:__s
lea rcx, [rbp + 0x3a0]
call fcn.1400059d0
lea rcx, [rbp + 0x3a0]
call fcn.140001cf0
lea rdx, [rsp + 0x40]
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_FindFirstFileW]
mov rbx, rax
cmp rax, 0xffffffffffffffff
je 0x140002a39
xor edx, edx
lea rcx, [rbp + 0x3a0]
mov r8d, 0x800
call fcn.1400095e0
lea r9, [rsp + 0x6c]
lea r8, str.GetPortName::_Traversing_dir:
lea rdx, str._s:__s
lea rcx, [rbp + 0x3a0]
call fcn.1400059d0
lea rcx, [rbp + 0x3a0]
call fcn.140001cf0
test byte [rsp + 0x40], 0x10
je 0x1400029c2
lea rdx, [rsp + 0x6c]
lea rcx, [rbp + 0x190]
call qword [sym.imp.KERNEL32.dll_lstrcpyW]
lea rdx, str..pdf
lea rcx, [rbp + 0x190]
call qword [sym.imp.KERNEL32.dll_lstrcatW]
xor edx, edx
lea rcx, [rbp + 0x3a0]
mov r8d, 0x800
call fcn.1400095e0
lea r9, [rbp + 0x190]
lea r8, str.GetPortName::_szUserDocPortName
lea rdx, str._s:__s
lea rcx, [rbp + 0x3a0]
call fcn.1400059d0
lea rcx, [rbp + 0x3a0]
call fcn.140001cf0
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_FindClose]
jmp 0x140002a39
call fcn.1400095e0
movzx r9d, bx
lea r8, str.GetPortName::SHGetFolderPath_Failed.HRESULT_CODE
lea rdx, str._s_:_Code:__ul
lea rcx, [rbp + 0x3a0]
call fcn.1400059d0
lea rcx, [rbp + 0x3a0]
call fcn.140001cf0
xor edx, edx
lea rcx, [rbp + 0x3a0]
mov r8d, 0x800
call fcn.1400095e0
mov r9d, ebx
lea r8, str.GetPortName::SHGetFolderPath_Failed.
lea rdx, str._s_HRESULT__x
lea rcx, [rbp + 0x3a0]
call fcn.1400059d0
lea rcx, [rbp + 0x3a0]
call fcn.140001cf0
lea rdx, str.COM1:
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_lstrcpyW]
xor edx, edx
lea rcx, [rbp + 0x3a0]
mov r8d, 0x800
call fcn.1400095e0
mov r9, rsi
lea r8, str.GetPortName::_Initialized_default_port
lea rdx, str._s:__s
lea rcx, [rbp + 0x3a0]
call fcn.1400059d0
lea rcx, [rbp + 0x3a0]
call fcn.140001cf0
xor r9d, r9d
lea rax, [rsp + 0x30]
mov qword [rsp + 0x28], rax
xor r8d, r8d
lea rax, [rsp + 0x34]
xor ecx, ecx
mov qword [rsp + 0x20], rax
lea edx, [r9 + 2]
call qword [sym.imp.WINSPOOL.DRV_EnumPortsW]
test eax, eax
jne 0x140002af5
call qword [sym.imp.KERNEL32.dll_GetLastError]
xor edx, edx
lea rcx, [rbp + 0x3a0]
mov r8d, 0x800
mov ebx, eax
call fcn.1400095e0
mov r9d, ebx
lea r8, str.GetPortName::First_call_to_EnumPorts___failed.
lea rdx, str._s_:_Code:__ul
lea rcx, [rbp + 0x3a0]
call fcn.1400059d0
lea rcx, [rbp + 0x3a0]
call fcn.140001cf0
mov ebx, dword [rsp + 0x34]
mov ecx, ebx
call fcn.140007068
mov r14, rax
mov r9d, ebx
lea rax, [rsp + 0x30]
mov r8, r14
mov qword [rsp + 0x28], rax
mov edx, 2
lea rax, [rsp + 0x34]
xor ecx, ecx
mov qword [rsp + 0x20], rax
call qword [sym.imp.WINSPOOL.DRV_EnumPortsW]
test eax, eax
jne 0x140002b73
call qword [sym.imp.KERNEL32.dll_GetLastError]
xor edx, edx
lea rcx, [rbp + 0x3a0]
mov r8d, 0x800
mov ebx, eax
call fcn.1400095e0
mov r9d, ebx
lea r8, str.GetPortName::Second_call_to_EnumPorts___failed.
lea rdx, str._s_:_Code:__ul
lea rcx, [rbp + 0x3a0]
call fcn.1400059d0
lea rcx, [rbp + 0x3a0]
call fcn.140001cf0
lea r8, str.Documents.pdf
mov edx, 0x104
lea rcx, [rbp + 0xba0]
call fcn.14000d158
cmp dword [rsp + 0x30], edi
jbe 0x140002cba
nop word [rax + rax]
xor edx, edx
lea rcx, [rbp + 0x3a0]
mov r8d, 0x800
call fcn.1400095e0
mov ebx, edi
lea r8, str.GetPortName::_Traversing_Port_:
shl rbx, 5
lea rdx, str._s:__s
lea rcx, [rbp + 0x3a0]
mov r9, qword [rbx + r14]
call fcn.1400059d0
lea rcx, [rbp + 0x3a0]
call fcn.140001cf0
mov rcx, qword [rbx + r14]
lea rdx, [rbp + 0xba0]
call qword [sym.imp.KERNEL32.dll_lstrcmpiW]
test eax, eax
je 0x140002c6d
mov rcx, qword [rbx + r14]
lea rdx, [rbp + 0x190]
call qword [sym.imp.KERNEL32.dll_lstrcmpiW]
test eax, eax
jne 0x140002c5f
lea rdx, [rbp + 0x190]
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_lstrcpyW]
xor edx, edx
lea rcx, [rbp + 0xdb0]
mov r8d, 0x800
call fcn.1400095e0
lea r9, [rbp + 0x190]
lea r8, str.GetPortName::_Setting_port_to_szUserDocPortName:
lea rdx, str._s:__s
lea rcx, [rbp + 0xdb0]
call fcn.1400059d0
lea rcx, [rbp + 0xdb0]
call fcn.140001cf0
inc edi
cmp edi, dword [rsp + 0x30]
jb 0x140002ba0
jmp 0x140002cba
lea rdx, [rbp + 0xba0]
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_lstrcpyW]
xor edx, edx
lea rcx, [rbp + 0xdb0]
mov r8d, 0x800
call fcn.1400095e0
mov r9, rsi
lea r8, str.GetPortName::_Found_matching_Default_port_name._Port_to_be_used_is_:
lea rdx, str._s:__s
lea rcx, [rbp + 0xdb0]
call fcn.1400059d0
lea rcx, [rbp + 0xdb0]
call fcn.140001cf0
mov rcx, r14
call fcn.140006ff4
mov rcx, qword [rbp + 0x15b0]
xor rcx, rsp
call fcn.140006fd0
lea r11, [rsp + 0x16c0]
mov rbx, qword [r11 + 0x28]
mov rsi, qword [r11 + 0x30]
mov rsp, r11
pop r14
pop rdi
pop rbp
ret