Function at 0x4040d0
Capabilities:
Check if file exists
Read file on windows

Disassembly:
push 0xffffffffffffffff
push 0x4077c7
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x12c
mov eax, dword [0x40c060]
push ebx
push ebp
push esi
push edi
mov dword [esp + 0x138], eax
push 0x104
lea eax, [esp + 0x38]
push eax
xor ebp, ebp
push ebp
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
lea ecx, [esp + 0x34]
push ecx
lea ecx, [esp + 0x20]
call dword [sym.imp.MFC71.DLL_ATL::CStringT::CStringT_3]
lea ecx, [esp + 0x30]
mov dword [esp + 0x144], ebp
call dword [sym.imp.MFC71.DLL_ATL::CStringT::CStringT_2]
push 0x5c
lea ecx, [esp + 0x20]
mov byte [esp + 0x148], 1
call dword [sym.imp.MFC71.DLL_ATL::CStringT::ReverseFind]
inc eax
push eax
lea edx, [esp + 0x18]
push edx
lea ecx, [esp + 0x24]
call dword [sym.imp.MFC71.DLL_ATL::CStringT::Left]
push eax
mov ecx, 0x41943c
mov byte [esp + 0x148], 2
call dword [0x40830c]
lea ecx, [esp + 0x14]
mov byte [esp + 0x144], 1
call dword [sym.imp.MFC71.DLL_ATL::CStringT::CStringT]
mov ebx, dword [sym.imp.MSVCR71.dll_fseek]
mov dword [esp + 0x18], ebp
xor esi, esi
mov eax, dword [esp + 0x14c]
mov ecx, dword [eax + 4]
cmp ecx, ebp
mov dword [esp + 0x14], esi
je 0x40435f
mov eax, dword [eax + 8]
mov edx, dword [esp + 0x18]
sub eax, ecx
sar eax, 4
cmp edx, eax
jae 0x40435f
add esi, ecx
push esi
lea ecx, [esp + 0x24]
call dword [sym.imp.MFC71.DLL_ATL::CStringT::CStringT_1]
lea eax, [esi + 4]
push eax
lea ecx, [esp + 0x28]
mov byte [esp + 0x148], 3
call dword [sym.imp.MFC71.DLL_ATL::CStringT::CStringT_1]
mov ecx, dword [esi + 8]
mov dword [esp + 0x28], ecx
mov edx, dword [esi + 0xc]
mov dword [esp + 0x2c], edx
lea eax, [esp + 0x20]
push eax
mov esi, 0x41943c
lea edi, [esp + 0x14]
mov byte [esp + 0x148], 4
call fcn.004048c0
add esp, 4
push 0x408a60
lea ecx, [esp + 0x24]
mov byte [esp + 0x148], 5
call dword [sym.imp.MFC71.DLL_ATL::CStringT::Compare]
test eax, eax
je 0x404226
push 0x408a60
mov ecx, edi
call dword [sym.imp.MFC71.DLL_ATL::CStringT::operator_1]
lea ecx, [esp + 0x24]
push ecx
lea ecx, [esp + 0x14]
call dword [sym.imp.MFC71.DLL_ATL::CStringT::operator]
mov edx, dword [esp + 0x10]
push edx
call dword [sym.imp.SHLWAPI.dll_PathFileExistsA]
test eax, eax
je 0x404324
push ebp
push 0x408ac0
lea ecx, [esp + 0x2c]
mov dword [esp + 0x30], ebp
call dword [sym.imp.MFC71.DLL_ATL::CStringT::Find]
cmp eax, 0xffffffff
je 0x4042c8
mov eax, dword [esp + 0x10]
push 0x408c24
push eax
or edi, 0xffffffff
call dword [sym.imp.MSVCR71.dll_fopen]
mov esi, eax
add esp, 8
cmp esi, ebp
je 0x4042c4
push 2
push ebp
push esi
call ebx
push esi
call dword [sym.imp.MSVCR71.dll_ftell]
push ebp
push ebp
push esi
mov edi, eax
call ebx
push edi
call sub.MFC71.DLL_operator_new_1
push esi
push edi
mov ebp, eax
push 1
push ebp
call dword [sym.imp.MSVCR71.dll_fread]
mov edx, edi
mov ecx, ebp
or eax, 0xffffffff
call fcn.004065e0
push esi
mov edi, eax
call dword [sym.imp.MSVCR71.dll_fclose]
push ebp
call sub.MFC71.DLL_operator_delete
add esp, 0x38
xor ebp, ebp
mov dword [esp + 0x28], edi
mov edi, dword [esp + 0x150]
mov edx, dword [edi + 4]
cmp edx, ebp
jne 0x4042da
xor ecx, ecx
jmp 0x4042e2
mov ecx, dword [edi + 8]
sub ecx, edx
sar ecx, 4
cmp edx, ebp
je 0x404314
mov eax, dword [edi + 0xc]
sub eax, edx
sar eax, 4
cmp ecx, eax
jae 0x404314
mov ecx, dword [esp + 0x30]
mov esi, dword [edi + 8]
push ecx
push esi
lea ecx, [esp + 0x28]
mov edx, 1
call fcn.00404f30
add esp, 8
add esi, 0x10
mov dword [edi + 8], esi
jmp 0x404324
mov eax, dword [edi + 8]
push 1
push eax
push edi
lea ecx, [esp + 0x2c]
call fcn.00404b70
lea ecx, [esp + 0x10]
call dword [sym.imp.MFC71.DLL_ATL::CStringT::CStringT]
lea ecx, [esp + 0x24]
mov byte [esp + 0x144], 1
call dword [sym.imp.MFC71.DLL_ATL::CStringT::CStringT]
lea ecx, [esp + 0x20]
call dword [sym.imp.MFC71.DLL_ATL::CStringT::CStringT]
mov ecx, dword [esp + 0x18]
mov esi, dword [esp + 0x14]
inc ecx
mov dword [esp + 0x18], ecx
add esi, 0x10
jmp 0x404185
lea ecx, [esp + 0x30]
call dword [sym.imp.MFC71.DLL_ATL::CStringT::CStringT]
lea ecx, [esp + 0x1c]
call dword [sym.imp.MFC71.DLL_ATL::CStringT::CStringT]
mov ecx, dword [esp + 0x13c]
pop edi
pop esi
pop ebp
mov dword fs:[0], ecx
mov ecx, dword [esp + 0x12c]
pop ebx
call fcn.00406fae
add esp, 0x138
ret 8