Function at 0x40c850
Capabilities:
Read .ini file

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x457930
mov eax, dword fs:[0]
push eax
sub esp, 0x78
push ebx
push esi
push edi
mov eax, dword [0x471920]
xor eax, esp
push eax
lea eax, [esp + 0x88]
mov dword fs:[0], eax
call fcn.0041c08e
xor ecx, ecx
xor ebx, ebx
cmp eax, ebx
setne cl
cmp ecx, ebx
jne 0x40c89b
push 0x80004005
call fcn.00402660
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0xc]
call eax
add eax, 0x10
mov dword [esp + 0x14], eax
mov dword [esp + 0x90], ebx
call fcn.0041c08e
xor ecx, ecx
cmp eax, ebx
setne cl
cmp ecx, ebx
jne 0x40c8cc
push 0x80004005
call fcn.00402660
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0xc]
call eax
lea esi, [eax + 0x10]
mov dword [esp + 0x1c], esi
mov ecx, dword [ebp + 8]
mov byte [esp + 0x90], 1
push ecx
mov dword [esp + 0x58], 0x2c
mov dword [esp + 0x5c], 6
call dword [sym.imp.USER32.dll_GetMenuItemCount]
cmp eax, ebx
mov dword [esp + 0x20], eax
mov dword [esp + 0x18], ebx
jle 0x40ca85
mov eax, dword [ebp + 8]
lea edx, [esp + 0x54]
push edx
push 1
push ebx
push eax
call dword [sym.imp.USER32.dll_GetMenuItemInfoW]
mov eax, dword [esp + 0x64]
test eax, eax
je 0x40ca73
cmp dword [esp + 0x68], 0
je 0x40c952
mov edx, dword [ebp + 0x10]
mov ecx, ebx
sub ecx, dword [esp + 0x18]
lea eax, [esp + 0x14]
push ecx
push edx
push str._s_u
push eax
call fcn.00402e70
add esp, 0x10
jmp 0x40c965
push eax
lea ecx, [esp + 0x18]
push 0x463d90
push ecx
call fcn.00402e70
add esp, 0xc
mov eax, dword [esi - 8]
mov edi, dword [0x4768b4]
mov ecx, 1
sub ecx, dword [esi - 4]
sub eax, 0x400
or eax, ecx
jge 0x40c991
push 0x400
lea ecx, [esp + 0x20]
call fcn.00402ba0
mov esi, dword [esp + 0x1c]
mov edx, dword [esp + 0x14]
mov eax, dword [ebp + 0xc]
push edi
push 0x400
push esi
xor edi, edi
push edi
push edx
push eax
call dword [sym.imp.KERNEL32.dll_GetPrivateProfileStringW]
test eax, eax
je 0x40ca22
cmp esi, edi
jne 0x40c9b6
xor eax, eax
jmp 0x40c9d5
mov eax, esi
lea edx, [eax + 2]
jmp 0x40c9c0
mov cx, word [eax]
add eax, 2
cmp cx, di
jne 0x40c9c0
sub eax, edx
sar eax, 1
js 0x40caea
cmp eax, dword [esi - 8]
jg 0x40caea
lea ecx, [esp + 0x24]
push ecx
push 1
mov dword [esi - 0xc], eax
mov word [esi + eax*2], di
mov dword [esp + 0x54], edi
mov dword [esp + 0x50], edi
mov edi, dword [ebp + 8]
push ebx
push edi
mov dword [esp + 0x34], 0x2c
mov dword [esp + 0x38], 0x10
call dword [sym.imp.USER32.dll_GetMenuItemInfoW]
lea edx, [esp + 0x24]
push edx
push 1
push ebx
push edi
mov dword [esp + 0x58], esi
call dword [sym.imp.USER32.dll_SetMenuItemInfoW]
test esi, esi
jne 0x40ca2a
xor eax, eax
jmp 0x40ca45
mov eax, esi
lea edx, [eax + 2]
nop
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x40ca30
sub eax, edx
sar eax, 1
js 0x40caea
cmp eax, dword [esi - 8]
jg 0x40caea
mov dword [esi - 0xc], eax
mov word [esi + eax*2], 0
mov eax, dword [esp + 0x68]
test eax, eax
je 0x40ca78
mov ecx, dword [esp + 0x14]
mov edx, dword [ebp + 0xc]
push ecx
push edx
push eax
call fcn.0040c850
add esp, 0xc
jmp 0x40ca78
add dword [esp + 0x18], 1
add ebx, 1
cmp ebx, dword [esp + 0x20]
jl 0x40c90e
lea eax, [esi - 0x10]
mov byte [esp + 0x90], 0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40caa9
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov dword [esp + 0x90], 0xffffffff
mov eax, dword [esp + 0x14]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40cad4
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov ecx, dword [esp + 0x88]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push 0x80070057
call fcn.00402660
int3