Function at 0x40d3f0
Capabilities:
Send data
Send data on socket

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x24
mov eax, dword [ebp + 8]
add eax, 0x3b
mov dword [ebp - 0x18], eax
mov ecx, dword [ebp - 0x18]
mov edx, dword [ecx]
mov dword [ebp - 0x20], edx
mov dword [ebp - 0x10], 0
xor eax, eax
mov dword [ebp - 0xc], eax
xor ecx, ecx
mov dword [ebp - 8], ecx
mov dword [ebp - 4], ecx
mov edx, dword [0x42f5cc]
and edx, 1
je 0x40d44d
push str.sowrite
push 0x4270cc
mov eax, dword [0x42f5c8]
push eax
call fcn.00414be4
add esp, 0xc
mov ecx, dword [0x42f5c8]
push ecx
call fcn.00414b88
add esp, 4
mov edx, dword [0x42f5cc]
and edx, 1
je 0x40d49f
mov eax, dword [0x42f5c8]
push eax
push 0x20
call fcn.00415811
add esp, 8
mov ecx, dword [ebp + 8]
push ecx
push 0x4270d4
mov edx, dword [0x42f5c8]
push edx
call fcn.00414be4
add esp, 0xc
mov eax, dword [0x42f5c8]
push eax
push 0xa
call fcn.00415811
add esp, 8
mov ecx, dword [0x42f5c8]
push ecx
call fcn.00414b88
add esp, 4
mov edx, dword [ebp + 8]
cmp dword [edx + 0x14], 0
je 0x40d4c3
mov eax, dword [ebp + 8]
push eax
call fcn.0040d070
add esp, 4
mov ecx, dword [ebp - 0x18]
cmp dword [ecx], 0
jne 0x40d4c3
xor eax, eax
jmp 0x40d6d9
mov edx, dword [ebp - 0x18]
mov eax, dword [edx]
mov dword [ebp - 0x20], eax
mov ecx, dword [ebp - 0x18]
mov edx, dword [ecx + 0xc]
mov dword [ebp - 0x10], edx
mov eax, dword [ebp - 0x18]
mov ecx, dword [ebp - 0x18]
mov edx, dword [eax + 0xc]
cmp edx, dword [ecx + 8]
jae 0x40d508
mov eax, dword [ebp - 0x18]
mov ecx, dword [ebp - 0x18]
mov edx, dword [eax + 8]
sub edx, dword [ecx + 0xc]
mov dword [ebp - 0xc], edx
mov eax, dword [ebp - 0xc]
cmp eax, dword [ebp - 0x20]
jbe 0x40d4ff
mov ecx, dword [ebp - 0x20]
mov dword [ebp - 0xc], ecx
mov dword [ebp - 0x14], 1
jmp 0x40d56c
mov edx, dword [ebp - 0x18]
mov eax, dword [edx + 0x10]
mov ecx, dword [ebp - 0x18]
add eax, dword [ecx + 4]
mov edx, dword [ebp - 0x18]
sub eax, dword [edx + 0xc]
mov dword [ebp - 0xc], eax
mov eax, dword [ebp - 0xc]
cmp eax, dword [ebp - 0x20]
jbe 0x40d52b
mov ecx, dword [ebp - 0x20]
mov dword [ebp - 0xc], ecx
mov edx, dword [ebp - 0x20]
sub edx, dword [ebp - 0xc]
mov dword [ebp - 0x20], edx
je 0x40d565
mov eax, dword [ebp - 0x18]
mov ecx, dword [eax + 0x10]
mov dword [ebp - 8], ecx
mov edx, dword [ebp - 0x18]
mov eax, dword [ebp - 0x18]
mov ecx, dword [edx + 8]
sub ecx, dword [eax + 0x10]
mov dword [ebp - 4], ecx
mov edx, dword [ebp - 4]
cmp edx, dword [ebp - 0x20]
jbe 0x40d55c
mov eax, dword [ebp - 0x20]
mov dword [ebp - 4], eax
mov dword [ebp - 0x14], 2
jmp 0x40d56c
mov dword [ebp - 0x14], 1
push 0
mov ecx, dword [ebp - 0xc]
push ecx
mov edx, dword [ebp - 0x10]
push edx
mov eax, dword [ebp + 8]
mov ecx, dword [eax + 8]
push ecx
call dword [sym.imp.WS2_32.dll_send]
mov dword [ebp - 0x1c], eax
cmp dword [ebp - 0x1c], 0
jge 0x40d5a9
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
cmp eax, 0xb
je 0x40d5a2
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
cmp eax, 4
jne 0x40d5a9
xor eax, eax
jmp 0x40d6d9
cmp dword [ebp - 0x1c], 0
jg 0x40d60d
mov edx, dword [0x42f5cc]
and edx, 2
je 0x40d5ea
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
mov eax, dword [ebp + 8]
mov ecx, dword [eax + 0x27]
push ecx
push str._____sowrite_disconnected__so__so_state___x__errno___d_n
mov edx, dword [0x42f5c8]
push edx
call fcn.00414be4
add esp, 0x10
mov eax, dword [0x42f5c8]
push eax
call fcn.00414b88
add esp, 4
mov ecx, dword [ebp + 8]
push ecx
call fcn.0040e320
add esp, 4
mov edx, dword [ebp + 8]
mov eax, dword [edx + 0x2b]
push eax
call fcn.00411e80
add esp, 4
or eax, 0xffffffff
jmp 0x40d6d9
cmp dword [ebp - 0x14], 2
jne 0x40d644
mov ecx, dword [ebp - 0x1c]
cmp ecx, dword [ebp - 0xc]
jne 0x40d644
push 0
mov edx, dword [ebp - 4]
push edx
mov eax, dword [ebp - 8]
push eax
mov ecx, dword [ebp + 8]
mov edx, dword [ecx + 8]
push edx
call dword [sym.imp.WS2_32.dll_send]
mov dword [ebp - 0x24], eax
cmp dword [ebp - 0x24], 0
jle 0x40d644
mov eax, dword [ebp - 0x1c]
add eax, dword [ebp - 0x24]
mov dword [ebp - 0x1c], eax
mov ecx, dword [0x42f5cc]
and ecx, 2
je 0x40d675
mov edx, dword [ebp - 0x1c]
push edx
push str.__..._wrote_nn___d_bytes_n
mov eax, dword [0x42f5c8]
push eax
call fcn.00414be4
add esp, 0xc
mov ecx, dword [0x42f5c8]
push ecx
call fcn.00414b88
add esp, 4
mov edx, dword [ebp - 0x18]
mov eax, dword [edx]
sub eax, dword [ebp - 0x1c]
mov ecx, dword [ebp - 0x18]
mov dword [ecx], eax
mov edx, dword [ebp - 0x18]
mov eax, dword [edx + 0xc]
add eax, dword [ebp - 0x1c]
mov ecx, dword [ebp - 0x18]
mov dword [ecx + 0xc], eax
mov edx, dword [ebp - 0x18]
mov eax, dword [edx + 0x10]
mov ecx, dword [ebp - 0x18]
add eax, dword [ecx + 4]
mov edx, dword [ebp - 0x18]
cmp dword [edx + 0xc], eax
jb 0x40d6b7
mov eax, dword [ebp - 0x18]
mov ecx, dword [ebp - 0x18]
mov edx, dword [eax + 0xc]
sub edx, dword [ecx + 4]
mov eax, dword [ebp - 0x18]
mov dword [eax + 0xc], edx
mov ecx, dword [ebp + 8]
mov edx, dword [ecx + 0x27]
and edx, 0x40
je 0x40d6d6
mov eax, dword [ebp - 0x18]
cmp dword [eax], 0
jne 0x40d6d6
mov ecx, dword [ebp + 8]
push ecx
call fcn.0040e320
add esp, 4
mov eax, dword [ebp - 0x1c]
mov esp, ebp
pop ebp
ret