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

Disassembly:
sub esp, 0x128
push ebx
push ebp
push esi
mov esi, ecx
push edi
mov dword [esp + 0x10], esi
call fcn.00412b50
test al, al
je 0x413ab1
mov eax, dword [esp + 0x13c]
xor ebx, ebx
cmp eax, ebx
je 0x413ab1
mov ecx, 0x40
xor eax, eax
lea edi, [esp + 0x38]
mov dword [esp + 0x34], ebx
rep stosd dword es:[edi], eax
mov ecx, dword [esp + 0x144]
cmp ecx, 0xffffffff
je 0x4138bc
mov eax, 0x10624dd3
lea ebx, [esp + 0x2c]
mul ecx
shr edx, 6
mov dword [esp + 0x2c], edx
mov eax, ecx
xor edx, edx
mov ecx, 0x3e8
div ecx
mov dword [esp + 0x30], edx
mov ebp, dword [esi + 4]
lea edx, [esp + 0x34]
push edx
push ebp
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
jne 0x4138fc
mov edx, dword [esp + 0x34]
test edx, edx
jbe 0x4138e6
lea ecx, [esp + 0x38]
cmp dword [ecx], ebp
je 0x4138e6
inc eax
add ecx, 4
cmp eax, edx
jb 0x4138da
cmp eax, edx
jne 0x4138fc
cmp edx, 0x40
jae 0x4138fc
mov dword [esp + eax*4 + 0x38], ebp
mov eax, dword [esp + 0x34]
inc eax
mov dword [esp + 0x34], eax
xor edi, edi
push ebx
lea eax, [esp + 0x38]
push edi
push eax
lea ecx, [ebp + 1]
push edi
push ecx
call dword [sym.imp.WS2_32.dll_select]
test eax, eax
jle 0x413aa2
mov ecx, esi
call fcn.00412ba0
test al, al
jne 0x41394c
mov ecx, esi
call fcn.00412bb0
test al, al
jne 0x41394c
mov edx, dword [esp + 0x140]
mov eax, dword [esp + 0x13c]
push 0
push edx
push eax
push ebp
call dword [sym.imp.WS2_32.dll_send]
jmp 0x413a8c
mov ecx, esi
call fcn.00412bb0
neg al
sbb eax, eax
mov ecx, esi
and eax, 0x10
mov ebx, eax
mov dword [esp + 0x14], ebx
call fcn.00412bb0
mov edi, dword [esp + 0x140]
test al, al
je 0x413a0d
cmp edi, 0x10
jae 0x413996
push 0x6f8
call dword [sym.imp.KERNEL32.dll_SetLastError]
pop edi
pop esi
pop ebp
or eax, 0xffffffff
pop ebx
add esp, 0x128
ret 0xc
mov edx, dword [esp + 0x13c]
xor ecx, ecx
mov dword [esp + 0x18], ecx
push 0xffffffffffffffff
mov eax, dword [edx]
mov dword [esp + 0x20], ecx
mov dword [esp + 0x24], ecx
mov dword [esp + 0x1c], eax
mov dword [esp + 0x28], ecx
mov ecx, dword [edx + 4]
mov dword [esp + 0x20], ecx
mov eax, dword [edx + 8]
mov dword [esp + 0x24], eax
mov ecx, dword [edx + 0xc]
mov dword [esp + 0x28], ecx
call dword [sym.imp.WS2_32.dll_htonl]
cmp dword [esp + 0x1c], eax
je 0x413a0d
mov eax, dword [esp + 0x13c]
lea edx, [esp + 0x18]
push 0x10
push edx
sub edi, ebx
push 0
add ebx, eax
push edi
push ebx
push ebp
call dword [sym.imp.WS2_32.dll_sendto]
test eax, eax
jge 0x413ab3
pop edi
pop esi
pop ebp
or eax, 0xffffffff
pop ebx
add esp, 0x128
ret 0xc
mov ecx, esi
call fcn.00412bc0
mov eax, dword [esi + 0x20]
mov esi, dword [eax]
cmp esi, eax
je 0x413a7f
mov eax, dword [esp + 0x14]
mov ecx, dword [esp + 0x13c]
mov ebx, edi
sub ebx, eax
add eax, ecx
mov dword [esp + 0x28], eax
mov eax, dword [esp + 0x28]
lea edx, [esi + 8]
push 0x10
push edx
push 0
push ebx
push eax
push ebp
call dword [sym.imp.WS2_32.dll_sendto]
test eax, eax
jge 0x413a70
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.0048c16d
mov eax, dword [esp + 0x14]
add esp, 4
dec dword [eax + 0x24]
jmp 0x413a76
mov esi, dword [esi]
mov eax, dword [esp + 0x10]
cmp esi, dword [eax + 0x20]
jne 0x413a32
mov ebx, dword [esp + 0x14]
mov ecx, dword [esp + 0x10]
call fcn.00412be0
sub edi, ebx
mov eax, edi
test eax, eax
jl 0x413a9f
mov edi, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x128
ret 0xc
or edi, 0xffffffff
mov eax, edi
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x128
ret 0xc
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x128
ret 0xc