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

Disassembly:
push 0xffffffffffffffff
push 0x41fa70
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0xc
push ebx
push ebp
push esi
xor esi, esi
push edi
mov dword [esp + 0x18], esi
mov eax, dword [0x42505c]
mov dword [esp + 0x24], esi
mov dword [esp + 0x10], eax
mov ebp, dword [esp + 0x30]
mov byte [esp + 0x24], 1
push ebp
call dword [sym.imp.SHLWAPI.dll_PathFileExistsA]
test eax, eax
je 0x405775
push esi
push 0x80
push 4
push esi
push esi
push SysReAllocString
push ebp
call dword [sym.imp.KERNEL32.dll_CreateFileA]
cmp eax, 0xffffffff
mov dword [esp + 0x18], eax
jne 0x40566d
mov eax, dword [esp + 0x10]
mov ebx, dword [esp + 0x2c]
mov edx, dword [eax - 0xc]
lea ecx, [eax - 0xc]
cmp edx, esi
jl 0x4055f7
push ecx
mov dword [ebx], eax
call dword [sym.imp.KERNEL32.dll_InterlockedIncrement]
jmp 0x405619
mov ecx, dword [0x42505c]
cmp eax, esi
mov dword [ebx], ecx
mov edi, eax
jne 0x405609
xor eax, eax
jmp 0x405610
push eax
call dword [sym.imp.KERNEL32.dll_lstrlenA]
push edi
push eax
mov ecx, ebx
call fcn.004085c0
mov eax, dword [esp + 0x10]
mov ecx, dword [0x425060]
mov edi, dword [sym.imp.KERNEL32.dll_InterlockedDecrement]
lea edx, [eax - 0xc]
cmp edx, ecx
je 0x40564a
add eax, 0xfffffff4
push eax
call edi
test eax, eax
jg 0x40564a
mov eax, dword [esp + 0x10]
add eax, 0xfffffff4
push eax
call fcn.00419d30
add esp, 4
mov eax, dword [0x425060]
lea ecx, [ebp - 0xc]
cmp ecx, eax
je 0x405805
lea esi, [ebp - 0xc]
push esi
call edi
test eax, eax
jg 0x405805
jmp 0x4057fc
push esi
push eax
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov ebx, eax
mov dword [esp + 0x14], esi
lea ebp, [ebx + 2]
push ebp
call fcn.0041a14f
mov ecx, ebp
mov esi, eax
mov edx, ecx
xor eax, eax
mov edi, esi
add esp, 4
shr ecx, 2
rep stosd dword es:[edi], eax
mov ecx, edx
push 0
and ecx, 3
rep stosb byte es:[edi], al
lea eax, [esp + 0x18]
push eax
push ebp
mov ebp, dword [esp + 0x24]
push esi
push ebp
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov byte [esi + ebx], 0
mov ax, word [esi]
cmp ax, 0xfeff
je 0x405707
cmp ax, 0xfffe
je 0x405707
test esi, esi
jne 0x4056cc
xor edi, edi
jmp 0x4056d5
push esi
call dword [sym.imp.KERNEL32.dll_lstrlenA]
mov edi, eax
push edi
lea ecx, [esp + 0x14]
call fcn.00408820
test eax, eax
je 0x40575f
mov edx, dword [esp + 0x10]
push edi
lea ecx, [edi + 1]
push esi
push ecx
push edx
call fcn.00407120
mov eax, dword [esp + 0x20]
add esp, 0x10
mov dword [eax - 8], edi
mov ecx, dword [esp + 0x10]
mov byte [edi + ecx], 0
jmp 0x40575f
lea ebx, [esi + 2]
test ebx, ebx
je 0x405719
push ebx
call fcn.0041a75d
add esp, 4
jmp 0x40571b
xor eax, eax
lea edi, [eax + eax]
mov eax, dword [esp + 0x10]
cmp dword [eax - 0xc], 1
jg 0x40572d
cmp edi, dword [eax - 4]
jle 0x405748
lea ecx, [esp + 0x10]
call fcn.00403830
push edi
lea ecx, [esp + 0x14]
call fcn.004037d0
test eax, eax
je 0x40575f
mov eax, dword [esp + 0x10]
inc edi
push edi
push ebx
push eax
call fcn.00408920
add esp, 0xc
lea ecx, [esp + 0x10]
push 0xffffffffffffffff
call fcn.00408500
push esi
call fcn.00419d30
add esp, 4
push ebp
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ebp, dword [esp + 0x30]
xor esi, esi
mov eax, dword [esp + 0x10]
mov ebx, dword [esp + 0x2c]
mov edx, dword [eax - 0xc]
lea ecx, [eax - 0xc]
cmp edx, esi
jl 0x405792
push ecx
mov dword [ebx], eax
call dword [sym.imp.KERNEL32.dll_InterlockedIncrement]
jmp 0x4057b4
mov edx, dword [0x42505c]
cmp eax, esi
mov dword [ebx], edx
mov edi, eax
jne 0x4057a4
xor eax, eax
jmp 0x4057ab
push eax
call dword [sym.imp.KERNEL32.dll_lstrlenA]
push edi
push eax
mov ecx, ebx
call fcn.004085c0
mov eax, dword [esp + 0x10]
mov edx, dword [0x425060]
mov edi, dword [sym.imp.KERNEL32.dll_InterlockedDecrement]
lea ecx, [eax - 0xc]
cmp ecx, edx
je 0x4057e5
add eax, 0xfffffff4
push eax
call edi
test eax, eax
jg 0x4057e5
mov edx, dword [esp + 0x10]
add edx, 0xfffffff4
push edx
call fcn.00419d30
add esp, 4
mov ecx, dword [0x425060]
lea eax, [ebp - 0xc]
cmp eax, ecx
je 0x405805
lea esi, [ebp - 0xc]
push esi
call edi
test eax, eax
jg 0x405805
push esi
call fcn.00419d30
add esp, 4
mov ecx, dword [esp + 0x1c]
pop edi
pop esi
mov eax, ebx
pop ebp
pop ebx
mov dword fs:[0], ecx
add esp, 0x18
ret 8