Function at 0x409777
Capabilities:
Check if file exists
Get file size
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x58
push ebx
push esi
push edi
push 0x437847
lea esi, [ebp - 0x1c]
call fcn.00412143
push 9
pop ebx
lea edi, [ebp - 0x58]
call fcn.004138a6
push 0x438338
push dword [0x641df0]
mov ebx, eax
lea esi, [ebp - 0x4c]
lea eax, [ebp - 0x1c]
call fcn.00412265
lea edi, [ebp + 0x4c]
lea esi, [ebp - 0x40]
call fcn.00412223
lea esi, [ebp - 0x34]
call fcn.00412265
mov edi, ebx
lea esi, [ebp - 0x28]
call fcn.00412223
lea esi, [ebp - 0x1c]
call fcn.004121e9
mov eax, dword [ebp - 0x28]
call fcn.00402910
mov eax, dword [ebp - 0x34]
call fcn.00402910
mov eax, dword [ebp - 0x40]
call fcn.00402910
mov eax, dword [ebp - 0x4c]
call fcn.00402910
mov eax, dword [ebp - 0x58]
call fcn.00402910
mov ebx, dword [ebp - 0x1c]
jmp 0x409817
sub esp, 0xc
lea eax, [ebp + 0x14]
mov esi, esp
call fcn.00412175
call fcn.004140f6
add esp, 0xc
push 1
push ebx
push dword [ebp + 0x14]
call dword [0x642070]
test eax, eax
je 0x409802
push ebx
call dword [sym.imp.SHLWAPI.dll_PathFileExistsA]
test eax, eax
jne 0x409887
push 0x3e8
call dword [sym.imp.KERNEL32.dll_Sleep]
sub esp, 0x68
lea ebx, [ebp + 0x34]
mov edi, esp
call fcn.00401ced
push dword [ebp + 0x30]
lea eax, [ebp + 0x20]
push dword [ebp + 0x2c]
sub esp, 0xc
mov esi, esp
call fcn.00412175
sub esp, 0xc
lea eax, [ebp + 0x14]
mov esi, esp
call fcn.00412175
sub esp, 0xc
lea eax, [ebp + 8]
mov esi, esp
call fcn.00412175
call fcn.00409777
add esp, 0x94
jmp 0x4099ce
xor edi, edi
push edi
push 0x80
push 3
push edi
push 1
push 0x80000000
push ebx
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov esi, eax
cmp esi, 0xffffffff
jne 0x4098ae
mov eax, ebx
jmp 0x4099d1
push edi
push esi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov ebx, eax
mov dword [ebp - 0x10], ebx
cmp ebx, 0xffffffff
je 0x4099c7
push ebx
push 8
call dword [0x642210]
push eax
call dword [0x6421a0]
mov dword [ebp - 4], eax
cmp eax, edi
je 0x4099c7
push edi
lea ecx, [ebp - 0xc]
push ecx
push ebx
push eax
push esi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x4099b6
cmp dword [ebp - 0xc], ebx
jne 0x4099b6
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 0xf423f
push edi
call dword [0x642210]
push eax
call dword [0x6421a0]
push dword [ebp + 0x20]
mov esi, eax
push esi
mov dword [ebp - 8], esi
call dword [0x6421b4]
push 0x43833c
push esi
call dword [0x6421b4]
push dword [ebp + 8]
push esi
call dword [0x6421b4]
push 0x438340
push esi
call dword [0x6421b4]
sub esp, 0x68
lea ebx, [ebp + 0x34]
mov edi, esp
call fcn.00401ced
push dword [ebp - 4]
sub esp, 0xc
mov esi, esp
push dword [ebp - 8]
call fcn.00412143
mov ebx, dword [ebp - 0x10]
lea eax, [ebp - 0x58]
push eax
call fcn.00418be6
add esp, 0x7c
push dword [ebp - 4]
push 0
call dword [0x642210]
push eax
call dword [0x64223c]
push dword [ebp - 8]
push 0
call dword [0x642210]
push eax
call dword [0x64223c]
push dword [ebp - 0x1c]
call dword [0x6420d0]
mov eax, dword [ebp - 0x1c]
call fcn.00402910
mov eax, dword [ebp - 0x58]
call fcn.00402910
xor eax, eax
jmp 0x4099d1
push dword [ebp - 4]
push edi
call dword [0x642210]
push eax
call dword [0x64223c]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 0x1c]
call fcn.00402910
mov eax, dword [ebp + 8]
call fcn.00402910
mov eax, dword [ebp + 0x14]
call fcn.00402910
mov eax, dword [ebp + 0x20]
call fcn.00402910
lea esi, [ebp + 0x34]
call fcn.00401cce
pop edi
pop esi
pop ebx
leave
ret