Function at 0x502d60
Capabilities:
Get file size
Read file on windows

Disassembly:
push 0xffffffffffffffff
push 0x568480
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
push ecx
push ebx
push ebp
push esi
mov eax, dword [esp + 0x24]
push edi
xor edi, edi
push edi
push pe_nt_image_headers32
push 3
push edi
push 7
push closesocket
mov ebx, ecx
push eax
mov dword [esp + 0x2c], edi
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ebp, eax
cmp ebp, 0xffffffff
jne 0x502db9
mov eax, dword [esp + 0x2c]
cmp eax, edi
je 0x502dae
mov dword [eax], ebp
mov eax, dword [esp + 0x24]
mov dword [eax], edi
jmp 0x502f68
push edi
push edi
push edi
push ebp
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push edi
push ebp
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov esi, eax
cmp esi, 0xffffffff
jne 0x502dee
mov eax, dword [esp + 0x2c]
cmp eax, edi
je 0x502ddc
mov dword [eax], esi
push ebp
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [esp + 0x24]
mov dword [eax], edi
jmp 0x502f68
mov eax, dword [0x8c7f60]
mov dword [esp + 0x10], edi
mov dword [esp + 0x28], edi
cmp esi, eax
mov edi, esi
jne 0x502e03
xor edi, edi
push 0
push edi
lea ecx, [esp + 0x30]
call fcn.00500040
mov ecx, dword [esp + 0x28]
mov dword [ecx], edi
mov eax, dword [esp + 0x28]
test eax, eax
je 0x502e27
mov dword [eax], 0
mov eax, dword [esp + 0x28]
test eax, eax
mov dword [esp + 0x1c], 0
je 0x502e38
mov eax, dword [eax + 8]
jmp 0x502e3a
xor eax, eax
lea edx, [esp + 0x10]
push 0
push edx
push esi
push eax
push ebp
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x502e94
mov eax, dword [esp + 0x2c]
test eax, eax
je 0x502e5c
mov dword [eax], 0xffffffff
push ebp
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov esi, dword [esp + 0x24]
mov eax, dword [esp + 0x28]
test eax, eax
mov dword [esi], 0
je 0x502f66
mov edx, dword [eax + 4]
dec edx
mov dword [eax + 4], edx
mov eax, dword [esp + 0x28]
mov ecx, dword [eax + 4]
test ecx, ecx
jne 0x502f66
jmp 0x502f5d
mov eax, dword [esp + 0x28]
test eax, eax
je 0x502ea1
mov eax, dword [eax + 8]
jmp 0x502ea3
xor eax, eax
push esi
push eax
lea eax, [esp + 0x34]
mov ecx, ebx
push eax
call fcn.00502af0
lea ecx, [esp + 0x28]
mov ebx, 1
cmp ecx, eax
mov byte [esp + 0x1c], bl
je 0x502ee5
mov eax, dword [eax]
test eax, eax
je 0x502ecc
mov ecx, dword [eax]
jmp 0x502ece
xor ecx, ecx
test eax, eax
je 0x502ed7
mov eax, dword [eax + 8]
jmp 0x502ed9
xor eax, eax
push ecx
push eax
push ebx
lea ecx, [esp + 0x34]
call fcn.00502f80
mov eax, dword [esp + 0x2c]
mov byte [esp + 0x1c], 0
test eax, eax
je 0x502f0d
mov edx, dword [eax + 4]
dec edx
mov dword [eax + 4], edx
mov eax, dword [esp + 0x2c]
mov ecx, dword [eax + 4]
test ecx, ecx
jne 0x502f0d
push eax
call fcn.00538bee
add esp, 4
push ebp
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov esi, dword [esp + 0x24]
mov eax, dword [esp + 0x28]
test eax, eax
mov dword [esi], 0
je 0x502f36
cmp dword [eax + 4], ebx
jle 0x502f2f
mov dword [esi], eax
jmp 0x502f47
mov ecx, dword [eax]
mov eax, dword [eax + 8]
jmp 0x502f3a
xor ecx, ecx
xor eax, eax
push ecx
push eax
mov ecx, esi
call fcn.004ffd10
mov eax, dword [esp + 0x28]
test eax, eax
je 0x502f66
mov edx, dword [eax + 4]
dec edx
mov dword [eax + 4], edx
mov eax, dword [esp + 0x28]
mov ecx, dword [eax + 4]
test ecx, ecx
jne 0x502f66
push eax
call fcn.00538bee
add esp, 4
mov eax, esi
mov ecx, dword [esp + 0x14]
pop edi
pop esi
pop ebp
pop ebx
mov dword fs:[0], ecx
add esp, 0x10
ret 0xc