Function at 0x500450
Capabilities:
Read file on windows

Disassembly:
push ebx
mov ebx, esp
sub esp, 8
and esp, 0xfffffff8
add esp, 4
push ebp
mov ebp, dword [ebx + 4]
mov dword [esp + 4], ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x60c106
mov eax, dword fs:[0]
push eax
push ebx
sub esp, 0x28
push esi
push edi
mov eax, dword [0x7f206c]
xor eax, ebp
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov esi, ecx
lea eax, [esi + 8]
push eax
lea ecx, [ebp - 0x18]
call fcn.004104b0
mov dword [ebp - 4], 0
mov esi, dword [esi]
test esi, esi
je 0x5005bb
push dword [ebx + 0x10]
mov ecx, esi
call fcn.00415660
test al, al
je 0x5005bb
mov edi, dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp dword [ebx + 0xc], 0
jle 0x50064e
push 0
push 0
push 1
xorps xmm0, xmm0
mov dword [ebp - 0x28], 0
push 0
movups xmmword [ebp - 0x38], xmm0
call dword [sym.imp.KERNEL32.dll_CreateEventW]
mov dword [ebp - 0x28], eax
lea eax, [ebp - 0x38]
push eax
lea eax, [ebp - 0x14]
mov dword [ebp - 0x14], 0
push eax
push dword [ebx + 0xc]
push dword [ebx + 8]
push dword [esi + 4]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x50063f
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x3e5
jne 0x500571
mov al, byte [esi + 0xe]
test al, al
jne 0x50062c
mov eax, dword [ebp - 0x28]
mov ecx, dword [ebx + 0x10]
mov dword [ebp - 0x24], eax
mov eax, dword [esi + 8]
mov dword [ebp - 0x20], eax
or eax, 0xffffffff
test ecx, ecx
cmovns eax, ecx
push eax
push 0
lea eax, [ebp - 0x24]
push eax
push 2
call dword [sym.imp.KERNEL32.dll_WaitForMultipleObjects]
test eax, eax
jne 0x50062c
push eax
lea eax, [ebp - 0x14]
push eax
lea eax, [ebp - 0x38]
push eax
push dword [esi + 4]
call dword [sym.imp.KERNEL32.dll_GetOverlappedResult]
test eax, eax
jne 0x50061e
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp byte [esi + 0xd], 0
je 0x500635
cmp eax, 0x6d
je 0x500591
cmp eax, 0xe9
jne 0x500635
cmp byte [esi + 0xc], 0
je 0x5005a4
push dword [esi + 4]
call dword [sym.imp.KERNEL32.dll_DisconnectNamedPipe]
mov byte [esi + 0xc], 0
push dword [ebp - 0x28]
call edi
push dword [ebx + 0x10]
mov ecx, esi
call fcn.00415660
test al, al
jne 0x5004c2
or edi, 0xffffffff
mov dword [ebp - 4], 1
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov esi, dword [ebp - 0x18]
mov ecx, esi
mov dword [ebp - 0x1c], eax
call fcn.005127d0
mov ecx, dword [esi + 0xd8]
xor edx, edx
test ecx, ecx
jle 0x500602
mov eax, dword [esi + 0xd0]
nop word [eax + eax]
mov esi, dword [ebp - 0x1c]
cmp dword [eax], esi
mov esi, dword [ebp - 0x18]
je 0x500655
inc edx
add eax, 8
cmp edx, ecx
jl 0x5005f0
xor eax, eax
xchg dword [esi], eax
mov eax, edi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
mov esp, ebp
pop ebp
mov esp, ebx
pop ebx
ret 0xc
push dword [ebp - 0x28]
mov edi, dword [ebp - 0x14]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x5005be
push dword [esi + 4]
call dword [sym.imp.KERNEL32.dll_CancelIo]
push dword [ebp - 0x28]
call edi
jmp 0x5005bb
push dword [ebp - 0x28]
mov esi, dword [ebp - 0x14]
call edi
mov edi, esi
jmp 0x5005be
xor edi, edi
jmp 0x5005be
add dword [eax + 4], 0xffffffff
jne 0x5006e8
cmp edx, dword [esi + 0xd8]
jae 0x5006d8
mov eax, dword [esi + 0xd0]
lea ecx, [eax + edx*8]
mov eax, dword [esi + 0xd8]
sub eax, edx
lea eax, [eax*8 - 8]
push eax
lea eax, [ecx + 8]
push eax
push ecx
call fcn.004bfcc0
mov eax, dword [esi + 0xd8]
add esp, 0xc
mov dword [ebp - 0x1c], eax
lea ecx, [eax - 1]
xor eax, eax
mov dword [esi + 0xd8], ecx
add ecx, ecx
test ecx, ecx
cmovg eax, ecx
cmp dword [esi + 0xd4], eax
jle 0x5006d8
mov ecx, dword [ebp - 0x1c]
cmp ecx, 8
mov dword [ebp - 0x18], 8
lea eax, [ecx - 1]
cmovle eax, dword [ebp - 0x18]
cmp eax, dword [esi + 0xd4]
jge 0x5006d8
push eax
lea ecx, [esi + 0xd0]
call fcn.0041bad0
lea ecx, [esi + 4]
call fcn.004fef70
lea ecx, [esi + 0x64]
call fcn.004fef70
xor ecx, ecx
xchg dword [esi], ecx
jmp 0x500606