Function at 0x405040
Capabilities:
Get common file path

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x4c0
mov eax, dword [0x417738]
push ebx
push esi
mov esi, 1
push edi
mov edi, dword [sym.imp.USER32.dll_wsprintfA]
push esi
push eax
lea ecx, [ebp - 0x238]
xor ebx, ebx
push str._spftw_d.pkg
push ecx
mov dword [ebp - 4], ebx
mov dword [ebp - 8], ebx
call edi
add esp, 0x10
lea edx, [ebp - 0x238]
push ebx
push edx
call fcn.00401220
add esp, 8
test eax, eax
je 0x4050ed
lea eax, [ebp - 8]
lea ecx, [ebp - 0x238]
push eax
push ecx
call fcn.00401090
add esp, 8
test eax, eax
jbe 0x405230
mov ecx, dword [ebp - 8]
test ecx, ecx
jl 0x4050b6
add ebx, eax
test ecx, ecx
jl 0x4050b6
inc esi
jmp 0x4050bf
cmp ecx, 0xfffffff6
je 0x4051b2
mov edx, dword [0x417738]
push esi
push edx
lea eax, [ebp - 0x238]
push str._spftw_d.pkg
push eax
call edi
add esp, 0x10
lea ecx, [ebp - 0x238]
push 0
push ecx
call fcn.00401220
add esp, 8
test eax, eax
jne 0x40508b
cmp dword [ebp - 8], 0xfffffff6
jne 0x4050fc
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov esi, dword [ebp + 8]
mov edi, 4
push esi
call fcn.00401270
add esp, 4
test eax, eax
je 0x40511b
cmp eax, ebx
sbb eax, eax
inc eax
mov dword [ebp - 4], eax
jmp 0x40511e
mov eax, dword [ebp - 4]
test eax, eax
jne 0x40519b
mov ecx, dword [ebp + 0x10]
test ecx, ecx
je 0x40519b
lea edx, [ebp - 0x30]
push 0x1e
push edx
push ebx
call fcn.004052a0
mov ecx, dword [0x4177c8]
add esp, 0xc
fstp qword [ebp - 0x10]
lea eax, [ebp - 0x2b8]
push 0x104
push eax
push 0x13a
push ecx
call dword [sym.imp.USER32.dll_LoadStringA]
mov eax, dword [ebp - 0xc]
mov ecx, dword [ebp - 0x10]
lea edx, [ebp - 0x30]
push edx
push eax
push ecx
lea edx, [ebp - 0x2b8]
push esi
lea eax, [ebp - 0x134]
push edx
push eax
call fcn.0040c000
mov ecx, dword [0x41776c]
mov eax, dword [ebp + 0xc]
add esp, 0x18
lea edx, [ebp - 0x134]
push 0x15
push ecx
push edx
push eax
call dword [sym.imp.USER32.dll_MessageBoxA]
mov edi, eax
mov eax, dword [ebp - 4]
cmp edi, 4
jne 0x4051ab
test eax, eax
je 0x405104
mov eax, dword [ebp - 4]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [0x4177c8]
lea edx, [ebp - 0x3bc]
push 0x104
push edx
push 0x13e
push eax
call dword [sym.imp.USER32.dll_LoadStringA]
lea ecx, [ebp - 0x4c0]
push 0x104
push ecx
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryA]
lea edx, [ebp - 0x4c0]
push 4
lea eax, [ebp - 0x4c0]
push edx
push eax
call dword [sym.imp.KERNEL32.dll_lstrcpynA]
lea ecx, [ebp - 0x4c0]
lea edx, [ebp - 0x3bc]
push ecx
lea eax, [ebp - 0x134]
push edx
push eax
call edi
mov ecx, dword [0x41776c]
mov eax, dword [ebp + 0xc]
add esp, 0xc
lea edx, [ebp - 0x134]
push 0x10
push ecx
push edx
push eax
call dword [sym.imp.USER32.dll_MessageBoxA]
jmp 0x4050ed
mov eax, dword [ebp + 0x10]
test eax, eax
je 0x4050f3
mov edx, dword [0x4177c8]
mov esi, dword [sym.imp.USER32.dll_LoadStringA]
lea ecx, [ebp - 0x3bc]
push 0x104
push ecx
push 0x139
push edx
call esi
mov ecx, dword [0x4177c8]
lea eax, [ebp - 0x134]
push 0x104
push eax
push 1
push ecx
call esi
mov ecx, dword [ebp + 0xc]
lea edx, [ebp - 0x134]
push 0x10
lea eax, [ebp - 0x3bc]
push edx
push eax
push ecx
call dword [sym.imp.USER32.dll_MessageBoxA]
pop edi
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret