Function at 0x1400205d0
Capabilities:
Get common file path

Disassembly:
mov qword [rsp + 0x10], rdx
mov qword [rsp + 8], rcx
push rbx
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0xd8
mov qword [rsp + 0xc0], 0xfffffffffffffffe
mov rdx, qword [rdx]
cmp dword [rdx - 0x10], 0
jne 0x140020626
add rdx, 0xffffffffffffffe8
or rsi, 0xffffffffffffffff
lock xadd dword [rdx + 0x10], esi
add esi, 0xffffffff
test esi, esi
jg 0x14002061f
mov rcx, qword [rdx]
mov rax, qword [rcx]
call qword [rax + reloc.OLEAUT32.dll_VariantClear]
xor eax, eax
jmp 0x140020e97
call fcn.1400280cc
mov rdx, rax
xor ecx, ecx
test rax, rax
setne cl
test ecx, ecx
jne 0x140020645
mov ecx, 0x80004005
call fcn.140003280
int3
mov rax, qword [rax]
mov rcx, rdx
call qword [rax + 0x18]
add rax, 0x18
mov qword [rsp + 0x30], rax
call fcn.1400280cc
mov rdx, rax
xor ecx, ecx
test rax, rax
setne cl
test ecx, ecx
jne 0x140020676
mov ecx, 0x80004005
call fcn.140003280
int3
mov rax, qword [rax]
mov rcx, rdx
call qword [rax + 0x18]
lea rbx, [rax + 0x18]
mov qword [rsp + 0x38], rbx
mov edx, 1
sub edx, dword [rbx - 8]
mov eax, dword [rbx - 0xc]
sub eax, 0x104
or eax, edx
jge 0x1400206b0
mov edx, 0x104
lea rcx, [rsp + 0x38]
call fcn.140003380
mov rbx, qword [rsp + 0x38]
mov rdx, rbx
mov ecx, 0x104
call qword [sym.imp.KERNEL32.dll_GetTempPathW]
or rsi, 0xffffffffffffffff
test rbx, rbx
jne 0x1400206cb
xor ecx, ecx
jmp 0x1400206e5
xor eax, eax
mov rcx, rsi
mov rdi, rbx
repne scasw ax, word [rdi]
not rcx
sub rcx, 1
test ecx, ecx
js 0x140020e8c
cmp ecx, dword [rbx - 0xc]
jg 0x140020e8c
mov dword [rbx - 0x10], ecx
movsxd rax, ecx
mov word [rbx + rax*2], 0
lea rdx, [rsp + 0x38]
lea rcx, [rsp + 0x30]
call fcn.1400073a0
nop
lea rdx, [rbx - 0x18]
mov eax, esi
lock xadd dword [rdx + 0x10], eax
add eax, 0xffffffff
test eax, eax
jg 0x140020725
mov rcx, qword [rdx]
mov rax, qword [rcx]
call qword [rax + reloc.OLEAUT32.dll_VariantClear]
lea rcx, [rsp + 0x30]
call fcn.140008c10
xor eax, eax
mov rcx, rsi
lea r12, str.EPSONEPSONScanData
mov rdi, r12
repne scasw ax, word [rdi]
not rcx
lea r14, [rcx - 1]
mov rbp, r12
mov rdi, qword [rsp + 0x30]
sub rbp, rdi
sar rbp, 1
mov r13d, dword [rdi - 0x10]
lea ebx, [r13 + rcx - 1]
mov edx, 1
sub edx, dword [rdi - 8]
mov eax, dword [rdi - 0xc]
sub eax, ebx
or eax, edx
jge 0x140020781
mov edx, ebx
lea rcx, [rsp + 0x30]
call fcn.140003380
mov rdi, qword [rsp + 0x30]
cmp rbp, r13
ja 0x14002078a
lea r12, [rdi + rbp*2]
movsxd rdx, r14d
add rdx, rdx
lea rcx, [rdi + r13*2]
mov r9, rdx
mov r8, r12
call fcn.1400525a0
test ebx, ebx
js 0x140020e81
cmp ebx, dword [rdi - 0xc]
jg 0x140020e81
mov dword [rdi - 0x10], ebx
movsxd rax, ebx
mov word [rdi + rax*2], 0
lea rcx, [rsp + 0x30]
call fcn.140008720
lea rcx, [rsp + 0x30]
call fcn.140008270
lea r12, [rdi - 0x18]
mov rcx, qword [r12]
mov rax, qword [rcx]
call qword [rax + 0x20]
mov rcx, rax
cmp dword [r12 + 0x10], 0
jl 0x1400207fb
cmp rax, qword [r12]
jne 0x1400207fb
mov rdi, r12
lock add dword [r12 + 0x10], 1
jmp 0x140020841
mov rax, qword [rax]
mov r8d, 2
mov edx, dword [r12 + 8]
call qword [rax]
mov rdi, rax
test rax, rax
jne 0x140020819
call fcn.140003050
int3
mov eax, dword [r12 + 8]
mov dword [rdi + 8], eax
mov eax, dword [r12 + 8]
add eax, 1
movsxd rdx, eax
lea r9, [rdx + rdx]
lea r8, [r12 + 0x18]
add rdx, rdx
lea rcx, [rdi + 0x18]
call fcn.1400525a0
lea rax, [rdi + 0x18]
mov qword [rsp + 0x138], rax
lea rcx, [rsp + 0x138]
call fcn.140008c10
xor eax, eax
mov rcx, rsi
lea r13, str.ScannerData.ini
mov rdi, r13
repne scasw ax, word [rdi]
not rcx
lea r15, [rcx - 1]
mov rbp, r13
mov rbx, qword [rsp + 0x138]
sub rbp, rbx
sar rbp, 1
mov r14d, dword [rbx - 0x10]
lea edi, [r14 + rcx - 1]
mov edx, 1
sub edx, dword [rbx - 8]
mov eax, dword [rbx - 0xc]
sub eax, edi
or eax, edx
jge 0x1400208b5
mov edx, edi
lea rcx, [rsp + 0x138]
call fcn.140003380
mov rbx, qword [rsp + 0x138]
cmp rbp, r14
ja 0x1400208be
lea r13, [rbx + rbp*2]
movsxd rdx, r15d
add rdx, rdx
lea rcx, [rbx + r14*2]
mov r9, rdx
mov r8, r13
call fcn.1400525a0
test edi, edi
js 0x140020e76
cmp edi, dword [rbx - 0xc]
jg 0x140020e76
mov dword [rbx - 0x10], edi
movsxd rax, edi
mov word [rbx + rax*2], 0
call fcn.1400280cc
mov rdx, rax
xor ecx, ecx
test rax, rax
setne cl
test ecx, ecx
jne 0x14002090f
mov ecx, 0x80004005
call fcn.140003280
int3
mov rax, qword [rax]
mov rcx, rdx
call qword [rax + 0x18]
add rax, 0x18
mov qword [rsp + 0x48], rax
mov r9, rbx
mov r15, qword [rsp + 0x128]
mov r8, qword [r15]
lea rdx, str._CHECK:__s____s_
lea rcx, [rsp + 0x48]
call fcn.140009290
call fcn.1400280cc
mov rdx, rax
xor ecx, ecx
test rax, rax
setne cl
test ecx, ecx
jne 0x14002095f
mov ecx, 0x80004005
call fcn.140003280
int3
mov rax, qword [rax]
mov rcx, rdx
call qword [rax + 0x18]
add rax, 0x18
mov qword [rsp + 0x40], rax
lea rdx, str._SystemRoot__twain_32escndvestcfg.exe
test rdx, 0xffffffffffff0000
jne 0x1400209a2
movzx edi, dx
mov ecx, edi
call fcn.1400280b8
test rax, rax
je 0x1400209bf
mov r8d, edi
mov rdx, rax
lea rcx, [rsp + 0x40]
call fcn.140003060
jmp 0x1400209bf
xor eax, eax
mov rcx, rsi
mov rdi, rdx
repne scasw ax, word [rdi]
not rcx
lea r8d, [rcx - 1]
lea rcx, [rsp + 0x40]
call fcn.1400036f0
nop
mov rdi, qword [rsp + 0x40]
mov rcx, qword [rdi - 0x18]
mov rax, qword [rcx]
call qword [rax + 0x20]
mov rcx, rax
cmp dword [rdi - 8], 0
jl 0x1400209f0
cmp rax, qword [rdi - 0x18]
jne 0x1400209f0
lea rbp, [rdi - 0x18]
lock add dword [rdi - 8], 1
mov rbx, qword [rsp + 0x138]
jmp 0x140020a2e
mov rax, qword [rax]
mov r8d, 2
mov edx, dword [rdi - 0x10]
call qword [rax]
mov rbp, rax
test rax, rax
jne 0x140020a0c
call fcn.140003050
int3
mov eax, dword [rdi - 0x10]
mov dword [rbp + 8], eax
mov eax, dword [rdi - 0x10]
add eax, 1
movsxd rdx, eax
lea r9, [rdx + rdx]
mov r8, rdi
add rdx, rdx
lea rcx, [rbp + 0x18]
call fcn.1400525a0
lea rax, [rbp + 0x18]
mov qword [rsp + 0xa0], rax
lea rdx, [rsp + 0xa0]
lea rcx, [rsp + 0x50]
call fcn.140007c60
nop
mov dword [rsp + 0x130], 0
lea rax, [rsp + 0x58]
mov qword [rsp + 0x60], rax
mov rbp, qword [rsp + 0x48]
mov rcx, qword [rbp - 0x18]
mov rax, qword [rcx]
call qword [rax + 0x20]
mov rcx, rax
cmp dword [rbp - 8], 0
jl 0x140020a93
cmp rax, qword [rbp - 0x18]
jne 0x140020a93
lea r13, [rbp - 0x18]
lock add dword [rbp - 8], 1
mov rbx, qword [rsp + 0x138]
jmp 0x140020ad2
mov rax, qword [rax]
mov r8d, 2
mov edx, dword [rbp - 0x10]
call qword [rax]
mov r13, rax
test rax, rax
jne 0x140020aaf
call fcn.140003050
int3
mov eax, dword [rbp - 0x10]
mov dword [r13 + 8], eax
mov eax, dword [rbp - 0x10]
add eax, 1
movsxd rdx, eax
lea r9, [rdx + rdx]
mov r8, rbp
add rdx, rdx
lea rcx, [r13 + 0x18]
call fcn.1400525a0
lea rax, [r13 + 0x18]
mov qword [rsp + 0x58], rax
mov r13, qword [rsp + 0x50]
mov rcx, qword [r13 - 0x18]
mov rax, qword [rcx]
call qword [rax + 0x20]
mov rcx, rax
cmp dword [r13 - 8], 0
jl 0x140020b0e
cmp rax, qword [r13 - 0x18]
jne 0x140020b0e
lea r14, [r13 - 0x18]
lock add dword [r13 - 8], 1
mov rbx, qword [rsp + 0x138]
jmp 0x140020b50
mov rax, qword [rax]
mov r8d, 2
mov edx, dword [r13 - 0x10]
call qword [rax]
mov r14, rax
test rax, rax
jne 0x140020b2b
call fcn.140003050
int3
mov eax, dword [r13 - 0x10]
mov dword [r14 + 8], eax
mov eax, dword [r13 - 0x10]
add eax, 1
movsxd rdx, eax
lea r9, [rdx + rdx]
mov r8, r13
add rdx, rdx
lea rcx, [r14 + 0x18]
call fcn.1400525a0
lea rax, [r14 + 0x18]
mov qword [rsp + 0xb8], rax
lea rax, [rsp + 0x130]
mov qword [rsp + 0x20], rax
xor r9d, r9d
lea r8d, [r9 + 1]
lea rdx, [rsp + 0x58]
lea rcx, [rsp + 0xb8]
call fcn.140007de0
test eax, eax
je 0x140020dae
cmp dword [rsp + 0x130], 1
jne 0x140020dae
lea rax, [rsp + 0x78]
mov qword [rsp + 0x60], rax
lea rax, [rsp + 0x68]
mov qword [rsp + 0xb0], rax
lea rdx, str.Type
lea rcx, [rsp + 0x78]
call fcn.1400032a0
mov r14, rax
lea rdx, str.CONNECTION
lea rcx, [rsp + 0x68]
call fcn.1400032a0
mov r15, rax
mov rcx, qword [rbx - 0x18]
mov rdx, qword [rcx]
call qword [rdx + 0x20]
mov rcx, rax
cmp dword [rbx - 8], 0
jl 0x140020bfb
cmp rax, qword [rbx - 0x18]
jne 0x140020bfb
lea r13, [rbx - 0x18]
lock add dword [rbx - 8], 1
jmp 0x140020c3a
mov rax, qword [rax]
mov r8d, 2
mov edx, dword [rbx - 0x10]
call qword [rax]
mov r13, rax
test rax, rax
jne 0x140020c17
call fcn.140003050
int3
mov eax, dword [rbx - 0x10]
mov dword [r13 + 8], eax
mov eax, dword [rbx - 0x10]
add eax, 1
movsxd rdx, eax
lea r9, [rdx + rdx]
mov r8, rbx
add rdx, rdx
lea rcx, [r13 + 0x18]
call fcn.1400525a0
lea rax, [r13 + 0x18]
mov qword [rsp + 0x88], rax
mov r9, r14
mov r8, r15
lea rdx, [rsp + 0x88]
lea rcx, [rsp + 0xa8]
call fcn.1400067b0
nop
mov rdx, rax
mov rcx, qword [rsp + 0x120]
call fcn.140003600
nop
mov rdx, qword [rsp + 0xa8]
add rdx, 0xffffffffffffffe8
mov eax, esi
lock xadd dword [rdx + 0x10], eax
add eax, 0xffffffff
test eax, eax
jg 0x140020c96
mov rcx, qword [rdx]
mov rax, qword [rcx]
call qword [rax + reloc.OLEAUT32.dll_VariantClear]
lea rax, [rsp + 0x98]
mov qword [rsp + 0xb0], rax
lea rax, [rsp + 0x70]
mov qword [rsp + 0x60], rax
lea rdx, str.Version
lea rcx, [rsp + 0x98]
call fcn.1400032a0
mov r14, rax
lea rdx, str.Firmware
lea rcx, [rsp + 0x70]
call fcn.1400032a0
mov r15, rax
mov rcx, qword [rbx - 0x18]
mov rdx, qword [rcx]
call qword [rdx + 0x20]
mov rcx, rax
cmp dword [rbx - 8], 0
jl 0x140020cff
cmp rax, qword [rbx - 0x18]
jne 0x140020cff
lea r13, [rbx - 0x18]
lock add dword [rbx - 8], 1
jmp 0x140020d3e
mov rax, qword [rax]
mov r8d, 2
mov edx, dword [rbx - 0x10]
call qword [rax]
mov r13, rax
test rax, rax
jne 0x140020d1b
call fcn.140003050
int3
mov eax, dword [rbx - 0x10]
mov dword [r13 + 8], eax
mov eax, dword [rbx - 0x10]
add eax, 1
movsxd rdx, eax
lea r9, [rdx + rdx]
mov r8, rbx
add rdx, rdx
lea rcx, [r13 + 0x18]
call fcn.1400525a0
lea rax, [r13 + 0x18]
mov qword [rsp + 0x80], rax
mov r9, r14
mov r8, r15
lea rdx, [rsp + 0x80]
lea rcx, [rsp + 0x90]
call fcn.1400067b0
nop
mov r15, qword [rsp + 0x120]
lea rcx, [r15 + 8]
mov rdx, rax
call fcn.140003600
nop
mov rdx, qword [rsp + 0x90]
add rdx, 0xffffffffffffffe8
mov eax, esi
lock xadd dword [rdx + 0x10], eax
add eax, 0xffffffff
test eax, eax
jg 0x140020d9e
mov rcx, qword [rdx]
mov rax, qword [rcx]
call qword [rax + reloc.OLEAUT32.dll_VariantClear]
mov dword [r15 + 0x10], 1
mov r15, qword [rsp + 0x128]
mov rax, qword [rsp + 0x120]
mov ebx, dword [rax + 0x10]
mov rdx, qword [rsp + 0x50]
add rdx, 0xffffffffffffffe8
mov eax, esi
lock xadd dword [rdx + 0x10], eax
add eax, 0xffffffff
test eax, eax
jg 0x140020dda
mov rcx, qword [rdx]
mov rax, qword [rcx]
call qword [rax + reloc.OLEAUT32.dll_VariantClear]
nop
mov eax, esi
lock xadd dword [rdi - 8], eax
add eax, 0xffffffff
test eax, eax
jg 0x140020df7
mov rcx, qword [rdi - 0x18]
mov rax, qword [rcx]
lea rdx, [rdi - 0x18]
call qword [rax + reloc.OLEAUT32.dll_VariantClear]
nop
mov eax, esi
lock xadd dword [rbp - 8], eax
add eax, 0xffffffff
test eax, eax
jg 0x140020e14
mov rcx, qword [rbp - 0x18]
mov rax, qword [rcx]
lea rdx, [rbp - 0x18]
call qword [rax + reloc.OLEAUT32.dll_VariantClear]
nop
mov rdx, qword [rsp + 0x138]
add rdx, 0xffffffffffffffe8
mov eax, esi
lock xadd dword [rdx + 0x10], eax
add eax, 0xffffffff
test eax, eax
jg 0x140020e38
mov rcx, qword [rdx]
mov rax, qword [rcx]
call qword [rax + reloc.OLEAUT32.dll_VariantClear]
nop
mov eax, esi
lock xadd dword [r12 + 0x10], eax
add eax, 0xffffffff
test eax, eax
jg 0x140020e56
mov rcx, qword [r12]
mov rax, qword [rcx]
mov rdx, r12
call qword [rax + reloc.OLEAUT32.dll_VariantClear]
nop
mov rdx, qword [r15]
sub rdx, 0x18
lock xadd dword [rdx + 0x10], esi
add esi, 0xffffffff
test esi, esi
jg 0x140020e72
mov rcx, qword [rdx]
mov rax, qword [rcx]
call qword [rax + reloc.OLEAUT32.dll_VariantClear]
mov eax, ebx
jmp 0x140020e97
mov ecx, 0x80070057
call fcn.140003280
nop
mov ecx, 0x80070057
call fcn.140003280
nop
mov ecx, 0x80070057
call fcn.140003280
nop
add rsp, 0xd8
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
pop rbx
ret