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

Disassembly:
sub esp, 0x10
push ebx
push ebp
push esi
mov esi, dword [0x4380d0]
push edi
push 2
call fcn.00407150
xor ebx, ebx
cmp eax, ebx
je 0x404102
call eax
movzx eax, ax
push eax
push 0x445000
call fcn.00406a55
jmp 0x40415c
mov edi, 0x42ebf8
push ebx
push edi
push ebx
push str.Control_PanelDesktopResourceLocale
push 0x80000001
mov word [0x445000], 0x30
mov word [0x445002], 0x78
mov word [0x445004], bx
call fcn.004069dc
cmp word [0x42ebf8], bx
jne 0x404151
push ebx
push edi
push 0x4093dc
push str..DEFAULTControl_PanelInternational
push 0x80000003
call fcn.004069dc
push edi
push 0x445000
call sub.KERNEL32.dll_lstrcatW
call fcn.004043cc
mov eax, dword [0x4380d8]
mov ebp, 0x443800
and eax, 0x20
push ebp
mov dword [0x438140], eax
mov dword [0x43815c], 0x10000
call fcn.004064e5
test eax, eax
jne 0x404217
mov ecx, dword [esi + 0x48]
cmp ecx, ebx
je 0x404217
mov edx, dword [esi + 0x4c]
mov eax, dword [0x4380f8]
mov edi, 0x435060
push ebx
lea edx, [eax + edx*2]
push edi
lea eax, [eax + ecx*2]
push edx
push eax
push dword [esi + 0x44]
call fcn.004069dc
mov ax, word [0x435060]
cmp ax, bx
je 0x404217
cmp ax, 0x22
jne 0x4041d6
mov edi, 0x435062
push 0x22
push edi
call fcn.0040640a
mov word [eax], bx
push edi
call sub.KERNEL32.dll_lstrlenW
lea eax, [edi + eax*2 - 8]
cmp eax, edi
jbe 0x40420a
push str..exe
push eax
call dword [sym.imp.KERNEL32.dll_lstrcmpiW]
test eax, eax
jne 0x40420a
push edi
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x404204
test al, 0x10
jne 0x40420a
push edi
call fcn.00406429
push edi
call fcn.004063dd
push eax
push ebp
call fcn.00406b0e
push ebp
call fcn.004064e5
test eax, eax
jne 0x40422d
push dword [esi + 0x118]
push ebp
call fcn.00406b4b
test byte [0x4380d8], 0x10
je 0x40424d
cmp dword [0x4380dc], ebx
jne 0x40424d
call fcn.004040b5
mov dword [0x435040], 1
push 0x8040
push ebx
push ebx
push 1
push 0x67
push dword [0x4380c0]
call dword [sym.imp.USER32.dll_LoadImageW]
mov dword [0x4370a8], eax
cmp dword [esi + 0x50], 0xffffffff
mov edi, 0x437060
je 0x4042f3
mov ecx, dword [0x4380c0]
mov esi, 0x40c090
push edi
mov dword [0x437064], 0x401000
mov dword [0x437070], ecx
mov dword [0x437074], eax
mov dword [0x437084], esi
call dword [sym.imp.USER32.dll_RegisterClassW]
test ax, ax
je 0x4043c2
lea eax, [esp + 0x10]
push ebx
push eax
push ebx
push 0x30
call dword [sym.imp.USER32.dll_SystemParametersInfoW]
push ebx
push dword [0x4380c0]
mov eax, dword [esp + 0x24]
sub eax, dword [esp + 0x1c]
push ebx
push ebx
push eax
mov eax, dword [esp + 0x2c]
sub eax, dword [esp + 0x24]
push eax
push dword [esp + 0x2c]
push dword [esp + 0x2c]
push 0x80000000
push ebx
push esi
push 0x80
call dword [sym.imp.USER32.dll_CreateWindowExW]
mov dword [0x42e3d8], eax
push ebx
call fcn.0040140b
test eax, eax
je 0x404305
push 2
pop eax
jmp 0x4043c4
call fcn.004043cc
cmp dword [0x438160], ebx
jne 0x404399
push 5
push dword [0x42e3d8]
call dword [sym.imp.USER32.dll_ShowWindow]
push str.RichEd20
call fcn.004070e0
test eax, eax
jne 0x40433c
push str.RichEd32
call fcn.004070e0
mov esi, dword [sym.imp.USER32.dll_GetClassInfoW]
mov ebp, str.RichEdit20W
push edi
push ebp
push ebx
call esi
test eax, eax
jne 0x404366
push edi
push str.RichEdit
push ebx
call esi
push edi
mov dword [0x437084], ebp
call dword [sym.imp.USER32.dll_RegisterClassW]
mov eax, dword [0x4370a0]
push ebx
add eax, 0x69
push 0x4044a4
movzx eax, ax
push ebx
push eax
push dword [0x4380c0]
call dword [sym.imp.USER32.dll_DialogBoxParamW]
push 5
mov esi, eax
call fcn.0040140b
push 1
call fcn.00404005
mov eax, esi
jmp 0x4043c4
push ebx
call fcn.00405bd8
test eax, eax
je 0x4043bb
cmp dword [0x43708c], ebx
jne 0x4042fd
push 2
call fcn.0040140b
jmp 0x4042fd
push 1
call fcn.0040140b
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x10
ret