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

Disassembly:
sub esp, 0x114
push ebx
mov ebx, dword [esp + 0x120]
push ebp
mov ebp, dword [esp + 0x120]
push esi
cmp ebp, ebx
push edi
jle 0x4077d5
lea eax, [ebp + 1]
mov dword [esp + 0x14], eax
jmp 0x4077dc
lea ecx, [ebx + 1]
mov dword [esp + 0x14], ecx
mov esi, dword [esp + 0x130]
mov dword [esp + 0x10], 0
mov eax, dword [esp + 0x140]
test eax, eax
mov eax, dword [0x41a54c]
jne 0x407800
mov eax, dword [0x41e3e0]
and eax, 0xffff
xor ecx, ecx
test ebp, ebp
mov dword [esp + 0x18], eax
mov dword [esp + 0x1c], 0
mov dword [esp + 0x20], ecx
jl 0x407828
mov ecx, 1
mov dword [esp + 0x24], ebp
mov dword [esp + 0x20], ecx
test ebx, ebx
jl 0x40783e
cmp ecx, 0x40
jae 0x40783e
mov dword [esp + ecx*4 + 0x24], ebx
mov ecx, dword [esp + 0x20]
inc ecx
mov dword [esp + 0x20], ecx
neg eax
mov ecx, dword [esp + 0x14]
lea edx, [esp + 0x18]
sbb eax, eax
and eax, edx
push eax
push 0
lea eax, [esp + 0x28]
push 0
push eax
push ecx
call sub.WS2_32.dll_select
test eax, eax
je 0x4079d7
jge 0x407877
mov edi, dword [sym.imp.MSVCRT.dll__errno]
call edi
cmp dword [eax], 4
jne 0x40799a
lea edx, [esp + 0x20]
push edx
push ebp
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x4078f1
xor eax, eax
lea ebx, [esi + 4]
mov ax, word [esi]
push 0
push eax
push ebx
push ebp
call sub.WS2_32.dll_recv
mov edi, eax
test edi, edi
jle 0x4079c2
push ebp
push edi
push str.read__d_bytes_from_local_socket__d
push 0
push 5
call fcn.00404de0
mov word [esi + 2], di
mov eax, dword [0x41e410]
add esp, 0x14
test eax, eax
je 0x4078d1
push edi
push ebx
push 0x41b3ac
call fcn.00404fb0
add esp, 0xc
mov ecx, dword [esp + 0x12c]
push esi
push ecx
call fcn.00405740
add esp, 8
cmp eax, edi
jne 0x4079b8
mov ebx, dword [esp + 0x12c]
lea edx, [esp + 0x20]
push edx
push ebx
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x4077eb
push 0
push esi
push ebx
call fcn.004054d0
add esp, 0xc
test eax, eax
jle 0x4079cc
mov eax, dword [esp + 0x140]
lea edi, [esi + 4]
test eax, eax
je 0x407949
mov eax, dword [esp + 0x134]
mov edx, dword [esp + 0x13c]
xor ecx, ecx
push 0x10
mov cx, word [esi + 2]
push eax
push 0
push ecx
push edi
push edx
call sub.WS2_32.dll_sendto
jmp 0x407958
mov ax, word [esi + 2]
push eax
push edi
push ebp
call fcn.00405270
add esp, 0xc
xor ecx, ecx
mov cx, word [esi + 2]
cmp eax, ecx
jne 0x4079ae
push ebp
push eax
push str.sent__d_bytes_to_local_socket__d
push 0
push 5
call fcn.00404de0
mov eax, dword [0x41e410]
add esp, 0x14
test eax, eax
je 0x4077eb
mov dx, word [esi + 2]
push edx
push edi
push 0x41b384
call fcn.00404fb0
add esp, 0xc
jmp 0x4077eb
push str.error_in_select
call edi
mov eax, dword [eax]
push eax
push 0
call fcn.00404de0
add esp, 0xc
mov dword [esp + 0x10], 0xffffffff
jmp 0x4079d7
mov dword [esp + 0x10], 1
jmp 0x4079d7
neg edi
sbb edi, edi
mov dword [esp + 0x10], edi
jmp 0x4079d7
xor ecx, ecx
test eax, eax
setne cl
mov dword [esp + 0x10], ecx
push str.connection_closed_or_timed_out
push 0
push 3
call fcn.00404de0
mov edx, dword [esi + 0x8108]
mov eax, dword [esi + 0x8110]
mov ecx, dword [esi + 0x810c]
push edx
push eax
push ecx
push str.read__lu_bytes___lu_expanded__in__lu_messages
push 0
push 2
call fcn.00404de0
mov edx, dword [esi + 0x8114]
mov eax, dword [esi + 0x811c]
mov ecx, dword [esi + 0x8118]
push edx
push eax
push ecx
push str.wrote__lu_bytes___lu_expanded__in__lu_messages
push 0
push 2
call fcn.00404de0
mov eax, dword [esp + 0x4c]
add esp, 0x3c
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x114
ret