Function at 0x405720
Capabilities:
Get common file path
Get program files directory

Disassembly:
push 0xffffffffffffffff
push 0x4868d8
mov eax, dword fs:[0]
push eax
sub esp, 0x830
mov eax, dword [0x4a60f8]
xor eax, esp
mov dword [esp + 0x828], eax
push ebx
push ebp
push esi
push edi
mov eax, dword [0x4a60f8]
xor eax, esp
push eax
lea eax, [esp + 0x844]
mov dword fs:[0], eax
mov eax, dword [esp + 0x854]
mov esi, ecx
lea ecx, [esp + 0x20]
push ecx
mov edi, str.Setup_DefaultPath
mov dword [esp + 0x28], eax
call fcn.00402330
push esi
lea edx, [esp + 0x24]
lea esi, [esp + 0x30]
mov dword [esp + 0x850], 0
call fcn.00408fe0
mov byte [esp + 0x84c], 2
mov esi, dword [esp + 0x20]
mov ebp, dword [sym.imp.KERNEL32.dll_InterlockedDecrement]
test esi, esi
je 0x4057d6
lea edx, [esi + 8]
push edx
call ebp
test eax, eax
jne 0x4057d6
mov eax, dword [esi]
test eax, eax
je 0x4057bd
push eax
call dword [sym.imp.OLEAUT32.dll_SysStringLen]
mov eax, dword [esi + 4]
test eax, eax
je 0x4057cd
push eax
call fcn.00462471
add esp, 4
push esi
call fcn.00458da0
add esp, 4
cmp dword [esp + 0x34], 0
sete al
test al, al
sete al
test al, al
je 0x4057f8
cmp dword [esp + 0x30], 0
sete al
test al, al
sete al
test al, al
jne 0x405813
lea ecx, [esp + 0x2c]
mov dword [esp + 0x84c], 0xffffffff
call fcn.004024a0
xor eax, eax
jmp 0x405b9b
mov eax, dword [0x4a7e58]
mov edx, dword [eax + 0xc]
mov ecx, 0x4a7e58
call edx
add eax, 0x10
mov dword [esp + 0x20], eax
mov byte [esp + 0x84c], 3
mov eax, dword [0x4a7e58]
mov edx, dword [eax + 0xc]
mov ecx, 0x4a7e58
call edx
add eax, 0x10
mov dword [esp + 0x28], eax
lea eax, [esp + 0x1c]
mov bl, 4
push eax
mov edi, str.Root
mov byte [esp + 0x850], bl
call fcn.00402330
push 0
lea ecx, [esp + 0x24]
push ecx
mov ecx, eax
lea esi, [esp + 0x34]
mov byte [esp + 0x854], 5
call fcn.004080e0
mov byte [esp + 0x84c], bl
mov eax, dword [esp + 0x1c]
test eax, eax
je 0x4058be
mov esi, eax
add eax, 8
push eax
call ebp
test eax, eax
jne 0x4058be
test esi, esi
je 0x4058be
mov eax, dword [esi]
test eax, eax
je 0x4058a5
push eax
call dword [sym.imp.OLEAUT32.dll_SysStringLen]
mov eax, dword [esi + 4]
test eax, eax
je 0x4058b5
push eax
call fcn.00462471
add esp, 4
push esi
call fcn.00458da0
add esp, 4
lea edx, [esp + 0x1c]
push edx
mov edi, 0x494dd8
call fcn.00402330
push 0
lea ecx, [esp + 0x2c]
push ecx
mov ecx, eax
lea esi, [esp + 0x34]
mov byte [esp + 0x854], 6
call fcn.004080e0
mov byte [esp + 0x84c], bl
mov eax, dword [esp + 0x1c]
test eax, eax
je 0x40592c
mov esi, eax
add eax, 8
push eax
call ebp
test eax, eax
jne 0x40592c
test esi, esi
je 0x40592c
mov eax, dword [esi]
test eax, eax
je 0x405913
push eax
call dword [sym.imp.OLEAUT32.dll_SysStringLen]
mov eax, dword [esi + 4]
test eax, eax
je 0x405923
push eax
call fcn.00462471
add esp, 4
push esi
call fcn.00458da0
add esp, 4
lea edx, [esp + 0x1c]
push edx
mov edi, str.ForceCreateFolder
call fcn.00402330
mov ecx, dword [esp + 0x24]
add ecx, 0x144
push 0
push ecx
mov ecx, eax
lea esi, [esp + 0x34]
mov byte [esp + 0x854], 7
call fcn.004080e0
mov byte [esp + 0x84c], bl
mov eax, dword [esp + 0x1c]
test eax, eax
je 0x4059a0
mov esi, eax
add eax, 8
push eax
call ebp
test eax, eax
jne 0x4059a0
test esi, esi
je 0x4059a0
mov eax, dword [esi]
test eax, eax
je 0x405987
push eax
call dword [sym.imp.OLEAUT32.dll_SysStringLen]
mov eax, dword [esi + 4]
test eax, eax
je 0x405997
push eax
call fcn.00462471
add esp, 4
push esi
call fcn.00458da0
add esp, 4
push 0x800
lea edx, [esp + 0x40]
push 0
push edx
call fcn.00461950
mov edi, dword [esp + 0x2c]
xor eax, eax
add esp, 0xc
mov word [esp + 0x3c], ax
test edi, edi
je 0x4059f0
push str.TargetDir
push edi
call fcn.004626b1
add esp, 8
test eax, eax
jne 0x4059f0
mov ecx, dword [0x4a97e4]
push 0x400
push ecx
lea edx, [esp + 0x44]
push edx
call fcn.00462b97
add esp, 0xc
jmp 0x405a14
push 0x400
lea ebx, [esp + 0x40]
call fcn.0040fd50
add esp, 4
test eax, eax
jne 0x405a14
push 1
push 0x26
mov eax, ebx
push eax
push 0
call dword [sym.imp.SHELL32.dll_SHGetSpecialFolderPathW]
mov ebp, dword [esp + 0x28]
cmp dword [ebp - 0xc], 0
je 0x405a2d
push ebp
lea ecx, [esp + 0x40]
push ecx
mov edx, ecx
push edx
call dword [sym.imp.SHLWAPI.dll_PathCombineW]
mov ebx, dword [esp + 0x24]
mov eax, dword [ebx + 4]
test eax, eax
je 0x405a7c
mov edx, dword [esp + 0x3c]
mov ecx, dword [eax]
push edx
push eax
mov eax, dword [ecx + 0x4c]
call eax
mov esi, dword [ebx + 0xf8]
mov edi, eax
mov ecx, edx
mov eax, esi
shrd edi, ecx, 0x14
cdq
shr ecx, 0x14
cmp ecx, edx
ja 0x405a7c
jb 0x405a63
cmp edi, eax
jae 0x405a7c
mov eax, dword [ebx + 4]
mov ecx, dword [eax]
mov edx, dword [ecx + 0x54]
push esi
push eax
call edx
movzx eax, ax
test ax, ax
je 0x405a7c
mov word [esp + 0x3c], ax
lea ecx, [esp + 0x3c]
lea eax, [ebx + 0x140]
lea esi, [ecx + 2]
lea esp, [esp]
mov dx, word [ecx]
add ecx, 2
test dx, dx
jne 0x405a90
sub ecx, esi
sar ecx, 1
lea edx, [esp + 0x3c]
push edx
mov ebx, ecx
call fcn.00402250
lea eax, [esp + 0x1c]
push eax
mov edi, str.CanChange
mov byte [esp + 0x1f], 1
call fcn.00402330
lea ecx, [esp + 0x1b]
push ecx
mov ecx, eax
lea esi, [esp + 0x30]
mov byte [esp + 0x850], 8
call fcn.00407d20
mov eax, dword [esp + 0x1c]
test eax, eax
je 0x405b21
mov esi, eax
add eax, 8
push eax
call dword [sym.imp.KERNEL32.dll_InterlockedDecrement]
test eax, eax
jne 0x405b19
test esi, esi
je 0x405b19
mov eax, dword [esi]
test eax, eax
je 0x405b00
push eax
call dword [sym.imp.OLEAUT32.dll_SysStringLen]
mov eax, dword [esi + 4]
test eax, eax
je 0x405b10
push eax
call fcn.00462471
add esp, 4
push esi
call fcn.00458da0
add esp, 4
mov dword [esp + 0x1c], 0
mov eax, dword [esp + 0x24]
xor edx, edx
cmp byte [esp + 0x1b], dl
mov byte [esp + 0x84c], 3
setne dl
mov dword [eax + 0x100], edx
lea eax, [ebp - 0x10]
lea ecx, [eax + 0xc]
mov edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x405b5a
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov byte [esp + 0x84c], 2
mov eax, dword [esp + 0x20]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x405b82
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
lea ecx, [esp + 0x2c]
mov dword [esp + 0x84c], 0xffffffff
call fcn.004024a0
mov eax, 1
mov ecx, dword [esp + 0x844]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x828]
xor ecx, esp
call fcn.00461932
add esp, 0x83c
ret 4