Function at 0x403520
Capabilities:
Get common file path

Disassembly:
push edi
lea edi, [esp + 8]
and esp, 0xfffffff0
push dword [edi - 4]
push ebp
mov ebp, esp
push edi
push esi
mov esi, eax
mov eax, 0x19
push ebx
sub esp, 0x660
mov dword [ebp - 0x650], edx
movdqa xmm0, xmmword [0x411ad0]
mov edx, 0x16
mov dword [ebp - 0x654], ecx
movaps xmmword [ebp - 0x648], xmm0
mov dword [ebp - 0x638], eax
mov dword [ebp - 0x634], edx
test byte [0x40d014], 8
jne 0x403760
mov dword [esp + 0xc], 0
lea ebx, [ebp - 0x428]
mov dword [esp + 4], 0x104
mov dword [esp + 8], ebx
mov dword [esp], esi
call dword [sym.imp.kernel32.dll_GetFullPathNameW]
sub eax, 1
sub esp, 0x10
cmp eax, 0x103
ja 0x4036e8
test byte [0x40d014], 8
jne 0x403700
mov dword [esp + 8], 0x104
lea eax, [ebp - 0x630]
mov dword [esp], ebx
mov dword [esp + 4], eax
call dword [sym.imp.kernel32.dll_GetLongPathNameW]
mov ecx, eax
sub esp, 0xc
lea eax, [eax - 1]
cmp eax, 0x103
ja 0x4036e8
test byte [0x40d014], 8
jne 0x4037f0
mov dword [ebp - 0x64c], ecx
lea edi, [ebp - 0x648]
lea esi, [ebp - 0x220]
jmp 0x403621
lea eax, [ebp - 0x630]
add edi, 4
cmp eax, edi
je 0x4036e8
mov ebx, dword [edi]
mov dword [esp + 0xc], 0
mov dword [esp + 4], esi
mov dword [esp], 0
mov dword [esp + 8], ebx
call dword [sym.imp.shell32.dll_SHGetSpecialFolderPathW]
sub esp, 0x10
test eax, eax
je 0x403610
cmp word [ebp - 0x220], 0
je 0x403880
mov eax, esi
lea esi, [esi]
nop
add eax, 2
cmp word [eax], 0
jne 0x403660
sub eax, esi
mov edx, eax
sar eax, 1
cmp dword [ebp - 0x64c], eax
jb 0x403610
cmp edx, 0x206
ja 0x403610
cmp word [ebp + eax*2 - 0x630], 0x5c
jne 0x403610
mov dword [ebp - 0x658], edx
mov dword [esp + 8], eax
lea eax, [ebp - 0x630]
mov dword [esp + 4], esi
mov dword [esp], eax
call dword [sym.imp.ucrtbase.dll__wcsnicmp]
test eax, eax
jne 0x403610
mov edx, dword [ebp - 0x658]
mov eax, dword [ebp - 0x650]
mov dword [eax], ebx
lea eax, [ebp + edx - 0x62e]
call fcn.004032c0
mov esi, dword [ebp - 0x654]
mov dword [esi], eax
mov dword [esp], eax
call dword [sym.imp.shlwapi.dll_PathRemoveExtensionW]
mov eax, 1
sub esp, 4
jmp 0x4036ea
xor eax, eax
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
lea esp, [edi - 8]
pop edi
ret
mov eax, ebx
shr eax, 0x10
test eax, eax
je 0x4037d2
mov dword [esp + 4], 0xffffffff
mov dword [esp], ebx
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov edx, eax
sub esp, 8
mov eax, str._invalid_
test edx, edx
jne 0x403733
mov eax, ebx
call fcn.00402980
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], 0x40f42c
mov dword [esp + 8], str.get_link_location
mov dword [esp + 4], 0x40d014
mov dword [esp], 3
call fcn.00402c50
jmp 0x4035b8
mov eax, esi
shr eax, 0x10
test eax, eax
je 0x4037c0
mov dword [esp + 4], 0xffffffff
mov dword [esp], esi
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov edx, eax
sub esp, 8
mov eax, str._invalid_
test edx, edx
jne 0x40378f
mov eax, esi
call fcn.00402980
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], 0x40f42c
mov dword [esp + 8], str.get_link_location
mov dword [esp + 4], 0x40d014
mov dword [esp], 3
call fcn.00402c50
jmp 0x403577
mov dword [esp + 4], esi
mov dword [esp], str._04x
call fcn.00402b40
jmp 0x40378f
mov dword [esp + 4], ebx
mov dword [esp], str._04x
call fcn.00402b40
jmp 0x403733
lea eax, [ebp - 0x630]
mov dword [ebp - 0x64c], ecx
shr eax, 0x10
test eax, eax
je 0x403889
lea eax, [ebp - 0x630]
mov dword [esp + 4], 0xffffffff
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov ecx, dword [ebp - 0x64c]
mov edx, eax
sub esp, 8
mov eax, str._invalid_
test edx, edx
jne 0x403843
lea eax, [ebp - 0x630]
call fcn.00402980
mov ecx, dword [ebp - 0x64c]
mov dword [ebp - 0x64c], ecx
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], 0x40f42c
mov dword [esp + 8], str.get_link_location
mov dword [esp + 4], 0x40d014
mov dword [esp], 3
call fcn.00402c50
mov ecx, dword [ebp - 0x64c]
jmp 0x4035f3
xor edx, edx
xor eax, eax
jmp 0x40367f
lea eax, [ebp - 0x630]
mov dword [esp], str._04x
mov dword [esp + 4], eax
call fcn.00402b40
mov ecx, dword [ebp - 0x64c]
jmp 0x403843