Function at 0x40fa70
Capabilities:
Read file on windows

Disassembly:
sub esp, 0x14
push ebx
mov ebx, ecx
push ebp
push esi
push edi
lea eax, [ebx + 0x41c]
push 0x41c960
push eax
mov dword [esp + 0x18], ebx
call dword [sym.imp.MSVCRT.dll__wfopen]
mov esi, eax
add esp, 8
test esi, esi
mov dword [esp + 0x18], esi
je 0x40fd27
mov edi, dword [sym.imp.MSVCRT.dll_fseek]
push 2
push 0
push esi
call edi
push esi
call dword [sym.imp.MSVCRT.dll_ftell]
mov esi, eax
lea ecx, [esi + 1]
push ecx
call dword [sym.imp.MSVCRT.dll_malloc]
mov ebp, eax
add esp, 0x14
test ebp, ebp
mov dword [esp + 0x20], ebp
jne 0x40fae3
mov edx, dword [esp + 0x18]
push edx
call dword [sym.imp.MSVCRT.dll_fclose]
add esp, 4
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x14
ret
mov eax, dword [esp + 0x18]
push 0
push 0
push eax
call edi
mov ecx, dword [esp + 0x24]
push ecx
push esi
push 1
push ebp
call dword [sym.imp.MSVCRT.dll_fread]
push ebp
mov byte [esi + ebp], 0
call fcn.0040f7b0
mov ecx, eax
add esp, 0x20
test ecx, ecx
mov dword [esp + 0x1c], ecx
je 0x40fc79
cmp dword [ecx + 4], 1
jne 0x40fb4c
mov eax, dword [ecx + 8]
xor edx, edx
test eax, eax
jbe 0x40fb4c
mov ebx, dword [ecx + 0xc]
mov dword [esp + 0x14], ebx
mov esi, dword [ebx]
mov edi, str.window
mov ecx, 7
xor ebp, ebp
repe cmpsb byte [esi], byte es:[edi]
je 0x40fb8e
inc edx
add ebx, 8
cmp edx, eax
jb 0x40fb2e
mov ebx, dword [esp + 0x10]
mov ebp, 0x41d5b0
mov dword [esp + 0x14], ebp
cmp dword [ebp + 4], 1
jne 0x40fc68
mov eax, dword [ebp + 8]
xor edx, edx
test eax, eax
jbe 0x40fbad
mov ebx, dword [ebp + 0xc]
mov esi, dword [ebx]
mov edi, str.width
mov ecx, 6
xor eax, eax
repe cmpsb byte [esi], byte es:[edi]
je 0x40fba0
mov eax, dword [ebp + 8]
inc edx
add ebx, 8
cmp edx, eax
jb 0x40fb6b
mov ebx, dword [esp + 0x10]
jmp 0x40fbad
mov eax, dword [esp + 0x14]
mov ebx, dword [esp + 0x10]
mov ebp, dword [eax + edx*8 + 4]
mov dword [esp + 0x14], ebp
jmp 0x40fb55
mov eax, dword [ebp + 0xc]
mov ebx, dword [esp + 0x10]
mov edx, dword [eax + edx*8 + 4]
jmp 0x40fbb2
mov edx, 0x41d5b0
cmp dword [edx + 4], 3
jne 0x40fbbd
mov ecx, dword [edx + 8]
mov dword [ebx], ecx
cmp dword [ebp + 4], 1
jne 0x40fbf1
mov eax, dword [ebp + 8]
xor edx, edx
test eax, eax
jbe 0x40fbf1
mov ebx, dword [ebp + 0xc]
mov esi, dword [ebx]
mov edi, str.height
mov ecx, 7
xor ebp, ebp
repe cmpsb byte [esi], byte es:[edi]
je 0x40fc38
inc edx
add ebx, 8
cmp edx, eax
jb 0x40fbcf
mov ebp, dword [esp + 0x14]
mov ebx, dword [esp + 0x10]
mov edx, 0x41d5b0
cmp dword [edx + 4], 3
jne 0x40fc02
mov edx, dword [edx + 8]
mov dword [ebx + 4], edx
cmp dword [ebp + 4], 1
jne 0x40fc57
mov eax, dword [ebp + 8]
xor edx, edx
test eax, eax
jbe 0x40fc57
mov ebx, dword [ebp + 0xc]
mov dword [esp + 0x14], ebx
mov esi, dword [ebx]
mov edi, str.maximized
mov ecx, 0xa
xor ebp, ebp
repe cmpsb byte [esi], byte es:[edi]
je 0x40fc49
inc edx
add ebx, 8
cmp edx, eax
jb 0x40fc18
mov ebx, dword [esp + 0x10]
jmp 0x40fc57
mov ebp, dword [esp + 0x14]
mov ebx, dword [esp + 0x10]
mov eax, dword [ebp + 0xc]
mov edx, dword [eax + edx*8 + 4]
jmp 0x40fbf6
mov eax, dword [esp + 0x14]
mov ebx, dword [esp + 0x10]
mov edx, dword [eax + edx*8 + 4]
jmp 0x40fc5c
mov edx, 0x41d5b0
cmp dword [edx + 4], 3
jne 0x40fc68
mov ecx, dword [edx + 8]
mov dword [ebx + 8], ecx
mov edx, dword [esp + 0x1c]
push edx
call fcn.0040f7e0
mov ebp, dword [esp + 0x24]
add esp, 4
push ebp
call dword [sym.imp.MSVCRT.dll_free]
mov eax, dword [esp + 0x1c]
push eax
call dword [sym.imp.MSVCRT.dll_fclose]
mov eax, dword [0x41de18]
add esp, 8
xor esi, esi
test eax, eax
jle 0x40fd27
mov ebp, dword [sym.imp.KERNEL32.dll_lstrcmpiA]
xor edi, edi
mov ecx, dword [0x41de1c]
push str.game
lea edx, [edi + ecx]
push edx
call ebp
test eax, eax
je 0x40fcd2
mov eax, dword [0x41de18]
inc esi
add edi, 0x718
cmp esi, eax
jl 0x40fca5
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x14
ret
lea eax, [esi*8]
mov ecx, dword [0x41de1c]
sub eax, esi
mov edx, dword [ebx]
shl eax, 4
add eax, esi
lea eax, [esi + eax*2]
shl eax, 3
mov esi, dword [eax + ecx + 0x4c]
cmp edx, esi
jg 0x40fcfe
mov esi, dword [eax + ecx + 0x44]
cmp edx, esi
jge 0x40fd06
mov dword [ebx], esi
mov ecx, dword [0x41de1c]
mov edx, dword [ebx + 4]
mov esi, dword [eax + ecx + 0x50]
cmp edx, esi
jle 0x40fd1c
mov dword [ebx + 4], esi
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x14
ret
mov eax, dword [eax + ecx + 0x48]
cmp edx, eax
jge 0x40fd27
mov dword [ebx + 4], eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x14
ret