Function at 0x405490
Capabilities:
Get common file path

Disassembly:
push 0xffffffffffffffff
push 0x406db8
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x110
push ebp
push esi
mov esi, dword [esp + 0x128]
mov dword [esp + 0xc], ecx
mov eax, dword [esi]
mov ecx, dword [eax - 8]
test ecx, ecx
je 0x405786
push 0x2f
mov ecx, esi
call sub.MFC42.DLL_CString::Find_1
or ebp, 0xffffffff
cmp eax, ebp
je 0x405506
dec eax
lea ecx, [esp + 8]
push eax
push ecx
mov ecx, esi
call sub.MFC42.DLL_CString::Left
push eax
mov ecx, esi
mov dword [esp + 0x124], 0
call fcn.00405f0c
lea ecx, [esp + 8]
mov dword [esp + 0x120], ebp
call fcn.00405ea6
push ebx
push edi
lea edx, [esp + 0x10]
push 4
push edx
mov ecx, esi
call sub.MFC42.DLL_CString::Left
mov eax, dword [eax]
mov edi, dword [sym.imp.MSVCRT.dll__mbscmp]
push 0x40a62c
push eax
call edi
add esp, 8
lea ecx, [esp + 0x10]
test eax, eax
sete bl
call fcn.00405ea6
test bl, bl
je 0x405571
push 0x104
lea eax, [esp + 0x14]
push 4
push eax
mov ecx, esi
call sub.MFC42.DLL_CString::Mid
push eax
mov ecx, esi
mov dword [esp + 0x12c], 1
call fcn.00405f0c
lea ecx, [esp + 0x10]
mov dword [esp + 0x128], ebp
call fcn.00405ea6
mov ecx, esi
call sub.MFC42.DLL_CString::MakeLower
push 0x40a624
mov ecx, esi
call sub.MFC42.DLL_CString::Find
cmp eax, ebp
je 0x4055bb
add eax, 4
lea ecx, [esp + 0x10]
push eax
push ecx
mov ecx, esi
call sub.MFC42.DLL_CString::Left
push eax
mov ecx, esi
mov dword [esp + 0x12c], 2
call fcn.00405f0c
lea ecx, [esp + 0x10]
mov dword [esp + 0x128], ebp
call fcn.00405ea6
push 0x40a618
mov ecx, esi
call sub.MFC42.DLL_CString::Find
cmp eax, ebp
je 0x4055fe
add eax, 8
lea edx, [esp + 0x10]
push eax
push edx
mov ecx, esi
call sub.MFC42.DLL_CString::Left
push eax
mov ecx, esi
mov dword [esp + 0x12c], 3
call fcn.00405f0c
lea ecx, [esp + 0x10]
mov dword [esp + 0x128], ebp
call fcn.00405ea6
lea eax, [esp + 0x1c]
push 0x104
push eax
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryA]
lea ecx, [esp + 0x1c]
push 0x40a614
push ecx
call dword [sym.imp.KERNEL32.dll_lstrcatA]
lea edx, [esp + 0x10]
push 9
push edx
mov ecx, esi
call sub.MFC42.DLL_CString::Left
mov eax, dword [eax]
push 0x40a608
push eax
call edi
add esp, 8
lea ecx, [esp + 0x10]
test eax, eax
sete bl
call fcn.00405ea6
test bl, bl
je 0x40567e
lea eax, [esp + 0x1c]
push esi
lea ecx, [esp + 0x14]
push eax
push ecx
call sub.MFC42.DLL_operator
push eax
mov ecx, esi
mov dword [esp + 0x12c], 4
call fcn.00405f0c
mov dword [esp + 0x128], ebp
lea ecx, [esp + 0x10]
jmp 0x405705
lea edx, [esp + 0x10]
push 0xc
push edx
mov ecx, esi
call sub.MFC42.DLL_CString::Left
mov eax, dword [eax]
push 0x40a5f8
push eax
call edi
add esp, 8
lea ecx, [esp + 0x10]
test eax, eax
sete bl
call fcn.00405ea6
test bl, bl
je 0x40570a
push 0x104
lea eax, [esp + 0x1c]
push 0xc
push eax
mov ecx, esi
call sub.MFC42.DLL_CString::Mid
lea ecx, [esp + 0x1c]
push eax
lea edx, [esp + 0x14]
mov ebx, 5
push ecx
push edx
mov dword [esp + 0x134], ebx
call sub.MFC42.DLL_operator
push eax
mov ecx, esi
mov byte [esp + 0x12c], 6
call fcn.00405f0c
lea ecx, [esp + 0x10]
mov byte [esp + 0x128], bl
call fcn.00405ea6
mov dword [esp + 0x128], ebp
lea ecx, [esp + 0x18]
call fcn.00405ea6
mov eax, dword [esp + 0x14]
cmp dword [eax + 0x50], 0x30
jne 0x405736
mov eax, dword [esi]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFindExtensionA]
mov edi, eax
mov ecx, ebp
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
jne 0x405736
push 0x40a5f0
mov ecx, esi
call sub.MFC42.DLL_CString::operator
mov edx, dword [esi]
pop edi
pop ebx
mov al, byte [edx]
cmp al, 0x22
jne 0x405786
mov ecx, 1
mov al, byte [edx + ecx]
test al, al
je 0x405753
cmp al, 0x22
je 0x405753
inc ecx
jmp 0x405745
dec ecx
push ecx
lea ecx, [esp + 0x10]
push 1
push ecx
mov ecx, esi
call sub.MFC42.DLL_CString::Mid
push eax
mov ecx, esi
mov dword [esp + 0x124], 7
call fcn.00405f0c
lea ecx, [esp + 0xc]
mov dword [esp + 0x120], ebp
call fcn.00405ea6
mov ecx, dword [esp + 0x118]
pop esi
pop ebp
mov dword fs:[0], ecx
add esp, 0x11c
ret 4