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

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x4c
mov edi, dword [0x431580]
mov dword [esp], 2
call fcn.00408789
mov ebx, dword [0x40c8f4]
push ecx
lea esi, [ebx + 0xc000]
test eax, eax
je 0x40654a
call eax
mov dword [esp], esi
movzx eax, ax
mov dword [esp + 4], eax
call fcn.00408382
jmp 0x4065d5
mov dword [ebx + 0xc000], 0x780030
mov word [ebx + 0xc004], 0
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0x42ca20
mov dword [esp + 8], 0
mov dword [esp + 4], str.Control_PanelDesktopResourceLocale
mov dword [esp], 0x80000001
call fcn.004082d6
sub esp, 0x14
cmp word [0x42ca20], 0
jne 0x4065c5
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0x42ca20
mov dword [esp + 8], 0x40c65c
mov dword [esp + 4], str..DEFAULTControl_PanelInternational
mov dword [esp], 0x80000003
call fcn.004082d6
sub esp, 0x14
mov dword [esp + 4], 0x42ca20
mov dword [esp], esi
call sub.KERNEL32.dll_lstrcatW
push esi
add ebx, 0xa800
push esi
call fcn.00404dff
mov eax, dword [0x4315e4]
mov dword [esp], ebx
mov dword [0x43153c], 0x10000
and eax, 0x20
mov dword [0x431520], eax
call fcn.00408645
push edx
test eax, eax
jne 0x4066e1
mov eax, dword [edi + 0x48]
test eax, eax
je 0x4066e1
mov dword [esp + 0x10], 0
mov ecx, dword [0x4315b8]
add eax, eax
mov dword [esp + 0xc], 0x432660
mov edx, dword [edi + 0x4c]
add eax, ecx
add edx, edx
mov dword [esp + 4], eax
add edx, ecx
mov dword [esp + 8], edx
mov eax, dword [edi + 0x44]
mov dword [esp], eax
call fcn.004082d6
mov ax, word [0x432660]
sub esp, 0x14
test ax, ax
je 0x4066e1
mov esi, 0x432660
cmp ax, 0x22
jne 0x406686
mov dword [esp + 4], 0x22
mov esi, 0x432662
mov dword [esp], 0x432662
call fcn.00407cf9
push ecx
push ecx
mov word [eax], 0
mov dword [esp], esi
call sub.KERNEL32.dll_lstrlenW
lea eax, [esi + eax*2 - 8]
push edx
cmp esi, eax
jae 0x4066ca
mov dword [esp + 4], str..exe
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_lstrcmpiW]
push ecx
push ecx
test eax, eax
jne 0x4066ca
mov dword [esp], esi
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
push edx
cmp eax, 0xffffffff
je 0x4066c1
test al, 0x10
jne 0x4066ca
mov dword [esp], esi
call fcn.00407d26
push eax
mov dword [esp], esi
call fcn.0040849b
push ecx
mov dword [esp + 4], eax
mov dword [esp], ebx
call fcn.00408467
push esi
push esi
mov dword [esp], ebx
call fcn.00408645
push edx
test eax, eax
jne 0x406702
mov eax, dword [edi + 0x118]
mov dword [esp], ebx
mov dword [esp + 4], eax
call fcn.004087fb
push esi
push esi
mov eax, dword [0x43160c]
mov dword [esp + 0x14], 0x8040
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0
mov dword [esp + 8], 1
mov dword [esp + 4], 0x67
mov dword [esp], eax
call dword [sym.imp.USER32.dll_LoadImageW]
sub esp, 0x18
cmp dword [edi + 0x50], 0xffffffff
mov dword [0x432630], eax
je 0x40681d
mov edx, dword [0x43160c]
mov dword [0x42c9c4], 0x401000
mov dword [0x42c9d4], eax
mov dword [0x42c9d0], edx
mov dword [0x42c9e4], 0x40c54a
mov dword [esp], 0x42c9c0
call dword [sym.imp.USER32.dll_RegisterClassW]
push ebx
xor ebx, ebx
test ax, ax
je 0x406966
lea eax, [ebp - 0x28]
mov dword [esp + 0xc], 0
mov dword [esp + 8], eax
mov dword [esp + 4], 0
mov dword [esp], 0x30
call dword [sym.imp.USER32.dll_SystemParametersInfoW]
mov eax, dword [0x43160c]
mov ecx, dword [ebp - 0x24]
sub esp, 0x10
mov edx, dword [ebp - 0x28]
mov dword [esp + 0x28], eax
mov eax, dword [ebp - 0x1c]
mov dword [esp + 0x2c], 0
sub eax, ecx
mov dword [esp + 0x24], 0
mov dword [esp + 0x1c], eax
mov eax, dword [ebp - 0x20]
mov dword [esp + 0x20], 0
sub eax, edx
mov dword [esp + 0x14], ecx
mov dword [esp + 0x18], eax
mov dword [esp + 0x10], edx
mov dword [esp + 0xc], 0x80000000
mov dword [esp + 8], 0
mov dword [esp + 4], 0x40c54a
mov dword [esp], pe_nt_image_headers32
call dword [sym.imp.USER32.dll_CreateWindowExW]
mov dword [0x42c9fc], eax
sub esp, 0x30
mov dword [esp], 0
call fcn.00403c68
mov ebx, eax
push ecx
test eax, eax
jne 0x406952
call fcn.00404dff
cmp dword [0x431540], 0
jne 0x40692b
mov eax, dword [0x42c9fc]
mov dword [esp + 4], 5
mov dword [esp], eax
call dword [sym.imp.USER32.dll_ShowWindow]
push eax
push eax
mov dword [esp], str.RichEd20
call fcn.004086f9
push edx
test eax, eax
jne 0x40687c
mov dword [esp], str.RichEd32
call fcn.004086f9
push eax
mov dword [esp + 8], 0x42c9c0
mov ebx, dword [sym.imp.USER32.dll_GetClassInfoW]
mov dword [esp + 4], str.RichEdit20W
mov dword [esp], 0
call ebx
sub esp, 0xc
test eax, eax
jne 0x4068d6
mov dword [esp + 8], 0x42c9c0
mov dword [esp + 4], 0x40c568
mov dword [esp], 0
call ebx
mov dword [0x42c9e4], 0x40c57c
sub esp, 0xc
mov dword [esp], 0x42c9c0
call dword [sym.imp.USER32.dll_RegisterClassW]
push edi
mov eax, dword [0x43263c]
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0x405398
add eax, 0x69
mov dword [esp + 8], 0
movzx eax, ax
mov dword [esp + 4], eax
mov eax, dword [0x43160c]
mov dword [esp], eax
call dword [sym.imp.USER32.dll_DialogBoxParamW]
sub esp, 0x14
mov ebx, eax
mov dword [esp], 5
call fcn.00403c68
push esi
mov dword [esp], 1
call fcn.00404c98
jmp 0x406965
mov dword [esp], 0
call fcn.00404f10
push ecx
test eax, eax
je 0x406959
cmp dword [0x432620], 0
jne 0x406952
mov dword [esp], 2
call fcn.00403c68
push edx
mov ebx, 2
jmp 0x406966
mov dword [esp], 1
call fcn.00403c68
push eax
lea esp, [ebp - 0xc]
mov eax, ebx
pop ebx
pop esi
pop edi
pop ebp
ret