Function at 0x4025e0
Capabilities:
Get socket status
Receive data
Receive data on socket
Send data
Send data on socket

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x85c
mov eax, dword [ebp + 8]
cmp dword [ebp + 0x10], eax
mov edx, dword [ebp + 8]
cmovge eax, dword [ebp + 0x10]
xor edi, edi
mov ecx, dword [ebp + 8]
xor esi, esi
mov dword [ebp - 0x82c], 1
add eax, 1
shr edx, 5
mov dword [ebp - 0x820], eax
mov eax, 1
and ecx, 0x1f
mov dword [ebp - 0x844], edx
mov edx, eax
shl edx, cl
mov dword [ebp - 0x840], ecx
mov ecx, dword [ebp + 0x10]
mov dword [ebp - 0x83c], edx
mov edx, dword [ebp + 0x10]
mov dword [ebp - 0x828], 1
mov dword [ebp - 0x824], 0xfffffffe
shr ecx, 5
and edx, 0x1f
mov dword [ebp - 0x838], ecx
mov ecx, edx
shl eax, cl
mov dword [ebp - 0x834], edx
lea edx, [ebp - 0x14]
mov dword [ebp - 0x830], eax
lea eax, [ebp - 0xc]
mov dword [ebp - 0x850], eax
mov dword [ebp - 0x854], edx
lea esi, [esi]
lea eax, [ebp - 0x14]
mov byte [eax], 0
add eax, 1
cmp eax, dword [ebp - 0x850]
jne 0x402683
lea eax, [ebp - 0x1c]
mov byte [eax], 0
add eax, 1
cmp eax, dword [ebp - 0x854]
jne 0x402694
mov eax, dword [ebp - 0x82c]
cmp edi, 0x3ff
setle byte [ebp - 0x845]
test eax, eax
je 0x4026d2
cmp byte [ebp - 0x845], 0
je 0x4026d2
mov ecx, dword [ebp - 0x844]
mov eax, dword [ebp - 0x83c]
or dword [ebp + ecx*4 - 0x14], eax
mov eax, dword [ebp - 0x828]
cmp esi, 0x3ff
setle bl
test eax, eax
je 0x4026f9
test bl, bl
je 0x4026f9
mov edx, dword [ebp - 0x838]
mov ecx, dword [ebp - 0x830]
or dword [ebp + edx*4 - 0x14], ecx
mov ecx, dword [ebp - 0x820]
lea eax, [ebp - 0x1c]
lea edx, [ebp - 0x14]
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0
mov dword [esp + 8], eax
mov dword [esp + 4], edx
mov dword [esp], ecx
call sub.cygwin1.dll_select
add eax, 1
je 0x402b52
test bl, bl
je 0x4027d0
mov edx, dword [ebp - 0x838]
movzx ecx, byte [ebp - 0x834]
mov eax, dword [ebp + edx*4 - 0x14]
sar eax, cl
test al, 1
je 0x4027d0
mov edx, dword [ebp + 0x10]
mov eax, 0x400
sub eax, esi
mov dword [esp + 8], eax
lea eax, [ebp - 0x81c]
add eax, esi
mov dword [esp + 0xc], 0
mov dword [ebp - 0x84c], eax
mov dword [esp + 4], eax
mov dword [esp], edx
call sub.cygwin1.dll_recv
mov ebx, eax
mov eax, str.closed
test ebx, ebx
je 0x4029d3
cmp ebx, 0xffffffff
je 0x402b28
mov dword [esp + 4], ebx
mov dword [esp], str.recv__d_bytes_n
call fcn.004020e0
cmp dword [0x40a02c], 1
jle 0x4027cc
mov ecx, dword [ebp - 0x84c]
mov dword [esp + 8], ebx
mov dword [esp], 0x4075d7
mov dword [esp + 4], ecx
call fcn.00402550
add esi, ebx
nop
cmp byte [ebp - 0x845], 0
je 0x402832
mov edx, dword [ebp - 0x844]
movzx ecx, byte [ebp - 0x840]
mov eax, dword [ebp + edx*4 - 0x14]
sar eax, cl
test al, 1
je 0x402832
cmp dword [0x40a034], 1
je 0x402a60
mov eax, 0x400
mov edx, dword [ebp + 8]
sub eax, edi
mov dword [esp + 8], eax
lea eax, [ebp - 0x41c]
add eax, edi
mov dword [esp + 4], eax
mov dword [esp], edx
call sub.cygwin1.dll_read
test eax, eax
je 0x402a06
cmp eax, 0xffffffff
je 0x402ac0
add edi, eax
test edi, edi
jle 0x4028c6
mov edx, dword [ebp + 0x10]
lea eax, [ebp - 0x41c]
mov dword [esp + 0xc], 0
mov dword [esp + 8], edi
mov dword [esp + 4], eax
mov dword [esp], edx
call sub.cygwin1.dll_send
cmp eax, 0xffffffff
mov ebx, eax
je 0x402af0
test eax, eax
jle 0x4028c6
cmp dword [0x40a02c], 1
jle 0x40288d
lea ecx, [ebp - 0x41c]
mov dword [esp + 8], eax
mov dword [esp + 4], ecx
mov dword [esp], 0x407638
call fcn.00402550
sub edi, ebx
mov dword [esp + 4], ebx
mov dword [esp], str.sent__d_bytes_n
call fcn.004020e0
cmp edi, 0
jle 0x402a90
lea eax, [ebp - 0x41c]
add eax, ebx
mov dword [esp + 4], eax
lea eax, [ebp - 0x41c]
mov dword [esp + 8], edi
mov dword [esp], eax
call sub.cygwin1.dll_memcpy
test esi, esi
jle 0x402905
cmp dword [0x40a034], 1
je 0x402986
mov edx, dword [ebp + 0xc]
lea eax, [ebp - 0x81c]
mov dword [esp + 8], esi
mov dword [esp + 4], eax
mov dword [esp], edx
call sub.cygwin1.dll_write
mov ebx, eax
cmp ebx, 0xffffffff
je 0x4029b2
sub esi, ebx
cmp ebx, esi
jl 0x402940
test esi, esi
js 0x402962
mov ebx, dword [ebp - 0x82c]
test ebx, ebx
jne 0x40291d
mov ecx, dword [0x40a03c]
test ecx, ecx
jne 0x402b78
mov ecx, dword [ebp - 0x82c]
or ecx, dword [ebp - 0x828]
jne 0x402680
mov eax, dword [ebp - 0x824]
add esp, 0x85c
pop ebx
pop esi
pop edi
pop ebp
ret
lea eax, [ebp - 0x81c]
add eax, ebx
lea ecx, [ebp - 0x81c]
mov dword [esp + 8], esi
mov dword [esp + 4], eax
mov dword [esp], ecx
call sub.cygwin1.dll_memcpy
test esi, esi
jns 0x402905
mov dword [esp + 0xc], str.0___rbuf_len
mov dword [esp + 8], str.do_repeater
mov dword [esp + 4], 0xabc
mov dword [esp], str.connect.c
call sub.cygwin1.dll___assert_func
mov ecx, dword [ebp + 0xc]
lea edx, [ebp - 0x81c]
mov dword [esp + 0xc], 0
mov dword [esp + 8], esi
mov dword [esp + 4], edx
mov dword [esp], ecx
call sub.cygwin1.dll_send
mov ebx, eax
cmp ebx, 0xffffffff
jne 0x4028fb
call sub.cygwin1.dll___errno
mov eax, dword [eax]
mov dword [esp], str.output__local__failed__errno_d_n
mov dword [esp + 4], eax
call fcn.00401870
jmp 0x4028fb
mov eax, str.reset
mov dword [esp + 4], eax
mov dword [esp], str.connection__s_by_peer_n
call fcn.004020e0
mov dword [ebp - 0x82c], 0
mov dword [ebp - 0x828], 0
mov dword [ebp - 0x824], 1
jmp 0x4027d0
mov dword [esp], str.local_input_is_EOF_n
call fcn.004020e0
mov eax, dword [0x40a03c]
mov dword [ebp - 0x82c], 0
mov dword [ebp - 0x824], 0
test eax, eax
jne 0x402832
mov ecx, dword [ebp + 0x10]
mov dword [esp + 4], 1
mov dword [esp], ecx
call sub.cygwin1.dll_shutdown
mov dword [ebp - 0x82c], 0
mov dword [ebp - 0x824], 0
jmp 0x402832
mov eax, 0x400
sub eax, edi
mov dword [esp + 8], eax
lea eax, [ebp - 0x41c]
add eax, edi
mov dword [esp + 4], eax
mov eax, dword [ebp + 8]
mov dword [esp + 0xc], 0
mov dword [esp], eax
call sub.cygwin1.dll_recv
jmp 0x40281f
je 0x4028c6
mov dword [esp + 0xc], str.0___lbuf_len
mov dword [esp + 8], str.do_repeater
mov dword [esp + 4], 0xaac
mov dword [esp], str.connect.c
call sub.cygwin1.dll___assert_func
lea esi, [esi]
mov eax, dword [0x40a03c]
test eax, eax
je 0x402b0c
mov dword [esp], str.failed_to_read_from_local_n
call fcn.004020e0
mov dword [ebp - 0x82c], 0
mov dword [ebp - 0x824], 0
jmp 0x402832
call sub.cygwin1.dll___errno
mov eax, dword [eax]
mov dword [esp], str.send___failed___d_n
mov dword [esp + 4], eax
call fcn.00401870
jmp 0x4028c6
call sub.cygwin1.dll___errno
mov eax, dword [eax]
mov dword [esp], str.recv___failed__errno___d_n
mov dword [esp + 4], eax
call fcn.00401870
jmp 0x402832
call sub.cygwin1.dll___errno
cmp dword [eax], 0x68
je 0x4029ce
call sub.cygwin1.dll___errno
mov eax, dword [eax]
mov dword [esp], str.recv___failed___d_n
mov dword [esp + 4], eax
call fcn.00401870
jmp 0x4027d0
call sub.cygwin1.dll___errno
mov eax, dword [eax]
mov dword [esp], str.select___failed___d_n
mov dword [esp + 4], eax
call fcn.00401ee0
mov dword [ebp - 0x824], 0xffffffff
jmp 0x40292f
mov dword [esp], str.closing_local_port_without_disconnecting_from_remote_n
call fcn.004020e0
mov eax, dword [ebp + 0xc]
mov dword [esp + 4], 2
mov dword [esp], eax
call sub.cygwin1.dll_shutdown
mov edx, dword [ebp + 0xc]
mov dword [esp], edx
call sub.cygwin1.dll_close
jmp 0x40292f