Function at 0x404080
Capabilities:
Read .ini file
Resolve function by parsing pe exports

Disassembly:
push 0xffffffffffffffff
push 0x44e4ae
mov eax, dword fs:[0]
push eax
sub esp, 0x4ac
mov eax, dword [0x47b018]
xor eax, esp
mov dword [esp + 0x4a8], eax
push ebx
push ebp
push esi
push edi
mov eax, dword [0x47b018]
xor eax, esp
push eax
lea eax, [esp + 0x4c0]
mov dword fs:[0], eax
mov eax, dword [esp + 0x4d4]
mov dword [esp + 0x14], eax
mov eax, dword [0x47be54]
xor ebp, ebp
mov dword [esp + 0x50], 0x47be54
cmp eax, ebp
je 0x4040e2
push 0xffffffffffffffff
push eax
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov byte [esp + 0x54], 1
lea ecx, [esp + 0x90]
mov dword [esp + 0x4c8], ebp
call dword [sym.imp.MSVCP90.dll_public:_void___thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::constructor_void_]
mov byte [esp + 0x4c8], 1
call fcn.00410f20
lea ecx, [esp + 0x90]
push ecx
call fcn.0043d610
mov esi, dword [sym.imp.MSVCP90.dll_class_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t_____cdecl_std::operator_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t___class_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t___const___wchar_t_const__]
add esp, 4
push str.CORELDigital_Studio_
lea edx, [esp + 0x94]
push edx
lea eax, [esp + 0x3c]
push eax
call esi
add esp, 0xc
push str.Metadatmgr_profile.ini
push eax
lea ecx, [esp + 0x60]
push ecx
mov byte [esp + 0x4d4], 2
call esi
add esp, 0xc
lea ecx, [esp + 0x34]
mov byte [esp + 0x4c8], 4
call dword [sym.imp.MSVCP90.dll_public:_void___thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::destructor_void_]
mov eax, dword [esp + 0x5c]
mov edi, 8
cmp dword [esp + 0x70], edi
jae 0x404172
lea eax, [esp + 0x5c]
push ebp
push eax
call dword [sym.imp.MSVCR90.dll__waccess]
add esp, 8
cmp eax, 0xffffffff
jne 0x4041e5
mov eax, dword [esp + 0x5c]
cmp dword [esp + 0x70], edi
jae 0x404190
lea eax, [esp + 0x5c]
push ebp
push 0x80
push 4
push ebp
push ebp
push 0xc0000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
cmp eax, 0xffffffff
jne 0x4041de
lea ecx, [esp + 0x58]
mov byte [esp + 0x4c8], 1
call dword [sym.imp.MSVCP90.dll_public:_void___thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::destructor_void_]
lea ecx, [esp + 0x90]
mov byte [esp + 0x4c8], 0
call dword [sym.imp.MSVCP90.dll_public:_void___thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::destructor_void_]
mov eax, dword [0x47be54]
cmp eax, ebp
jmp 0x40452c
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 0x204
lea edx, [esp + 0x2bc]
push ebp
push edx
mov dword [esp + 0x2c0], ebp
call sub.MSVCR90.dll_memset
add esp, 0xc
lea eax, [esp + 0x18]
push eax
call dword [sym.imp.KERNEL32.dll_InitializeCriticalSection]
mov dword [esp + 0x30], ebp
mov ecx, dword [esp + 0x4d0]
push ecx
push 0x4506a0
lea esi, [esp + 0x20]
mov byte [esp + 0x4d0], 5
call fcn.00401380
add esp, 8
push eax
lea ecx, [esp + 0x78]
call dword [sym.imp.MSVCP90.dll_public:_void___thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::constructor_wchar_t_const__]
mov byte [esp + 0x4c8], 6
mov ecx, dword [esp + 0x5c]
cmp dword [esp + 0x70], edi
jae 0x404253
lea ecx, [esp + 0x5c]
mov eax, dword [esp + 0x78]
cmp dword [esp + 0x8c], edi
jae 0x404264
lea eax, [esp + 0x78]
mov ebx, dword [sym.imp.KERNEL32.dll_GetPrivateProfileStringW]
push ecx
push 0x104
lea edx, [esp + 0x2bc]
push edx
push ebp
push ebp
push eax
call ebx
mov edi, eax
cmp edi, 0x104
jae 0x40437b
lea esi, [esp + 0x2b4]
mov eax, esi
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
cmp cx, bp
jne 0x404297
sub eax, edx
sar eax, 1
mov ebp, eax
cmp ebp, edi
jae 0x4044b2
push 0x204
lea eax, [esp + 0xb4]
push 0
push eax
mov dword [esp + 0xb8], 0
call sub.MSVCR90.dll_memset
mov ecx, dword [esp + 0x68]
mov eax, 8
add esp, 0xc
cmp dword [esp + 0x70], eax
jae 0x4042e5
lea ecx, [esp + 0x5c]
cmp dword [esp + 0x8c], eax
mov eax, dword [esp + 0x78]
jae 0x4042f6
lea eax, [esp + 0x78]
push ecx
push 0x104
lea ecx, [esp + 0xb4]
push ecx
push 0
push esi
push eax
call ebx
lea edx, [esp + 0xac]
push edx
lea ecx, [esp + 0x38]
call dword [sym.imp.MSVCP90.dll_public:_void___thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::constructor_wchar_t_const__]
mov ecx, dword [esp + 0x14]
lea eax, [esp + 0x34]
push eax
push ecx
mov byte [esp + 0x4d0], 7
call fcn.0040b350
lea ecx, [esp + 0x34]
mov byte [esp + 0x4c8], 6
call dword [sym.imp.MSVCP90.dll_public:_void___thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::destructor_void_]
mov eax, esi
lea edx, [eax + 2]
lea ebx, [ebx]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x404350
sub eax, edx
sar eax, 1
inc eax
cmp eax, 1
je 0x4044b2
add ebp, eax
lea esi, [esi + eax*2]
cmp ebp, edi
jb 0x4042b0
jmp 0x4044b2
xor ecx, ecx
mov eax, edi
mov edx, 2
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call sub.mfc90u.dll_new__
mov ecx, dword [esp + 0x60]
mov esi, eax
mov eax, 8
add esp, 4
cmp dword [esp + 0x70], eax
jae 0x4043ab
lea ecx, [esp + 0x5c]
cmp dword [esp + 0x8c], eax
mov eax, dword [esp + 0x78]
jae 0x4043bc
lea eax, [esp + 0x78]
push ecx
push edi
push esi
push 0
push 0
push eax
call ebx
mov ebp, eax
mov eax, esi
lea edx, [eax + 2]
lea ecx, [ecx]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x4043d0
sub eax, edx
sar eax, 1
mov edi, eax
cmp edi, ebp
jae 0x4044b2
lea esp, [esp]
push 0x204
lea eax, [esp + 0xb4]
push 0
push eax
mov dword [esp + 0xb8], 0
call sub.MSVCR90.dll_memset
mov ecx, dword [esp + 0x68]
mov eax, 8
add esp, 0xc
cmp dword [esp + 0x70], eax
jae 0x404425
lea ecx, [esp + 0x5c]
cmp dword [esp + 0x8c], eax
mov eax, dword [esp + 0x78]
jae 0x404436
lea eax, [esp + 0x78]
push ecx
push 0x104
lea ecx, [esp + 0xb4]
push ecx
push 0
push esi
push eax
call ebx
lea edx, [esp + 0xac]
push edx
lea ecx, [esp + 0x38]
call dword [sym.imp.MSVCP90.dll_public:_void___thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::constructor_wchar_t_const__]
mov ecx, dword [esp + 0x14]
lea eax, [esp + 0x34]
push eax
push ecx
mov byte [esp + 0x4d0], 8
call fcn.0040b350
lea ecx, [esp + 0x34]
mov byte [esp + 0x4c8], 6
call dword [sym.imp.MSVCP90.dll_public:_void___thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::destructor_void_]
mov eax, esi
lea edx, [eax + 2]
lea ebx, [ebx]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x404490
sub eax, edx
sar eax, 1
inc eax
cmp eax, 1
je 0x4044b2
add edi, eax
lea esi, [esi + eax*2]
cmp edi, ebp
jb 0x4043f0
lea ecx, [esp + 0x74]
mov byte [esp + 0x4c8], 5
call dword [sym.imp.MSVCP90.dll_public:_void___thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::destructor_void_]
lea edx, [esp + 0x18]
push edx
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov eax, dword [esp + 0x30]
test eax, eax
je 0x4044e8
push eax
call sub.mfc90u.dll_delete__
add esp, 4
mov dword [esp + 0x30], 0
lea eax, [esp + 0x18]
push eax
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
lea ecx, [esp + 0x18]
push ecx
call dword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
lea ecx, [esp + 0x58]
mov byte [esp + 0x4c8], 1
call dword [sym.imp.MSVCP90.dll_public:_void___thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::destructor_void_]
lea ecx, [esp + 0x90]
mov byte [esp + 0x4c8], 0
call dword [sym.imp.MSVCP90.dll_public:_void___thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::destructor_void_]
mov eax, dword [0x47be54]
test eax, eax
je 0x404535
push eax
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
mov ecx, dword [esp + 0x4c0]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x4a8]
xor ecx, esp
call fcn.0041d40a
add esp, 0x4b8
ret