Function at 0x40bf80
Capabilities:
Receive data
Receive data on socket
Send data
Send data on socket
Set socket configuration

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x134
mov eax, dword [0x4a4300]
xor eax, esp
mov dword [esp + 0x130], eax
mov eax, dword [ebp + 8]
push ebx
push esi
mov ebx, ecx
mov dword [esp + 8], eax
mov eax, dword [ebp + 0x10]
mov esi, edx
mov dword [esp + 0x30], eax
push edi
test ebx, ebx
je 0x40c1db
test esi, esi
je 0x40c1db
cmp esi, 0x5a0
ja 0x40c1db
call fcn.0040fa20
mov ecx, edx
mov dword [esp + 0x24], eax
or eax, ecx
mov dword [esp + 0x20], ecx
je 0x40c1db
xor edi, edi
xorps xmm0, xmm0
mov dword [esp + 0x10], edi
movq qword [esp + 0x14], xmm0
mov dword [esp + 0x1c], edi
cmp dword [0x6b0428], edi
jbe 0x40c034
push 0xec
lea eax, [esp + 0x40]
push edi
push eax
call fcn.00452270
mov eax, dword [0x6b0428]
lea edx, [esp + 0x1c]
add esp, 0xc
mov dword [esp + 0x38], eax
lea ecx, [esp + 0x38]
call fcn.0040bb50
mov edi, dword [esp + 0x10]
neg eax
sbb eax, eax
and dword [0x6b0428], eax
cmp dword [esp + 0x14], 0
jne 0x40c05d
mov ecx, dword [esp + 0x34]
lea edx, [esp + 0x10]
call fcn.0040bb50
test eax, eax
je 0x40c1db
mov eax, dword [esp + 0x14]
mov edi, dword [esp + 0x10]
mov dword [0x6b0428], eax
push dword [esp + 0x1c]
mov edx, esi
mov ecx, ebx
push dword [esp + 0x1c]
call fcn.0040ff30
add esp, 8
test eax, eax
je 0x40c1db
push 0
push esi
push ebx
push edi
call dword [sym.imp.WS2_32.dll_send]
cmp dword [esp + 0xc], 0
je 0x40c0e9
cmp dword [ebp + 0xc], 0
jbe 0x40c0e9
xorps xmm0, xmm0
movdqu xmmword [esp + 0x12c], xmm0
call fcn.0040fa20
sub eax, dword [esp + 0x24]
sbb edx, dword [esp + 0x20]
test edx, edx
jg 0x40c0e9
jl 0x40c0b7
cmp eax, 0xbb8
ja 0x40c0e9
mov ebx, dword [sym.imp.KERNEL32.dll_Sleep]
lea ecx, [ecx]
push 2
push 4
lea eax, [esp + 0x134]
push eax
push edi
call dword [sym.imp.WS2_32.dll_recv]
test eax, eax
je 0x40c0e9
cmp eax, 0xffffffff
jne 0x40c10d
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
cmp eax, 0x2733
je 0x40c165
xor ebx, ebx
test edi, edi
je 0x40c0f6
push edi
call dword [sym.imp.WS2_32.dll_closesocket]
mov eax, ebx
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x130]
xor ecx, esp
call fcn.00451570
mov esp, ebp
pop ebp
ret
cmp eax, 4
jne 0x40c0e9
push dword [esp + 0x1c]
mov edx, eax
lea ecx, [esp + 0x130]
push dword [esp + 0x1c]
call fcn.004100e0
add esp, 8
test eax, eax
je 0x40c0e9
mov esi, dword [esp + 0x12c]
cmp esi, 0x11
jb 0x40c0e9
cmp esi, dword [ebp + 0xc]
ja 0x40c0e9
lea eax, [esp + 0x34]
mov dword [esp + 0x34], 0
push eax
push 0x4004667f
push edi
call dword [sym.imp.WS2_32.dll_ioctlsocket]
test eax, eax
jne 0x40c0e9
mov eax, dword [esp + 0x34]
cmp eax, esi
jae 0x40c196
push 1
call ebx
call fcn.0040fa20
sub eax, dword [esp + 0x24]
sbb edx, dword [esp + 0x20]
mov dword [esp + 0x2c], edx
js 0x40c0c0
jg 0x40c0e9
cmp eax, 0xbb8
jbe 0x40c0c0
jmp 0x40c0e9
jne 0x40c0e9
push 0
push esi
push dword [esp + 0x14]
push edi
call dword [sym.imp.WS2_32.dll_recv]
mov ebx, eax
cmp ebx, esi
jne 0x40c0eb
push dword [esp + 0x1c]
mov esi, dword [esp + 0x10]
mov edx, ebx
push dword [esp + 0x1c]
mov ecx, esi
call fcn.004100e0
add esp, 8
test eax, eax
je 0x40c0eb
mov dword [esi], ebx
jmp 0x40c0eb
mov ecx, dword [esp + 0x13c]
or eax, 0xffffffff
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.00451570
mov esp, ebp
pop ebp
ret