Function at 0x40ce90
Capabilities:
Get local ipv4 addresses
Get socket information
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, 0x84c
mov eax, dword [0x4a2300]
xor eax, esp
mov dword [esp + 0x848], eax
push ebx
push esi
push edi
xor ebx, ebx
mov dword [esp + 0xc], ecx
push 0x3ff
lea eax, [esp + 0x55]
mov dword [esp + 0x14], ebx
mov esi, edx
mov dword [esp + 0x18], ebx
push ebx
push eax
mov dword [esp + 0x2c], esi
xor edi, edi
mov byte [esp + 0x5c], bl
call fcn.00451650
add esp, 0xc
mov byte [esp + 0x450], bl
lea eax, [esp + 0x451]
push 0x3ff
push ebx
push eax
call fcn.00451650
xor eax, eax
mov dword [esp + 0x30], 0x10
add esp, 0xc
mov word [esp + 0x38], ax
mov dword [esp + 0x42], eax
xorps xmm0, xmm0
mov word [esp + 0x46], ax
mov word [esp + 0x28], ax
mov dword [esp + 0x32], eax
mov word [esp + 0x36], ax
lea eax, [esp + 0x24]
push eax
lea eax, [esp + 0x3c]
movq qword [esp + 0x3e], xmm0
push eax
push dword [esp + 0x14]
movq qword [esp + 0x36], xmm0
call dword [sym.imp.WS2_32.dll_getsockname]
test eax, eax
jne 0x40d02b
lea eax, [esp + 0x24]
mov dword [esp + 0x24], 0x10
push eax
lea eax, [esp + 0x2c]
push eax
push dword [esp + 0x14]
call dword [sym.imp.WS2_32.dll_getpeername]
test eax, eax
jne 0x40d02b
cmp dword [esp + 0xc], ebx
je 0x40d02b
test esi, esi
je 0x40d02b
mov esi, dword [sym.imp.WS2_32.dll_WSACreateEvent]
call esi
mov dword [esp + 0x1c], eax
test eax, eax
je 0x40d02b
call esi
mov dword [esp + 0x18], eax
test eax, eax
je 0x40d014
mov esi, dword [sym.imp.WS2_32.dll_WSAEventSelect]
push 0x23
push dword [esp + 0x20]
push dword [esp + 0x14]
call esi
cmp eax, 0xffffffff
je 0x40d014
push 0x23
push dword [esp + 0x1c]
push dword [esp + 0x28]
call esi
cmp eax, 0xffffffff
je 0x40d014
mov eax, dword [esp + 0x1c]
mov dword [esp + 0x48], eax
mov eax, dword [esp + 0x18]
mov dword [esp + 0x4c], eax
mov esi, dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov eax, dword [sym.imp.WS2_32.dll_recv]
nop
test edi, edi
jne 0x40d0b0
mov esi, dword [esp + 0x20]
lea ecx, [esp + 0x50]
push 2
push 2
push ecx
push esi
call eax
test eax, eax
je 0x40d014
cmp eax, 0xffffffff
jne 0x40d040
mov esi, dword [sym.imp.WS2_32.dll_WSAGetLastError]
call esi
cmp eax, 0x2733
je 0x40d0ab
push dword [esp + 0x1c]
mov esi, dword [sym.imp.WS2_32.dll_WSACloseEvent]
call esi
mov eax, dword [esp + 0x18]
test eax, eax
je 0x40d02b
push eax
call esi
mov ecx, dword [esp + 0x854]
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.0045094b
mov esp, ebp
pop ebp
ret
cmp eax, 2
jne 0x40d0a5
mov eax, dword [esp + 0x50]
mov ecx, 0x3fb
add eax, 0xfffffffb
cmp ax, cx
ja 0x40d014
lea eax, [esp + 0x24]
mov dword [esp + 0x24], 0
push eax
push 0x4004667f
push esi
call dword [sym.imp.WS2_32.dll_ioctlsocket]
test eax, eax
jne 0x40d014
movzx eax, word [esp + 0x50]
cmp dword [esp + 0x24], eax
jb 0x40d0a5
push 0
push eax
lea eax, [esp + 0x58]
push eax
push esi
call dword [sym.imp.WS2_32.dll_recv]
movzx ecx, word [esp + 0x50]
cmp eax, ecx
jne 0x40d014
mov dword [esp + 0x10], 4
lea edi, [eax - 4]
mov esi, dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov eax, dword [sym.imp.WS2_32.dll_recv]
test ebx, ebx
jne 0x40d107
push ebx
push 0x3fc
lea ecx, [esp + 0x45c]
push ecx
push dword [esp + 0x18]
call eax
test eax, eax
je 0x40d014
cmp eax, 0xffffffff
jne 0x40d0e4
call esi
cmp eax, 0x2733
jne 0x40d014
jmp 0x40d107
add eax, 4
mov dword [esp + 0x14], 0
mov ecx, 4
mov word [esp + 0x450], ax
mov word [esp + 0x452], cx
movzx ebx, ax
test edi, edi
jne 0x40d140
test ebx, ebx
jne 0x40d194
push ebx
push 0x1388
push ebx
lea eax, [esp + 0x54]
push eax
push 2
call dword [sym.imp.WS2_32.dll_WSAWaitForMultipleEvents]
push dword [esp + 0x48]
call dword [sym.imp.WS2_32.dll_WSAResetEvent]
push dword [esp + 0x4c]
call dword [sym.imp.WS2_32.dll_WSAResetEvent]
jmp 0x40cfda
jle 0x40d192
mov eax, dword [esp + 0x10]
lea esi, [esp + 0x50]
push 0
push edi
add eax, esi
push eax
push dword [esp + 0x18]
call dword [sym.imp.WS2_32.dll_send]
mov esi, eax
test esi, esi
js 0x40d1c6
cmp esi, edi
jg 0x40d014
add dword [esp + 0x10], esi
sub edi, esi
push 0x6b5bd0
call dword [sym.imp.KERNEL32.dll_InterlockedIncrement]
push esi
push 0x6afdd4
call dword [sym.imp.KERNEL32.dll_InterlockedExchangeAdd]
mov eax, esi
cdq
push edx
push eax
call fcn.0040ce20
add esp, 8
test ebx, ebx
mov esi, dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov eax, dword [sym.imp.WS2_32.dll_recv]
jle 0x40cfe0
mov eax, dword [esp + 0x14]
lea esi, [esp + 0x450]
push 0
push ebx
add eax, esi
push eax
push dword [esp + 0x2c]
call dword [sym.imp.WS2_32.dll_send]
mov esi, eax
test esi, esi
jns 0x40d1e6
mov esi, dword [sym.imp.WS2_32.dll_WSAGetLastError]
call esi
cmp eax, 0x2733
jne 0x40d014
push 1
call dword [sym.imp.KERNEL32.dll_Sleep]
jmp 0x40cfda
cmp esi, ebx
jg 0x40d014
add dword [esp + 0x14], esi
sub ebx, esi
push 0x6afddc
call dword [sym.imp.KERNEL32.dll_InterlockedIncrement]
push 0x6b5bac
call dword [sym.imp.KERNEL32.dll_InterlockedIncrement]
push esi
push 0x6afdd4
call dword [sym.imp.KERNEL32.dll_InterlockedExchangeAdd]
push esi
push 0x6afdd8
call dword [sym.imp.KERNEL32.dll_InterlockedExchangeAdd]
mov eax, esi
cdq
push edx
push eax
call fcn.0040ce20
add esp, 8
jmp 0x40cfd4