Function at 0x4058b9
Capabilities:
Check if file exists
Get file attributes

Disassembly:
mov eax, dword [0x431124]
sub esp, 0x14
push ebx
push ebp
push esi
mov esi, dword [0x4310c8]
and eax, 0x20
push edi
mov dword [0x431140], eax
call fcn.00403f6a
mov ebp, 0x437400
push ebp
call fcn.0040608c
xor ebx, ebx
test eax, eax
jne 0x40596d
mov ecx, dword [esi + 0x48]
cmp ecx, ebx
je 0x40596d
mov eax, dword [0x4310f8]
mov edx, dword [esi + 0x4c]
mov edi, 0x42fc60
push edi
add edx, eax
push edx
add ecx, eax
push ecx
push dword [esi + 0x44]
call fcn.00405d50
mov al, byte [0x42fc60]
cmp al, bl
je 0x40596d
cmp al, 0x22
jne 0x40592c
push 0x22
mov edi, 0x42fc61
push edi
call fcn.00405c29
mov byte [eax], bl
push edi
call sub.KERNEL32.dll_lstrlenA
lea eax, [eax + edi - 4]
cmp eax, edi
jbe 0x405960
push str..exe
push eax
call dword [sym.imp.KERNEL32.dll_lstrcmpiA]
test eax, eax
jne 0x405960
push edi
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, 0xffffffff
je 0x40595a
test al, 0x10
jne 0x405960
push edi
call fcn.00406066
push edi
call fcn.00406005
push eax
push ebp
call sub.KERNEL32.dll_lstrcpyA
push ebp
call fcn.0040608c
test eax, eax
jne 0x405983
push dword [esi + 0x118]
push ebp
call fcn.00406416
xor ebp, ebp
inc ebp
test byte [0x431124], 0x10
je 0x4059a2
cmp dword [0x431120], ebx
jne 0x4059a2
call fcn.00403f48
mov dword [0x42ec48], ebp
push 0x8040
push ebx
push ebx
push ebp
push 0x67
push dword [0x4310c4]
call dword [sym.imp.USER32.dll_LoadImageA]
mov dword [0x430890], eax
cmp dword [esi + 0x50], 0xffffffff
mov edi, 0x430860
je 0x405a55
mov ecx, dword [0x4310c4]
mov dword [0x430874], eax
lea eax, [esp + 0x10]
push edi
mov dword [esp + 0x14], 0x624e5f
mov dword [0x430864], 0x401000
mov dword [0x430870], ecx
mov dword [0x430884], eax
call dword [sym.imp.USER32.dll_RegisterClassA]
test ax, ax
je 0x405b2b
push ebx
lea eax, [esp + 0x18]
push eax
push ebx
push 0x30
call dword [sym.imp.USER32.dll_SystemParametersInfoA]
mov eax, dword [esp + 0x20]
sub eax, dword [esp + 0x18]
push ebx
push dword [0x4310c4]
push ebx
push ebx
push eax
mov eax, dword [esp + 0x30]
sub eax, dword [esp + 0x28]
push eax
push dword [esp + 0x30]
lea eax, [esp + 0x2c]
push dword [esp + 0x30]
push 0x80000000
push ebx
push eax
push 0x80
call dword [sym.imp.USER32.dll_CreateWindowExA]
mov dword [0x42ad14], eax
push ebx
call fcn.004014c9
test eax, eax
je 0x405a67
push 2
pop eax
jmp 0x405b2d
call fcn.00403f6a
cmp dword [0x431160], ebx
jne 0x405b03
push 5
push dword [0x42ad14]
call dword [sym.imp.USER32.dll_ShowWindow]
mov esi, dword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov ebp, str.RichEd20.dll
push ebp
call esi
test eax, eax
jne 0x405aa4
push ebp
mov word [0x40a052], 0x3233
call esi
mov ebp, dword [sym.imp.USER32.dll_GetClassInfoA]
push edi
mov esi, str.RichEdit20A
push esi
push ebx
call ebp
test eax, eax
jne 0x405ad7
push edi
push esi
push ebx
mov byte [0x40a048], bl
call ebp
push edi
mov dword [0x430884], esi
mov byte [0x40a048], 0x32
call dword [sym.imp.USER32.dll_RegisterClassA]
mov eax, dword [0x43089c]
push ebx
push 0x4053f6
add eax, 0x69
movzx eax, ax
push ebx
push eax
push dword [0x4310c4]
call dword [sym.imp.USER32.dll_DialogBoxParamA]
push 5
mov esi, eax
call fcn.004014c9
mov eax, esi
jmp 0x405b2d
push ebx
call fcn.00404fd6
test eax, eax
je 0x405b25
cmp dword [0x430894], ebx
jne 0x405a5f
push 2
call fcn.004014c9
jmp 0x405a5f
push ebp
call fcn.004014c9
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x14
ret