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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x412d71
mov eax, dword fs:[0]
push eax
sub esp, 0x410
mov eax, dword [0x41a018]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov eax, dword [0x41a030]
mov edx, dword [eax + 0xc]
mov esi, ecx
mov ecx, 0x41a030
mov dword [ebp - 0x41c], esi
call edx
add eax, 0x10
mov dword [ebp - 0x418], eax
mov dword [ebp - 4], 0
mov eax, dword [esi + 4]
push str.mobo.genie
push eax
push 0x416134
lea edi, [ebp - 0x418]
call fcn.0040af30
mov ebx, dword [ebp - 0x418]
add esp, 0xc
push ebx
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
jne 0x40bd3f
lea eax, [ebx - 0x10]
mov dword [ebp - 4], 0xffffffff
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40bd35
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, 1
jmp 0x40bf32
mov edx, dword [0x41a030]
mov eax, dword [edx + 0xc]
mov ecx, 0x41a030
call eax
add eax, 0x10
mov dword [ebp - 0x414], eax
mov byte [ebp - 4], 1
test ebx, ebx
je 0x40bd88
test ebx, 0xffff0000
jne 0x40bd88
movzx esi, bx
push esi
call fcn.00407340
add esp, 4
test eax, eax
je 0x40bd93
push eax
mov eax, esi
lea edi, [ebp - 0x414]
call fcn.0040a7b0
jmp 0x40bd93
lea edi, [ebp - 0x414]
call fcn.00409e80
mov byte [ebp - 4], 0
mov ecx, dword [ebp - 0x414]
push 0x4162dc
push ecx
call dword [sym.imp.MSVCR100.dll_fopen]
mov edi, eax
mov eax, dword [ebp - 0x414]
add eax, 0xfffffff0
add esp, 8
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x40bdd0
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
test edi, edi
jne 0x40be01
lea eax, [ebx - 0x10]
mov dword [ebp - 4], 0xffffffff
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40bdf7
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, 2
jmp 0x40bf32
push 0x3ff
lea ecx, [ebp - 0x40f]
push 0
push ecx
mov byte [ebp - 0x410], 0
call sub.MSVCR100.dll_memset
push edi
push 0x400
lea edx, [ebp - 0x410]
push 1
push edx
call dword [sym.imp.MSVCR100.dll_fread]
push edi
mov esi, eax
call dword [sym.imp.MSVCR100.dll_fclose]
add esp, 0x20
xor eax, eax
test esi, esi
jle 0x40be60
mov cl, 0xa
cmp byte [ebp + eax - 0x410], cl
je 0x40be54
inc eax
cmp eax, esi
jl 0x40be44
jmp 0x40be60
test eax, eax
je 0x40be60
mov byte [ebp + eax - 0x410], 0
lea eax, [ebp - 0x414]
push eax
lea ecx, [ebp - 0x410]
call fcn.0040b6e0
mov byte [ebp - 4], 2
mov ecx, dword [eax]
mov eax, dword [ebp - 0x41c]
mov edx, dword [eax + 4]
push ecx
push edx
push 0x416134
lea edi, [eax + 8]
call fcn.0040af30
mov byte [ebp - 4], 0
mov eax, dword [ebp - 0x414]
add eax, 0xfffffff0
add esp, 0xc
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40beb9
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
lea ecx, [ebp - 0x410]
push ecx
call dword [sym.imp.SHLWAPI.dll_PathFindExtensionA]
mov edi, dword [sym.imp.MSVCR100.dll__stricmp]
mov esi, eax
push str..exe
push esi
call edi
add esp, 8
test eax, eax
jne 0x40bee2
lea esi, [eax + 4]
jmp 0x40bf0d
push str..msi
push esi
call edi
add esp, 8
test eax, eax
jne 0x40bef6
lea esi, [eax + 5]
jmp 0x40bf0d
push str..inf
push esi
call edi
add esp, 8
mov esi, eax
neg esi
sbb esi, esi
and esi, 0xfffffffd
add esi, 3
lea eax, [ebx - 0x10]
mov dword [ebp - 4], 0xffffffff
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x40bf30
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, esi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.00411688
mov esp, ebp
pop ebp
ret