Function at 0x501f80
Capabilities:
Check for time delay via gettickcount
Receive data
Receive data on socket
Set socket configuration

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x5c5e30
mov eax, dword fs:[0]
push eax
sub esp, 0x16c
mov eax, dword [0x692c00]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov esi, ecx
mov ebx, dword [ebp + 0x14]
lea ecx, [ebp - 0x48]
mov edi, dword [ebp + 0x10]
xorps xmm0, xmm0
push str.terminateConnection
push ebx
movq qword [ebp - 0x48], xmm0
mov dword [ebp - 0x40], 0
call fcn.004481f0
cmp dword [esi + 0x294], 0xffffffff
mov dword [ebp - 4], 0
je 0x502266
cmp byte [esi + 0xd6], 0
lea eax, [esi + 0xd6]
jne 0x502266
xorps xmm0, xmm0
lea ecx, [ebp - 0x3c]
push eax
movlpd qword [ebp - 0x3c], xmm0
call fcn.0042a240
mov cl, byte [ebp + 8]
mov byte [ebp - 4], 1
test cl, cl
jne 0x502023
push 1
call fcn.00447e20
mov cl, byte [ebp + 8]
add esp, 4
cmp byte [esi + 0x291], 0
mov byte [ebp - 0x175], 1
jne 0x502182
test cl, cl
jne 0x502182
cmp byte [esi + 0x292], cl
jne 0x502182
push 1
push dword [esi + 0x294]
call dword [sym.imp.WS2_32.dll_shutdown]
mov byte [esi + 0x292], 1
test eax, eax
je 0x502098
mov eax, dword [ebx]
mov ecx, ebx
push str.error_on_socket_shutdown.
call dword [eax + 0x14]
push ebx
push 0
call fcn.005007a0
add esp, 8
push dword [esi + 0x294]
call dword [sym.imp.WS2_32.dll_closesocket]
mov dword [esi + 0x294], 0xffffffff
xor bl, bl
jmp 0x502253
cmp dword [esi + 0x294], 0xffffffff
jne 0x5020ae
xor al, al
mov byte [ebp - 0x175], al
jmp 0x502182
mov eax, dword [ebp + 0xc]
mov edx, 0x7530
test eax, eax
mov ecx, edx
push 0x12c
cmovne ecx, eax
lea eax, [ebp - 0x174]
cmp ecx, edx
push 0
cmova ecx, edx
push eax
mov dword [ebp - 0x34], ecx
call sub.VCRUNTIME140.dll_memset
add esp, 0xc
lea ecx, [ebp - 0x174]
push edi
call fcn.0046ea80
mov byte [ebp - 4], 2
call sub.KERNEL32.DLL_GetTickCount
push 0
mov edi, eax
lea eax, [ebp - 0x30]
push 0x20
push eax
push dword [esi + 0x294]
call dword [sym.imp.WS2_32.dll_recv]
test eax, eax
je 0x502157
nop word [eax + eax]
cmp eax, 0xffffffff
je 0x502119
test eax, eax
jns 0x50212a
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
cmp eax, 0x2733
jne 0x5021f1
call sub.KERNEL32.DLL_GetTickCount
cmp eax, edi
cmovb edi, eax
sub eax, edi
cmp eax, dword [ebp - 0x34]
jae 0x5021f1
push 0
push 0x20
lea eax, [ebp - 0x30]
push eax
push dword [esi + 0x294]
call dword [sym.imp.WS2_32.dll_recv]
test eax, eax
jne 0x502110
cmp byte [ebx + 0x129], 0
je 0x50216c
mov eax, dword [ebx]
mov ecx, ebx
push str.TCP_connection_cleanly_closed_by_peer.
call dword [eax + 0x18]
lea ecx, [ebp - 0x174]
mov byte [ebp - 4], 1
call fcn.0046eb60
mov byte [ebp - 0x175], 1
push str.AbortiveClose
lea ecx, [ebx + 0x90]
call fcn.0042ce80
test al, al
je 0x5021b9
push 4
lea eax, [ebp - 0x34]
mov dword [ebp - 0x34], 1
push eax
push 0x80
push 0xffff
push dword [esi + 0x294]
call dword [sym.imp.WS2_32.dll_setsockopt]
push dword [esi + 0x294]
call dword [sym.imp.WS2_32.dll_closesocket]
test eax, eax
je 0x50220d
mov eax, dword [ebx]
mov ecx, ebx
push str.error_on_closesocket.
call dword [eax + 0x14]
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push ebx
push 0
push eax
call fcn.00500330
add esp, 0xc
xor al, al
mov byte [ebp - 0x175], al
jmp 0x502213
lea ecx, [ebp - 0x174]
mov byte [ebp - 4], 1
call fcn.0046eb60
xor al, al
mov byte [ebp - 0x175], al
jmp 0x502182
mov al, byte [ebp - 0x175]
mov dword [esi + 0x294], 0xffffffff
cmp byte [ebx + 0x129], 0
je 0x50224d
cmp byte [esi + 0x291], 0
mov edx, dword [ebx]
je 0x502238
push str.Closed_listen_socket.
jmp 0x502248
test al, al
je 0x502243
push str.Cleanly_terminated_TCP_connection.
jmp 0x502248
push str.Terminated_TCP_connection.
mov ecx, ebx
call dword [edx + 0x18]
mov bl, byte [ebp - 0x175]
lea ecx, [ebp - 0x3c]
mov word [esi + 0x290], 0
call fcn.0042a340
jmp 0x502268
mov bl, 1
lea ecx, [ebp - 0x48]
call fcn.004482f0
mov al, bl
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.005b34c8
mov esp, ebp
pop ebp
ret 0x10