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

Disassembly:
sub esp, 0xc
push ebx
push ebp
mov ebp, dword [esp + 0x20]
xor ebx, ebx
push esi
push edi
mov edi, dword [esp + 0x20]
mov eax, dword [ebp + 0x8c]
lea esi, [ebp + 0x14]
mov dword [esp + 0x10], ebx
mov dword [esp + 0x14], ebx
mov dword [esp + 0x18], eax
test edi, edi
jne 0x40f6f1
mov edi, dword [esi]
test edi, edi
je 0x40f6c0
mov eax, dword [edi + 0x14]
test eax, eax
je 0x40f5d6
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x40f5c2
sub eax, edx
sar eax, 1
lea ebx, [eax + 1]
jmp 0x40f5d8
xor ebx, ebx
mov eax, dword [edi + 4]
cmp eax, 2
jne 0x40f5e5
lea ebp, [eax + 0xe]
jmp 0x40f5f1
cmp eax, 0x17
jne 0x40f6a9
lea ebp, [eax + 5]
cmp dword [edi + 0x18], 0
je 0x40f6a9
mov eax, dword [edi + 0x10]
test eax, eax
je 0x40f6a9
cmp eax, ebp
jb 0x40f6a9
lea eax, [ebp + 0x20]
add eax, ebx
push eax
call dword [section..data]
mov esi, eax
add esp, 4
test esi, esi
je 0x40f6ce
mov ecx, dword [edi]
mov dword [esi], ecx
mov ecx, dword [edi + 4]
mov dword [esi + 4], ecx
mov ecx, dword [edi + 8]
mov dword [esi + 8], ecx
mov eax, dword [edi + 0xc]
mov dword [esi + 0xc], eax
lea eax, [esi + 0x20]
push ebp
mov dword [esi + 0x10], ebp
mov dword [esi + 0x14], 0
mov dword [esi + 0x1c], 0
mov dword [esi + 0x18], eax
push dword [edi + 0x18]
push eax
call sub.VCRUNTIME140.dll_memcpy
add esp, 0xc
test ebx, ebx
je 0x40f68b
mov eax, dword [esi + 0x18]
xor edx, edx
add eax, ebp
mov dword [esi + 0x14], eax
test ebx, ebx
je 0x40f684
mov eax, dword [edi + 0x14]
mov ecx, dword [esi + 0x14]
mov al, byte [eax + edx*2]
mov byte [edx + ecx], al
inc edx
cmp edx, ebx
jb 0x40f673
mov eax, dword [esi + 0x14]
mov byte [ebx + eax], 0
mov ebx, dword [esp + 0x10]
test ebx, ebx
mov eax, dword [esp + 0x14]
cmove ebx, esi
mov dword [esp + 0x10], ebx
test eax, eax
je 0x40f6a3
mov dword [eax + 0x1c], esi
mov dword [esp + 0x14], esi
jmp 0x40f6ad
mov ebx, dword [esp + 0x10]
mov edi, dword [edi + 0x28]
test edi, edi
jne 0x40f5b8
test ebx, ebx
jne 0x40f6e3
mov ebp, dword [esp + 0x28]
mov edi, 0x2af9
push edi
call dword [sym.imp.WS2_32.dll_WSASetLastError]
jmp 0x40f6eb
push dword [esp + 0x10]
mov edi, 8
call fcn.0042e5c0
add esp, 4
xor ebx, ebx
jmp 0x40f6e7
mov edi, dword [esp + 0x20]
mov ebp, dword [esp + 0x28]
mov dword [ebp + 0x68], ebx
lea esi, [ebp + 0x14]
mov eax, dword [esi]
test eax, eax
je 0x40f704
push eax
call dword [0x4767a0]
mov dword [esi], 0
mov esi, dword [sym.imp.WS2_32.dll_WSAGetLastError]
test edi, edi
je 0x40f729
call esi
test eax, eax
je 0x40f726
call esi
mov dword [ebp + 0x64], eax
test eax, eax
jne 0x40f729
mov dword [ebp + 0x64], 8
jmp 0x40f729
mov dword [ebp + 0x64], edi
push dword [ebp + 0x48]
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
cmp dword [ebp + 0x4c], 0
je 0x40f7ab
push dword [ebp + 0x48]
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov eax, dword [ebp + 0x48]
test eax, eax
je 0x40f75b
push eax
call dword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
push dword [ebp + 0x48]
call dword [0x476004]
add esp, 4
push dword [ebp + 0x54]
call dword [0x476004]
mov eax, dword [ebp + 0x68]
add esp, 4
test eax, eax
je 0x40f777
push eax
call fcn.0042e5c0
add esp, 4
mov eax, dword [ebp + 0x60]
cmp eax, 0xffffffff
je 0x40f786
push eax
call dword [sym.imp.WS2_32.dll_closesocket]
push 0x90
push 0
push ebp
call sub.VCRUNTIME140.dll_memset
mov ecx, dword [esp + 0x24]
push ecx
call dword [0x476004]
add esp, 0x10
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xc
ret 0xc
mov eax, dword [ebp + 0x60]
cmp eax, 0xffffffff
je 0x40f7d1
push 0
push 1
lea ecx, [esp + 0x30]
mov byte [esp + 0x30], 1
push ecx
push eax
call dword [sym.imp.WS2_32.dll_send]
test eax, eax
jns 0x40f7d1
call esi
mov dword [ebp + 0x64], eax
push dword [ebp + 0x48]
mov dword [ebp + 0x4c], 1
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov ecx, dword [esp + 0x18]
mov eax, dword [ecx]
test eax, eax
je 0x40f7f2
push eax
call dword [sym.imp.KERNEL32.dll_SetEvent]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xc
ret 0xc