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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x483cac
mov eax, dword fs:[0]
push eax
sub esp, 0x828
mov eax, dword [0x4a30f8]
xor eax, esp
mov dword [esp + 0x820], eax
push ebx
push esi
push edi
mov eax, dword [0x4a30f8]
xor eax, esp
push eax
lea eax, [esp + 0x838]
mov dword fs:[0], eax
mov edi, dword [ebp + 8]
mov ecx, dword [edi + 0x90]
mov eax, dword [ebp + 0xc]
mov edx, dword [ecx]
lea ebx, [edi + 0x90]
push ebx
mov dword [esp + 0x18], eax
mov dword [esp + 0x2c], ebx
call edx
mov eax, dword [edi + 0x88]
sub eax, dword [edi + 0x84]
lea esi, [edi + 0x78]
sar eax, 2
mov dword [esp + 0x20], esi
test eax, eax
ja 0x40d708
mov ecx, dword [ebx]
mov edx, dword [ecx + 4]
push ebx
call edx
xor eax, eax
jmp 0x40da17
mov eax, dword [0x4a4e50]
mov edx, dword [eax + 0xc]
mov ecx, 0x4a4e50
call edx
add eax, 0x10
mov dword [esp + 0x1c], eax
mov dword [esp + 0x840], 0
cmp dword [edi + 0x10], 0
jne 0x40d781
push 0x800
lea eax, [esp + 0x30]
push 0
push eax
call fcn.00461880
add esp, 0xc
lea ecx, [esp + 0x2c]
push ecx
push 0x400
call dword [sym.imp.KERNEL32.dll_GetTempPathW]
lea eax, [esp + 0x2c]
lea edx, [eax + 2]
lea ebx, [ebx]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x40d760
sub eax, edx
sar eax, 1
lea edx, [esp + 0x2c]
mov ebx, eax
push edx
lea eax, [esp + 0x20]
call fcn.00402230
jmp 0x40d78d
lea eax, [edi + 4]
lea edi, [esp + 0x1c]
call fcn.00401e10
mov eax, dword [0x4a4e50]
mov edx, dword [eax + 0xc]
mov ecx, 0x4a4e50
call edx
add eax, 0x10
mov dword [esp + 0x18], eax
mov ebx, 1
mov byte [esp + 0x840], bl
mov edx, dword [esp + 0x14]
test edx, edx
je 0x40d84b
cmp word [edx], 0
je 0x40d84b
lea edi, [esp + 0x18]
call fcn.004022d0
mov eax, dword [esp + 0x18]
add eax, 0xfffffff0
call fcn.00401e70
lea edi, [eax + 0x10]
mov dword [esp + 0x14], edi
mov byte [esp + 0x840], 2
cmp dword [edi - 4], ebx
jle 0x40d800
mov eax, dword [edi - 0xc]
push eax
lea ecx, [esp + 0x18]
push ecx
call fcn.00402100
mov edi, dword [esp + 0x14]
push edi
call dword [sym.imp.SHLWAPI.dll_PathRemoveFileSpecW]
lea esi, [esp + 0x14]
call fcn.00407720
push edi
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
jne 0x40d824
push eax
push edi
push eax
call dword [sym.imp.SHELL32.dll_SHCreateDirectoryExW]
add edi, 0xfffffff0
mov byte [esp + 0x840], bl
lea edx, [edi + 0xc]
or eax, 0xffffffff
lock xadd dword [edx], eax
dec eax
test eax, eax
jg 0x40d847
mov ecx, dword [edi]
mov edx, dword [ecx]
mov eax, dword [edx + 4]
push edi
call eax
mov esi, dword [esp + 0x20]
lea ebx, [esp + 0x18]
call fcn.0040fa00
mov ebx, eax
call fcn.0040fa80
mov ecx, dword [esp + 0x18]
cmp dword [ecx - 0xc], 0
jne 0x40d8c4
mov edx, dword [esp + 0x1c]
cmp dword [edx - 0xc], 0
mov ebx, 0x492484
je 0x40d879
mov ebx, str.360desktop.setup.log
lea eax, [esp + 0x1c]
push eax
lea ecx, [esp + 0x24]
push ecx
call fcn.00407580
add esp, 8
lea edi, [esp + 0x18]
mov byte [esp + 0x840], 3
call fcn.00401e10
mov byte [esp + 0x840], 1
mov eax, dword [esp + 0x20]
add eax, 0xfffffff0
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x40d8c4
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov ecx, dword [esp + 0x18]
push 0x492514
push ecx
call fcn.00463dfd
add esp, 8
mov dword [esp + 0x20], eax
test eax, eax
je 0x40d97f
push 2
push 0
push eax
call fcn.00464df0
mov ebx, dword [esi + 0xc]
add esp, 0xc
cmp ebx, dword [esi + 0x10]
jbe 0x40d8fc
call fcn.00461bce
mov edi, dword [esi]
mov edi, edi
mov eax, dword [esi + 0x10]
mov dword [esp + 0x14], eax
cmp dword [esi + 0xc], eax
jbe 0x40d911
call fcn.00461bce
mov eax, dword [esi]
test edi, edi
je 0x40d91b
cmp edi, eax
je 0x40d920
call fcn.00461bce
cmp ebx, dword [esp + 0x14]
je 0x40d972
test edi, edi
jne 0x40d96a
call fcn.00461bce
xor eax, eax
cmp ebx, dword [eax + 0x10]
jb 0x40d93b
call fcn.00461bce
mov edx, dword [ebx]
mov eax, dword [esp + 0x20]
push edx
push 0x49251c
push eax
call fcn.00464e75
add esp, 0xc
test edi, edi
jne 0x40d96e
call fcn.00461bce
xor eax, eax
cmp ebx, dword [eax + 0x10]
jb 0x40d965
call fcn.00461bce
add ebx, 4
jmp 0x40d900
mov eax, dword [edi]
jmp 0x40d931
mov eax, dword [edi]
jmp 0x40d95b
mov ecx, dword [esp + 0x20]
push ecx
call fcn.004632e3
add esp, 4
mov eax, dword [esi + 0x10]
mov dword [esp + 0x20], eax
cmp dword [esi + 0xc], eax
jbe 0x40d990
call fcn.00461bce
mov edi, dword [esi + 0xc]
mov ebx, dword [esi]
cmp edi, dword [esi + 0x10]
jbe 0x40d99f
call fcn.00461bce
mov edx, dword [esp + 0x20]
mov eax, dword [esi]
push edx
push ebx
push edi
push eax
push esi
lea ebx, [esp + 0x34]
call fcn.0040e200
mov eax, dword [esp + 0x28]
mov ecx, dword [eax]
mov edx, dword [ecx + 4]
push eax
call edx
mov byte [esp + 0x840], 0
mov eax, dword [esp + 0x18]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40d9e7
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov dword [esp + 0x840], 0xffffffff
mov eax, dword [esp + 0x1c]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40da12
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, 1
mov ecx, dword [esp + 0x838]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x820]
xor ecx, esp
call fcn.00461862
mov esp, ebp
pop ebp
ret 8