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

Disassembly:
push 0xffffffffffffffff
push 0x566f90
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 0x5018c9
mov eax, dword [esp + 0x2c]
cmp eax, edi
je 0x5018be
mov dword [eax], ebp
mov eax, dword [esp + 0x24]
mov dword [eax], edi
jmp 0x501a78
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 0x5018fe
mov eax, dword [esp + 0x2c]
cmp eax, edi
je 0x5018ec
mov dword [eax], esi
push ebp
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [esp + 0x24]
mov dword [eax], edi
jmp 0x501a78
mov eax, dword [0x8c6b70]
mov dword [esp + 0x10], edi
mov dword [esp + 0x28], edi
cmp esi, eax
mov edi, esi
jne 0x501913
xor edi, edi
push 0
push edi
lea ecx, [esp + 0x30]
call fcn.004feb50
mov ecx, dword [esp + 0x28]
mov dword [ecx], edi
mov eax, dword [esp + 0x28]
test eax, eax
je 0x501937
mov dword [eax], 0
mov eax, dword [esp + 0x28]
test eax, eax
mov dword [esp + 0x1c], 0
je 0x501948
mov eax, dword [eax + 8]
jmp 0x50194a
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 0x5019a4
mov eax, dword [esp + 0x2c]
test eax, eax
je 0x50196c
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 0x501a76
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 0x501a76
jmp 0x501a6d
mov eax, dword [esp + 0x28]
test eax, eax
je 0x5019b1
mov eax, dword [eax + 8]
jmp 0x5019b3
xor eax, eax
push esi
push eax
lea eax, [esp + 0x34]
mov ecx, ebx
push eax
call fcn.00501600
lea ecx, [esp + 0x28]
mov ebx, 1
cmp ecx, eax
mov byte [esp + 0x1c], bl
je 0x5019f5
mov eax, dword [eax]
test eax, eax
je 0x5019dc
mov ecx, dword [eax]
jmp 0x5019de
xor ecx, ecx
test eax, eax
je 0x5019e7
mov eax, dword [eax + 8]
jmp 0x5019e9
xor eax, eax
push ecx
push eax
push ebx
lea ecx, [esp + 0x34]
call fcn.00501a90
mov eax, dword [esp + 0x2c]
mov byte [esp + 0x1c], 0
test eax, eax
je 0x501a1d
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 0x501a1d
push eax
call fcn.005376fe
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 0x501a46
cmp dword [eax + 4], ebx
jle 0x501a3f
mov dword [esi], eax
jmp 0x501a57
mov ecx, dword [eax]
mov eax, dword [eax + 8]
jmp 0x501a4a
xor ecx, ecx
xor eax, eax
push ecx
push eax
mov ecx, esi
call fcn.004fe820
mov eax, dword [esp + 0x28]
test eax, eax
je 0x501a76
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 0x501a76
push eax
call fcn.005376fe
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