Function at 0x405766
Capabilities:
Check if file exists
Query or enumerate registry value

Disassembly:
push 0x3c
mov eax, 0x4091d7
call fcn.0040847e
xor edi, edi
mov dword [ebp - 0x34], edi
mov dword [ebp - 0x30], edi
lea eax, [ebp - 0x20]
push eax
mov dword [ebp - 4], edi
call dword [sym.imp.ASOHelper.dll_public:_static_class_ATL::CStringT_wchar_t__class_StrTraitMFC_DLL_wchar_t__class_ATL::ChTraitsCRT_wchar_t______cdecl_CSystweakApp::GetRegAppPath_void_]
mov byte [ebp - 4], 1
lea ecx, [ebp - 0x1c]
mov dword [esp], str.Selected
call dword [0x40a628]
lea eax, [ebp - 0x1c]
push eax
lea eax, [ebp - 0x20]
push eax
mov byte [ebp - 4], 2
call dword [sym.imp.ASOHelper.dll_enum_PCO_ERROR_CODES___cdecl_STPathAppend_class_ATL::CStringT_wchar_t__class_StrTraitMFC_DLL_wchar_t__class_ATL::ChTraitsCRT_wchar_t______class_ATL::CStringT_wchar_t__class_StrTraitMFC_DLL_wchar_t__class_ATL::ChTraitsCRT_wchar_t____const__]
pop ecx
pop ecx
lea ecx, [ebp - 0x1c]
mov byte [ebp - 4], 1
call dword [sym.imp.mfc90u.dll_ATL::CStringT_wchar_t_class_StrTraitMFC_DLL_wchar_t_class_ATL::ChTraitsCRT_wchar_t_____::CStringT_wchar_t_clas]
mov eax, dword [ebp + 0xc]
push edi
push edi
push 0x1009
push dword [eax + 0x20]
call dword [sym.imp.USER32.dll_SendMessageW]
push dword [ebp - 0x20]
mov eax, 0x2001f
lea ecx, [ebp - 0x34]
call fcn.0040739d
test eax, eax
jne 0x405820
lea ecx, [ebp - 0x48]
call sub.mfc90u.dll_CStringArray::CStringArray
lea eax, [ebp - 0x48]
push eax
mov byte [ebp - 4], 3
push dword [ebp - 0x34]
call dword [sym.imp.ASOHelper.dll_long_int___cdecl_EnumerateValues_struct_HKEY____const__class_CStringArray__]
pop ecx
pop ecx
test eax, eax
je 0x40580c
xor esi, esi
cmp dword [ebp - 0x40], edi
mov dword [ebp - 0x18], esi
jg 0x405854
lea esi, [ebp - 0x34]
call fcn.004073dd
lea ecx, [ebp - 0x48]
mov byte [ebp - 4], 1
call fcn.004076a2
mov eax, dword [ebp + 0xc]
push edi
push edi
push 0x1004
push dword [eax + 0x20]
call dword [sym.imp.USER32.dll_SendMessageW]
lea ecx, [ebp - 0x20]
mov dword [0x411edc], eax
call dword [sym.imp.mfc90u.dll_ATL::CStringT_wchar_t_class_StrTraitMFC_DLL_wchar_t_class_ATL::ChTraitsCRT_wchar_t_____::CStringT_wchar_t_clas]
lea esi, [ebp - 0x34]
call fcn.004073dd
call fcn.0040851d
ret 8
mov esi, dword [ebp - 0x18]
lea ecx, [ebp - 0x14]
call dword [sym.imp.mfc90u.dll_ATL::CStringT_wchar_t_class_StrTraitMFC_DLL_wchar_t_class_ATL::ChTraitsCRT_wchar_t_____::CStringT_wchar_t_class]
lea ecx, [ebp - 0x1c]
call dword [sym.imp.mfc90u.dll_ATL::CStringT_wchar_t_class_StrTraitMFC_DLL_wchar_t_class_ATL::ChTraitsCRT_wchar_t_____::CStringT_wchar_t_class]
lea ecx, [ebp - 0x10]
call dword [sym.imp.mfc90u.dll_ATL::CStringT_wchar_t_class_StrTraitMFC_DLL_wchar_t_class_ATL::ChTraitsCRT_wchar_t_____::CStringT_wchar_t_class]
cmp esi, edi
mov byte [ebp - 4], 6
jl 0x405998
cmp esi, dword [ebp - 0x40]
jge 0x405998
mov eax, dword [ebp - 0x44]
lea eax, [eax + esi*4]
mov esi, dword [eax]
push 0x410
lea ecx, [ebp - 0x14]
call dword [sym.imp.mfc90u.dll_ATL::CSimpleStringT_wchar_t_1_::GetBuffer]
mov ebx, eax
lea eax, [ebp - 0x28]
push eax
push ebx
lea eax, [ebp - 0x24]
push eax
push edi
push esi
push dword [ebp - 0x34]
mov dword [ebp - 0x28], 0x820
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
cmp eax, edi
jne 0x4058ed
cmp dword [ebp - 0x24], 1
je 0x4058cc
cmp dword [ebp - 0x24], 2
je 0x4058cc
push 0xd
pop eax
jmp 0x4058ed
cmp ebx, edi
je 0x4058eb
mov eax, dword [ebp - 0x28]
cmp eax, edi
je 0x4058e6
test al, 1
jne 0x4058c7
shr eax, 1
cmp word [ebx + eax*2 - 2], di
je 0x4058eb
jmp 0x4058c7
xor eax, eax
mov word [ebx], ax
xor eax, eax
xor ebx, ebx
cmp eax, edi
push 0xffffffffffffffff
lea ecx, [ebp - 0x14]
sete bl
call dword [sym.imp.mfc90u.dll_ATL::CSimpleStringT_wchar_t_1_::ReleaseBuffer]
lea eax, [ebp - 0x10]
push eax
lea eax, [ebp - 0x1c]
push eax
lea esi, [ebp - 0x14]
call fcn.00401444
cmp ebx, edi
je 0x405969
mov eax, dword [ebp - 0x10]
cmp dword [eax - 0xc], edi
je 0x405969
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x405969
mov eax, dword [ebp + 0xc]
push edi
push edi
push 0x1004
push dword [eax + 0x20]
call dword [sym.imp.USER32.dll_SendMessageW]
push ecx
lea eax, [ebp - 0x10]
mov ecx, esp
mov dword [ebp - 0x28], esp
push eax
call dword [0x40a62c]
push ecx
lea eax, [ebp - 0x1c]
mov ecx, esp
mov dword [ebp - 0x2c], esp
push eax
mov byte [ebp - 4], 7
call dword [0x40a62c]
push dword [ebp + 8]
mov byte [ebp - 4], 6
call fcn.00405591
lea ecx, [ebp - 0x10]
call dword [sym.imp.mfc90u.dll_ATL::CStringT_wchar_t_class_StrTraitMFC_DLL_wchar_t_class_ATL::ChTraitsCRT_wchar_t_____::CStringT_wchar_t_clas]
lea ecx, [ebp - 0x1c]
call dword [sym.imp.mfc90u.dll_ATL::CStringT_wchar_t_class_StrTraitMFC_DLL_wchar_t_class_ATL::ChTraitsCRT_wchar_t_____::CStringT_wchar_t_clas]
lea ecx, [ebp - 0x14]
call dword [sym.imp.mfc90u.dll_ATL::CStringT_wchar_t_class_StrTraitMFC_DLL_wchar_t_class_ATL::ChTraitsCRT_wchar_t_____::CStringT_wchar_t_clas]
inc dword [ebp - 0x18]
mov eax, dword [ebp - 0x18]
cmp eax, dword [ebp - 0x40]
jl 0x405851
jmp 0x40580c
call sub.mfc90u.dll_AfxThrowInvalidArgException
int3