Function at 0x40d140
Capabilities:
Check if file exists
Print debug messages
Read .ini file

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x40
mov eax, dword [0x46e780]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
push edi
call dword [0x46fb34]
mov esi, dword [ebp + 8]
mov dword [ebp - 0xc], eax
mov eax, dword [esi - 0xc]
xor edi, edi
cmp eax, edi
jl 0x40d183
push 0x460d90
push esi
call fcn.0043b5b7
add esp, 8
cmp eax, edi
je 0x40d183
sub eax, esi
sar eax, 1
cmp eax, 0xffffffff
jne 0x40d1ed
push str._ReadIni__Invalid_arguments__Missing_operator_____:
lea eax, [ebp - 0x14]
push eax
lea ecx, [ebp + 8]
call fcn.00402290
mov ebx, dword [eax]
add esp, 8
cmp ebx, edi
jne 0x40d1a2
mov dword [ebp - 8], edi
jmp 0x40d1d3
push ebx
call dword [sym.imp.KERNEL32.dll_lstrlenW]
add eax, 1
cmp eax, 0x3fffffff
jle 0x40d1b8
mov dword [ebp - 8], edi
jmp 0x40d1d3
lea esi, [eax + eax]
mov eax, esi
call fcn.00441030
mov ecx, dword [ebp - 0xc]
mov eax, esp
push ecx
push esi
push ebx
push eax
call fcn.00408280
mov dword [ebp - 8], eax
lea edx, [ebp - 8]
push edx
lea ecx, [ebp - 0x24]
call fcn.0043b4a4
push 0x4686c8
lea eax, [ebp - 0x24]
push eax
call fcn.0043e342
cmp dword [esi - 0xc], edi
jge 0x40d1f7
or eax, 0xffffffff
jmp 0x40d212
push 0x460d90
push esi
call fcn.0043b5b7
add esp, 8
cmp eax, edi
jne 0x40d20e
or eax, 0xffffffff
jmp 0x40d212
sub eax, esi
sar eax, 1
push eax
lea ecx, [ebp - 0x10]
push ecx
lea ecx, [ebp + 8]
call fcn.00407850
cmp dword [esi - 0xc], edi
jge 0x40d229
or eax, 0xffffffff
jmp 0x40d244
push 0x460d90
push esi
call fcn.0043b5b7
add esp, 8
cmp eax, edi
jne 0x40d240
or eax, 0xffffffff
jmp 0x40d244
sub eax, esi
sar eax, 1
add eax, 2
lea ebx, [ebp + 8]
call fcn.004076c0
mov eax, dword [ebp + 8]
add eax, 0xfffffff0
push eax
mov dword [ebp - 0x14], eax
call fcn.00402470
add esp, 4
add eax, 0x10
push 0xa
lea ecx, [ebp - 0x40]
mov dword [ebp - 0x18], eax
call fcn.00428a45
mov eax, dword [ebp - 0x10]
lea edx, [ebp - 0x40]
push edx
push ecx
add eax, 0xfffffff0
mov dword [ebp - 8], esp
mov esi, esp
push eax
mov dword [ebp - 0x10], eax
call fcn.00402470
add eax, 0x10
add esp, 4
mov dword [esi], eax
call fcn.0040b8a0
add esp, 8
cmp eax, 3
je 0x40d2a9
push str._ReadIni__Invalid_arguments__nArg_3_:
jmp 0x40d188
push edi
lea ecx, [ebp - 0x40]
call fcn.00428a21
cmp eax, edi
jne 0x40d2bb
jmp fcn.00423abe
mov eax, dword [eax + 8]
sub eax, 0x10
push eax
call fcn.00402470
add esp, 4
add eax, 0x10
push 1
lea ecx, [ebp - 0x40]
mov dword [ebp - 8], eax
call fcn.00428a21
cmp eax, edi
jne 0x40d2e3
jmp fcn.00423abe
mov eax, dword [eax + 8]
sub eax, 0x10
push eax
call fcn.00402470
add esp, 4
mov edi, eax
push 2
lea ecx, [ebp - 0x40]
add edi, 0x10
call fcn.00428a21
test eax, eax
jne 0x40d30a
jmp fcn.00423abe
mov eax, dword [eax + 8]
sub eax, 0x10
push eax
call fcn.00402470
mov ebx, eax
add esp, 4
add ebx, 0x10
call fcn.0042190e
test eax, eax
jne 0x40d331
push 0x80004005
call fcn.00401350
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0xc]
call eax
mov ecx, dword [ebp - 8]
mov esi, eax
add esi, 0x10
push ecx
mov dword [ebp - 0xc], esi
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
jne 0x40d476
lea edx, [ebp - 0xc]
push str._ReadIni__Source_ini_file_not_found:
push edx
lea ecx, [ebp - 8]
call fcn.00402290
mov eax, dword [eax]
add esp, 8
push eax
call dword [sym.imp.KERNEL32.dll_OutputDebugStringW]
mov eax, dword [ebp - 0xc]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40d390
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
lea eax, [esi - 0x10]
or edx, 0xffffffff
lea ecx, [eax + 0xc]
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40d3ac
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
lea eax, [ebx - 0x10]
or edx, 0xffffffff
lea ecx, [eax + 0xc]
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40d3c8
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
lea eax, [edi - 0x10]
or edx, 0xffffffff
lea ecx, [eax + 0xc]
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40d3e4
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, dword [ebp - 8]
add eax, 0xfffffff0
or edx, 0xffffffff
lea ecx, [eax + 0xc]
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40d403
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
lea ecx, [ebp - 0x40]
call fcn.00428b7d
mov eax, dword [ebp - 0x18]
add eax, 0xfffffff0
or edx, 0xffffffff
lea ecx, [eax + 0xc]
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40d42a
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, dword [ebp - 0x10]
or edx, 0xffffffff
lea ecx, [eax + 0xc]
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40d446
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, dword [ebp - 0x14]
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40d462
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
lea esp, [ebp - 0x4c]
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00439c98
mov esp, ebp
pop ebp
ret
mov edx, dword [esi - 8]
mov ecx, 1
sub ecx, dword [esi - 4]
sub edx, 0x104
or ecx, edx
jge 0x40d49b
push 0x104
lea ecx, [ebp - 0xc]
call fcn.004013d0
mov esi, dword [ebp - 0xc]
mov eax, dword [ebp - 8]
push eax
push 0x104
push esi
push 0x460114
push ebx
push edi
call dword [sym.imp.KERNEL32.dll_GetPrivateProfileStringW]
test esi, esi
jne 0x40d4ba
xor eax, eax
jmp 0x40d4d1
mov eax, esi
lea edx, [eax + 2]
nop
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x40d4c0
sub eax, edx
sar eax, 1
js 0x40d4fb
cmp eax, dword [esi - 8]
jg 0x40d4fb
mov edx, dword [ebp - 0x18]
mov dword [esi - 0xc], eax
mov word [esi + eax*2], 0
mov ecx, dword [0x472c84]
push ecx
push esi
push edx
push 0x460910
call dword [sym.imp.KERNEL32.dll_WritePrivateProfileStringW]
jmp 0x40d390
push 0x80070057
call fcn.00401350
int3