Function at 0x405650
Capabilities:
Check if file exists
Create directory
Get common file path

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4e65d3
mov eax, dword fs:[0]
push eax
sub esp, 0xe8
mov eax, dword [0x50b0b0]
xor eax, ebp
mov dword [ebp - 0x10], eax
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov esi, dword [ebp + 0xc]
lea ecx, [ebp - 0xb8]
mov dword [ebp - 0xf0], 0
xor eax, eax
push 1
push 0x4ea648
mov byte [ebp - 0xd8], 0
mov byte [ebp - 0xe4], 0
mov byte [ebp - 0xe8], 0
mov dword [ebp - 0xa8], 0
mov dword [ebp - 0xa4], 7
mov word [ebp - 0xb8], ax
call fcn.0040b650
cmp dword [ebp + 8], 0
mov dword [ebp - 4], 0
mov dword [ebp - 0xf0], 0
jle 0x4059e3
lea edi, [esi + 4]
mov dword [ebp - 0xe0], edi
push dword [edi]
push dword [edi - 4]
push 0x4ea64c
call fcn.00406230
mov edx, dword [edi - 4]
add esp, 0xc
mov ecx, edx
mov dword [ebp - 0x30], 0
xor eax, eax
mov dword [ebp - 0x2c], 7
mov word [ebp - 0x40], ax
lea esi, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x405720
sub ecx, esi
sar ecx, 1
push ecx
push edx
lea ecx, [ebp - 0x40]
call fcn.0040b650
mov edx, dword [edi]
xor eax, eax
mov ecx, edx
mov byte [ebp - 4], 1
mov dword [ebp - 0x18], 0
mov dword [ebp - 0x14], 7
mov word [ebp - 0x28], ax
lea esi, [ecx + 2]
nop dword [eax + eax]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x405760
sub ecx, esi
sar ecx, 1
push ecx
push edx
lea ecx, [ebp - 0x28]
call fcn.0040b650
cmp dword [ebp - 0x18], 0
mov edx, dword [ebp - 0x14]
setne byte [ebp - 0xd1]
cmp edx, 8
jb 0x4057be
mov ecx, dword [ebp - 0x28]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x4057b4
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40622a
push edx
push ecx
call fcn.004bf27b
add esp, 8
cmp dword [ebp - 0x2c], 8
lea esi, [ebp - 0x40]
mov edi, dword [ebp - 0x40]
mov eax, dword [ebp - 0x30]
cmovae esi, edi
cmp eax, 2
jne 0x405811
mov ecx, 0x4ea660
mov edx, eax
sub esi, ecx
nop dword [eax]
mov ax, word [ecx + esi]
cmp ax, word [ecx]
jne 0x40580e
add ecx, 2
sub edx, 1
jne 0x4057e0
mov eax, dword [ebp - 0xd8]
mov ecx, 1
cmp byte [ebp - 0xd1], dl
movzx eax, al
cmovne eax, ecx
mov dword [ebp - 0xd8], eax
mov eax, dword [ebp - 0x30]
mov ecx, dword [ebp - 0x2c]
lea esi, [ebp - 0x40]
cmp ecx, 8
cmovae esi, edi
cmp eax, 2
jne 0x405864
mov ecx, 0x4ea668
mov edx, eax
sub esi, ecx
nop dword [eax + eax]
mov ax, word [ecx + esi]
cmp ax, word [ecx]
jne 0x40585e
add ecx, 2
sub edx, 1
jne 0x405830
mov eax, dword [ebp - 0xe8]
mov ecx, 1
cmp byte [ebp - 0xd1], dl
movzx eax, al
cmovne eax, ecx
mov dword [ebp - 0xe8], eax
mov ecx, dword [ebp - 0x2c]
mov eax, dword [ebp - 0x30]
cmp ecx, 8
lea esi, [ebp - 0x40]
cmovae esi, edi
cmp eax, 2
jne 0x4058b4
mov ecx, 0x4ea670
mov edx, eax
sub esi, ecx
nop dword [eax + eax]
mov ax, word [ecx + esi]
cmp ax, word [ecx]
jne 0x4058ae
add ecx, 2
sub edx, 1
jne 0x405880
mov eax, dword [ebp - 0xe4]
mov ecx, 1
cmp byte [ebp - 0xd1], dl
movzx eax, al
cmovne eax, ecx
mov dword [ebp - 0xe4], eax
mov ecx, dword [ebp - 0x2c]
mov eax, dword [ebp - 0x30]
cmp ecx, 8
lea esi, [ebp - 0x40]
cmovae esi, edi
cmp eax, 2
jne 0x4058e5
mov ecx, 0x4ea678
mov edx, eax
sub esi, ecx
nop dword [eax + eax]
mov ax, word [ecx + esi]
cmp ax, word [ecx]
jne 0x4058e5
add ecx, 2
sub edx, 1
jne 0x4058d0
mov al, 1
jmp 0x4058e7
xor al, al
test al, al
je 0x405981
mov edx, dword [ebp - 0xe0]
xor eax, eax
mov dword [ebp - 0x18], 0
mov dword [ebp - 0x14], 7
mov word [ebp - 0x28], ax
mov edx, dword [edx]
mov ecx, edx
lea esi, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x405910
sub ecx, esi
sar ecx, 1
push ecx
push edx
lea ecx, [ebp - 0x28]
call fcn.0040b650
mov edx, dword [ebp - 0xa4]
cmp edx, 8
jb 0x405969
mov ecx, dword [ebp - 0xb8]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x40595f
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40622a
push edx
push ecx
call fcn.004bf27b
add esp, 8
movups xmm0, xmmword [ebp - 0x28]
movups xmmword [ebp - 0xb8], xmm0
movq xmm0, qword [ebp - 0x18]
movq qword [ebp - 0xa8], xmm0
mov eax, dword [ebp - 0x2c]
mov byte [ebp - 4], 0
cmp eax, 8
jb 0x4059bc
lea ecx, [eax*2 + 2]
mov eax, edi
cmp ecx, 0x1000
jb 0x4059b2
mov edi, dword [edi - 4]
add ecx, 0x23
sub eax, edi
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40622a
push ecx
push edi
call fcn.004bf27b
add esp, 8
mov eax, dword [ebp - 0xf0]
mov edi, dword [ebp - 0xe0]
add eax, 2
add edi, 8
mov dword [ebp - 0xf0], eax
mov dword [ebp - 0xe0], edi
cmp eax, dword [ebp + 8]
jl 0x4056f2
cmp dword [ebp - 0xa4], 8
lea esi, [ebp - 0xb8]
mov edi, dword [ebp - 0xb8]
cmovae esi, edi
cmp dword [ebp - 0xa8], 1
jne 0x405a33
mov ecx, 0x4ea680
mov edx, 1
sub esi, ecx
nop
mov ax, word [ecx + esi]
cmp ax, word [ecx]
jne 0x405a33
add ecx, 2
sub edx, 1
jne 0x405a10
push 0x4ea684
call fcn.00406230
add esp, 4
jmp 0x4061c5
xor eax, eax
mov dword [ebp - 0xec], 0
mov dword [ebp - 0xdc], 0
mov dword [ebp - 0x48], 0
mov dword [ebp - 0x44], 7
mov word [ebp - 0x58], ax
mov dword [ebp - 0x90], eax
mov dword [ebp - 0x8c], 7
mov word [ebp - 0xa0], ax
mov dword [ebp - 0x78], eax
mov dword [ebp - 0x74], 7
mov word [ebp - 0x88], ax
mov dword [ebp - 0x60], eax
mov dword [ebp - 0x5c], 7
mov word [ebp - 0x70], ax
lea eax, [ebp - 0x58]
mov byte [ebp - 4], 5
push eax
call fcn.004063a0
add esp, 4
test eax, eax
jns 0x405ab8
mov eax, str.Failed_to_get_x86_path_n
push eax
call fcn.00406230
add esp, 4
jmp 0x406078
xor eax, eax
mov byte [ebp - 4], 6
mov word [ebp - 0x28], ax
lea ecx, [ebp - 0x28]
mov eax, dword [ebp - 0x48]
add eax, 0x26
mov dword [ebp - 0x18], 0
push eax
mov dword [ebp - 0x14], 7
mov dword [ebp - 0xf0], 1
call fcn.0040d540
cmp dword [ebp - 0x44], 8
lea eax, [ebp - 0x58]
push dword [ebp - 0x48]
cmovae eax, dword [ebp - 0x58]
lea ecx, [ebp - 0x28]
push eax
call fcn.0040b3f0
push 0x26
push str.SynologyActiveBackupforBusinessAgent
lea ecx, [ebp - 0x28]
call fcn.0040b3f0
push 0x34
push str.uiuiSynology_Active_Backup_for_Business_Agent.exe
lea ecx, [ebp - 0x28]
call fcn.0040b3f0
xor ecx, ecx
movups xmm0, xmmword [eax]
movq xmm1, qword [eax + 0x10]
mov dword [eax + 0x10], 0
mov dword [eax + 0x14], 7
mov word [eax], cx
mov edx, dword [ebp - 0x44]
movq qword [ebp - 0xf4], xmm1
movups xmmword [ebp - 0x38], xmm0
cmp edx, 8
jb 0x405b8b
mov ecx, dword [ebp - 0x58]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x405b75
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x406216
push edx
push ecx
call fcn.004bf27b
movups xmm0, xmmword [ebp - 0x38]
add esp, 8
movq xmm1, qword [ebp - 0xf4]
mov edx, dword [ebp - 0x14]
movq qword [ebp - 0x48], xmm1
mov byte [ebp - 4], 5
movups xmmword [ebp - 0x58], xmm0
cmp edx, 8
jb 0x405bd2
mov ecx, dword [ebp - 0x28]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x405bc8
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x406216
push edx
push ecx
call fcn.004bf27b
add esp, 8
lea eax, [ebp - 0xec]
push eax
push 0
push 0
push 0x4f57b0
call sub.SHELL32.dll_SHGetKnownFolderPath
test eax, eax
jne 0x405c04
lea eax, [ebp - 0xdc]
push eax
push 0
push 0
push 0x4f5790
call sub.SHELL32.dll_SHGetKnownFolderPath
test eax, eax
je 0x405c17
mov eax, str.Failed_to_get_public_desktop_folder_n
push eax
call fcn.00406230
add esp, 4
jmp 0x406078
mov edx, dword [ebp - 0xec]
xor eax, eax
mov ecx, edx
mov dword [ebp - 0x18], 0
mov dword [ebp - 0x14], 7
mov word [ebp - 0x28], ax
lea esi, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x405c36
sub ecx, esi
sar ecx, 1
push ecx
push edx
lea ecx, [ebp - 0x28]
call fcn.0040b650
push 0x4ea7dc
lea eax, [ebp - 0x28]
mov byte [ebp - 4], 7
push eax
lea eax, [ebp - 0xd0]
push eax
call fcn.00401920
push str.Synology_Active_Backup_for_Business_Agent.lnk
push eax
lea eax, [ebp - 0x40]
mov byte [ebp - 4], 8
push eax
call fcn.00401920
mov esi, eax
add esp, 0x18
lea eax, [ebp - 0xa0]
cmp eax, esi
je 0x405d0f
mov edx, dword [ebp - 0x8c]
cmp edx, 8
jb 0x405cce
mov ecx, dword [ebp - 0xa0]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x405cc4
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40621b
push edx
push ecx
call fcn.004bf27b
add esp, 8
mov dword [ebp - 0x90], 0
xor eax, eax
mov dword [ebp - 0x8c], 7
mov word [ebp - 0xa0], ax
movups xmm0, xmmword [esi]
movups xmmword [ebp - 0xa0], xmm0
movq xmm0, qword [esi + 0x10]
movq qword [ebp - 0x90], xmm0
mov dword [esi + 0x10], eax
mov dword [esi + 0x14], 7
mov word [esi], ax
lea ecx, [ebp - 0x40]
call fcn.00403870
lea ecx, [ebp - 0xd0]
call fcn.00403870
mov edx, dword [ebp - 0x14]
mov byte [ebp - 4], 5
cmp edx, 8
jb 0x405d60
mov ecx, dword [ebp - 0x28]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x405d56
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40621b
push edx
push ecx
call fcn.004bf27b
add esp, 8
mov edx, dword [ebp - 0xdc]
xor eax, eax
mov ecx, edx
mov dword [ebp - 0x18], 0
mov dword [ebp - 0x14], 7
mov word [ebp - 0x28], ax
lea esi, [ecx + 2]
nop
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x405d80
sub ecx, esi
sar ecx, 1
push ecx
push edx
lea ecx, [ebp - 0x28]
call fcn.0040b650
push 0x4ea7dc
lea eax, [ebp - 0x28]
mov byte [ebp - 4], 9
push eax
lea eax, [ebp - 0x40]
push eax
call fcn.00401920
push str.SynologySynology_Active_Backup_for_Business_Agent.lnk
push eax
lea eax, [ebp - 0xd0]
mov byte [ebp - 4], 0xa
push eax
call fcn.00401920
mov esi, eax
add esp, 0x18
lea eax, [ebp - 0x88]
cmp eax, esi
je 0x405e49
mov edx, dword [ebp - 0x74]
cmp edx, 8
jb 0x405e11
mov ecx, dword [ebp - 0x88]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x405e07
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x406220
push edx
push ecx
call fcn.004bf27b
add esp, 8
mov dword [ebp - 0x78], 0
xor eax, eax
mov dword [ebp - 0x74], 7
mov word [ebp - 0x88], ax
movups xmm0, xmmword [esi]
movups xmmword [ebp - 0x88], xmm0
movq xmm0, qword [esi + 0x10]
movq qword [ebp - 0x78], xmm0
mov dword [esi + 0x10], eax
mov dword [esi + 0x14], 7
mov word [esi], ax
lea ecx, [ebp - 0xd0]
call fcn.00403870
lea ecx, [ebp - 0x40]
call fcn.00403870
mov edx, dword [ebp - 0x14]
mov byte [ebp - 4], 5
cmp edx, 8
jb 0x405e9a
mov ecx, dword [ebp - 0x28]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x405e90
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x406220
push edx
push ecx
call fcn.004bf27b
add esp, 8
mov edx, dword [ebp - 0xdc]
xor eax, eax
mov ecx, edx
mov dword [ebp - 0x18], 0
mov dword [ebp - 0x14], 7
mov word [ebp - 0x28], ax
lea esi, [ecx + 2]
nop dword [eax]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x405ec0
sub ecx, esi
sar ecx, 1
push ecx
push edx
lea ecx, [ebp - 0x28]
call fcn.0040b650
push 0x4ea7e0
lea eax, [ebp - 0x28]
mov byte [ebp - 4], 0xb
push eax
lea eax, [ebp - 0xd0]
push eax
call fcn.00401920
mov esi, eax
add esp, 0xc
lea eax, [ebp - 0x70]
cmp eax, esi
je 0x405f6a
mov edx, dword [ebp - 0x5c]
cmp edx, 8
jb 0x405f38
mov ecx, dword [ebp - 0x70]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x405f2e
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x406225
push edx
push ecx
call fcn.004bf27b
add esp, 8
mov dword [ebp - 0x60], 0
xor eax, eax
mov dword [ebp - 0x5c], 7
mov word [ebp - 0x70], ax
movups xmm0, xmmword [esi]
movups xmmword [ebp - 0x70], xmm0
movq xmm0, qword [esi + 0x10]
movq qword [ebp - 0x60], xmm0
mov dword [esi + 0x10], eax
mov dword [esi + 0x14], 7
mov word [esi], ax
lea ecx, [ebp - 0xd0]
call fcn.00403870
mov edx, dword [ebp - 0x14]
mov byte [ebp - 4], 5
cmp edx, 8
jb 0x405fb3
mov ecx, dword [ebp - 0x28]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x405fa9
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x406225
push edx
push ecx
call fcn.004bf27b
add esp, 8
mov eax, dword [ebp - 0xd8]
test al, al
je 0x405fc6
cmp byte [ebp - 0xe4], 0
je 0x405ffe
cmp dword [ebp - 0x8c], 8
lea ecx, [ebp - 0xa0]
push 0x4ea570
cmovae ecx, dword [ebp - 0xa0]
lea eax, [ebp - 0x58]
cmp dword [ebp - 0x44], 8
push ecx
cmovae eax, dword [ebp - 0x58]
push eax
call fcn.004055c0
mov eax, dword [ebp - 0xd8]
add esp, 0xc
test al, al
je 0x40600b
cmp byte [ebp - 0xe8], 0
jne 0x40600b
test al, al
jne 0x406062
cmp dword [ebp - 0x5c], 8
lea eax, [ebp - 0x70]
cmovae eax, dword [ebp - 0x70]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
jne 0x406037
cmp dword [ebp - 0x5c], 8
lea eax, [ebp - 0x70]
push 0
cmovae eax, dword [ebp - 0x70]
push eax
push 0
call dword [sym.imp.SHELL32.dll_SHCreateDirectoryExW]
cmp dword [ebp - 0x74], 8
lea ecx, [ebp - 0x88]
push 0x4ea570
cmovae ecx, dword [ebp - 0x88]
lea eax, [ebp - 0x58]
cmp dword [ebp - 0x44], 8
push ecx
cmovae eax, dword [ebp - 0x58]
push eax
call fcn.004055c0
add esp, 0xc
push dword [ebp - 0xec]
mov esi, dword [sym.imp.ole32.dll_CoTaskMemFree]
call esi
push dword [ebp - 0xdc]
call esi
mov edx, dword [ebp - 0x5c]
cmp edx, 8
jb 0x4060b2
mov ecx, dword [ebp - 0x70]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x4060a8
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40622a
push edx
push ecx
call fcn.004bf27b
add esp, 8
mov edx, dword [ebp - 0x74]
xor eax, eax
mov dword [ebp - 0x60], 0
mov dword [ebp - 0x5c], 7
mov word [ebp - 0x70], ax
cmp edx, 8
jb 0x406103
mov ecx, dword [ebp - 0x88]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x4060f9
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40622a
push edx
push ecx
call fcn.004bf27b
add esp, 8
mov edx, dword [ebp - 0x8c]
xor eax, eax
mov dword [ebp - 0x78], 0
mov dword [ebp - 0x74], 7
mov word [ebp - 0x88], ax
cmp edx, 8
jb 0x40615a
mov ecx, dword [ebp - 0xa0]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x406150
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40622a
push edx
push ecx
call fcn.004bf27b
add esp, 8
mov edx, dword [ebp - 0x44]
xor eax, eax
mov dword [ebp - 0x90], 0
mov dword [ebp - 0x8c], 7
mov word [ebp - 0xa0], ax
cmp edx, 8
jb 0x4061b1
mov ecx, dword [ebp - 0x58]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x4061a7
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40622a
push edx
push ecx
call fcn.004bf27b
add esp, 8
xor eax, eax
mov dword [ebp - 0x48], 0
mov dword [ebp - 0x44], 7
mov word [ebp - 0x58], ax
mov eax, dword [ebp - 0xa4]
cmp eax, 8
jb 0x4061fb
lea ecx, [eax*2 + 2]
mov eax, edi
cmp ecx, 0x1000
jb 0x4061f1
mov edi, dword [edi - 4]
add ecx, 0x23
sub eax, edi
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40622a
push ecx
push edi
call fcn.004bf27b
add esp, 8
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.004bf6e8
mov esp, ebp
pop ebp
ret
call fcn.004c4b9a
call fcn.004c4b9a
call fcn.004c4b9a
call fcn.004c4b9a
call fcn.004c4b9a
int3