Function at 0x40c510
Capabilities:
Get socket status
Send data
Send data on socket

Disassembly:
push 0xffffffffffffffff
push 0x4701ec
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x144
push ebx
push ebp
push esi
mov ebx, ecx
push edi
mov dword [esp + 0x10], ebx
call fcn.0040b960
test al, al
je 0x40c830
mov esi, dword [esp + 0x164]
test esi, esi
je 0x40c830
mov ecx, 0x40
xor eax, eax
lea edi, [esp + 0x54]
mov dword [esp + 0x50], 0
rep stosd dword es:[edi], eax
mov ecx, dword [esp + 0x16c]
xor edi, edi
cmp ecx, 0xffffffff
je 0x40c5a1
mov eax, 0x10624dd3
lea edi, [esp + 0x48]
mul ecx
shr edx, 6
mov dword [esp + 0x48], edx
mov eax, ecx
xor edx, edx
mov ecx, 0x3e8
div ecx
lea eax, [edx + edx*4]
lea eax, [eax + eax*4]
lea edx, [eax + eax*4]
shl edx, 3
mov dword [esp + 0x4c], edx
mov ebp, dword [ebx + 4]
lea eax, [esp + 0x50]
push eax
push ebp
call sub.WSOCK32.dll___WSAFDIsSet
test eax, eax
jne 0x40c5c9
mov eax, dword [esp + 0x50]
cmp eax, 0x40
jae 0x40c5c9
mov dword [esp + eax*4 + 0x54], ebp
mov eax, dword [esp + 0x50]
inc eax
mov dword [esp + 0x50], eax
push edi
lea ecx, [esp + 0x54]
push 0
push ecx
lea edx, [ebp + 1]
push 0
push edx
call sub.WSOCK32.dll_select
mov edi, dword [esp + 0x168]
test eax, eax
jle 0x40c743
mov ecx, ebx
call fcn.0040b9a0
mov ecx, dword [esp + 0x10]
mov bl, al
mov byte [esp + 0x17], bl
call fcn.0040b990
test al, al
jne 0x40c618
test bl, bl
jne 0x40c618
push 0
push edi
push esi
push ebp
call sub.WSOCK32.dll_send
jmp 0x40c73f
mov al, byte [esp + 0x17]
neg bl
sbb ebx, ebx
and ebx, 0x10
test al, al
mov dword [esp + 0x34], ebx
je 0x40c73b
cmp edi, 0x10
jae 0x40c647
push 0x6f8
call dword [sym.imp.KERNEL32.dll_SetLastError]
or eax, 0xffffffff
jmp 0x40c832
xor eax, eax
mov ecx, esi
mov dword [esp + 0x24], eax
push 0xffffffffffffffff
mov edx, dword [ecx]
mov dword [esp + 0x2c], eax
mov dword [esp + 0x30], eax
mov dword [esp + 0x28], edx
mov dword [esp + 0x34], eax
mov eax, dword [ecx + 4]
mov dword [esp + 0x2c], eax
mov edx, dword [ecx + 8]
mov dword [esp + 0x30], edx
mov eax, dword [ecx + 0xc]
mov dword [esp + 0x34], eax
call sub.WSOCK32.dll_htonl
cmp dword [esp + 0x28], eax
je 0x40c6a8
lea ecx, [esp + 0x24]
push 0x10
push ecx
sub edi, ebx
push 0
add ebx, esi
push edi
push ebx
push ebp
call sub.WSOCK32.dll_sendto
test eax, eax
jge 0x40c832
or eax, 0xffffffff
jmp 0x40c832
mov esi, dword [esp + 0x10]
mov ecx, esi
call fcn.0040b9c0
mov eax, dword [esi + 0x14]
mov esi, dword [eax]
cmp esi, eax
je 0x40c72b
mov eax, dword [esp + 0x34]
mov edx, dword [esp + 0x164]
mov ebx, edi
sub ebx, eax
add eax, edx
mov dword [esp + 0x1c], eax
lea eax, [esi + 8]
lea ecx, [esp + 0x24]
push eax
call fcn.0040b790
mov ecx, dword [esp + 0x1c]
lea eax, [esp + 0x24]
push 0x10
push eax
push 0
push ebx
push ecx
push ebp
call sub.WSOCK32.dll_sendto
test eax, eax
jge 0x40c71c
mov eax, esi
mov esi, dword [esi]
push eax
mov ecx, dword [eax + 4]
mov edx, dword [eax]
mov dword [ecx], edx
mov ecx, dword [eax]
mov edx, dword [eax + 4]
mov dword [ecx + 4], edx
call fcn.00463db5
mov eax, dword [esp + 0x14]
add esp, 4
dec dword [eax + 0x18]
jmp 0x40c722
mov esi, dword [esi]
mov eax, dword [esp + 0x10]
cmp esi, dword [eax + 0x14]
jne 0x40c6d1
mov ebx, dword [esp + 0x34]
mov ecx, dword [esp + 0x10]
call fcn.0040b9e0
mov esi, dword [esp + 0x164]
mov eax, edi
sub eax, ebx
mov ebx, dword [esp + 0x10]
test eax, eax
jl 0x40c74b
mov ebp, eax
jmp 0x40c74e
or ebp, 0xffffffff
xor eax, eax
mov dword [esp + 0x38], eax
mov dword [esp + 0x3c], eax
mov dword [esp + 0x40], eax
mov dword [esp + 0x44], eax
lea ecx, [esp + 0x38]
mov dword [esp + 0x15c], eax
push ecx
mov ecx, ebx
call fcn.0040bdd0
mov eax, dword [0x48fb24]
mov dword [esp + 0x20], eax
mov dword [esp + 0x18], eax
push esi
lea edx, [esp + 0x1c]
mov bl, 2
push 0x48b480
push edx
mov byte [esp + 0x168], bl
call fcn.00461a66
add esp, 0xc
lea eax, [esp + 0x1c]
lea ecx, [esp + 0x18]
push edi
push eax
call fcn.0046168b
push eax
lea ecx, [esp + 0x1c]
mov byte [esp + 0x160], 3
call fcn.004629d1
lea ecx, [esp + 0x1c]
mov byte [esp + 0x15c], bl
call fcn.00462898
mov ecx, dword [esp + 0x3f]
mov edx, dword [esp + 0x3e]
mov eax, dword [esp + 0x3d]
and ecx, 0xff
push ecx
mov ecx, dword [esp + 0x40]
and edx, 0xff
and eax, 0xff
push edx
and ecx, 0xff
push eax
push ecx
lea edx, [esp + 0x30]
push str._u._u._0u._u
push edx
call fcn.00461a66
add esp, 0x18
lea ecx, [esp + 0x18]
mov byte [esp + 0x15c], 1
call fcn.00462898
lea ecx, [esp + 0x20]
mov byte [esp + 0x15c], 0
call fcn.00462898
mov eax, ebp
jmp 0x40c832
xor eax, eax
mov ecx, dword [esp + 0x154]
pop edi
pop esi
pop ebp
pop ebx
mov dword fs:[0], ecx
add esp, 0x150
ret 0xc