Function at 0x40366c
Capabilities:
Receive data
Receive data on socket
Send data
Send data on socket

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x43c
mov byte [ebp - 0x41c], 5
mov byte [ebp - 0x41b], 1
mov eax, dword [ebp + 0x14]
cmp byte [eax], 1
sbb eax, eax
not eax
and eax, 2
mov byte [ebp - 0x41a], al
mov dword [esp + 0xc], 0
mov dword [esp + 8], 3
lea eax, [ebp - 0x41c]
mov dword [esp + 4], eax
mov edx, dword [ebp + 8]
mov dword [esp], edx
call sub.WS2_32.dll_send
sub esp, 0x10
movzx edx, byte [ebp - 0x41b]
add edx, 2
cmp eax, edx
je 0x4036d4
jmp 0x40384b
mov dword [esp + 8], 2
mov dword [esp + 4], 0
lea ebx, [ebp - 0x41e]
mov dword [esp], ebx
call fcn.00409bfc
mov dword [esp + 0xc], 0
mov dword [esp + 8], 2
mov dword [esp + 4], ebx
mov edx, dword [ebp + 8]
mov dword [esp], edx
call sub.WS2_32.dll_recv
sub esp, 0x10
cmp eax, 2
jne 0x40384b
cmp byte [ebp - 0x41e], 5
jne 0x40384b
mov al, byte [ebp - 0x41d]
cmp al, 0xff
je 0x40384b
cmp al, 2
jne 0x403852
mov dword [esp + 8], 2
mov dword [esp + 4], 0
mov dword [esp], ebx
call fcn.00409bfc
or esi, 0xffffffff
xor eax, eax
mov ecx, esi
mov edi, dword [ebp + 0x14]
repne scasb al, byte es:[edi]
not ecx
lea edx, [ecx - 1]
mov ecx, esi
mov edi, dword [ebp + 0x18]
repne scasb al, byte es:[edi]
not ecx
dec ecx
mov dword [ebp - 0x42c], ecx
movzx edi, dl
movzx eax, cl
lea ecx, [edi + eax]
cmp ecx, 0x1fe
je 0x40384b
mov byte [ebp - 0x218], 1
mov byte [ebp - 0x217], dl
mov dword [esp + 8], edi
mov edx, dword [ebp + 0x14]
mov dword [esp + 4], edx
lea esi, [ebp - 0x218]
lea edx, [ebp - 0x216]
mov dword [esp], edx
mov dword [ebp - 0x434], eax
mov dword [ebp - 0x430], ecx
call fcn.00409cc0
mov dl, byte [ebp - 0x42c]
mov byte [ebp + edi - 0x216], dl
mov eax, dword [ebp - 0x434]
mov dword [esp + 8], eax
mov eax, dword [ebp + 0x18]
mov dword [esp + 4], eax
lea eax, [esi + edi + 3]
mov dword [esp], eax
call fcn.00409cc0
mov ecx, dword [ebp - 0x430]
lea edi, [ecx + 3]
mov dword [esp + 0xc], 0
mov dword [esp + 8], edi
mov dword [esp + 4], esi
mov edx, dword [ebp + 8]
mov dword [esp], edx
call sub.WS2_32.dll_send
sub esp, 0x10
cmp eax, edi
jne 0x40384b
mov dword [esp + 0xc], 0
mov dword [esp + 8], 2
mov dword [esp + 4], ebx
mov edx, dword [ebp + 8]
mov dword [esp], edx
call sub.WS2_32.dll_recv
sub esp, 0x10
cmp eax, 2
jne 0x40384b
cmp byte [ebp - 0x41d], 0
je 0x403852
xor eax, eax
jmp 0x403946
xor eax, eax
or ecx, 0xffffffff
mov edi, dword [ebp + 0xc]
repne scasb al, byte es:[edi]
not ecx
dec ecx
movzx ebx, cl
mov byte [ebp - 0x418], 5
mov byte [ebp - 0x417], 1
mov byte [ebp - 0x416], 0
mov byte [ebp - 0x415], 3
mov byte [ebp - 0x414], cl
mov dword [esp + 8], ebx
mov eax, dword [ebp + 0xc]
mov dword [esp + 4], eax
lea esi, [ebp - 0x418]
lea eax, [ebp - 0x413]
mov dword [esp], eax
call fcn.00409cc0
movzx eax, word [ebp + 0x10]
mov dword [esp], eax
call sub.WS2_32.dll_htons
push ecx
mov word [ebp - 0x420], ax
mov dword [esp + 8], 2
lea eax, [ebp - 0x420]
mov dword [esp + 4], eax
lea eax, [esi + ebx + 5]
mov dword [esp], eax
call fcn.00409cc0
add ebx, 7
mov dword [esp + 0xc], 0
mov dword [esp + 8], ebx
mov dword [esp + 4], esi
mov edx, dword [ebp + 8]
mov dword [esp], edx
call sub.WS2_32.dll_send
sub esp, 0x10
cmp eax, ebx
jne 0x40384b
mov dword [esp + 0xc], 0
mov dword [esp + 8], eax
lea eax, [ebp - 0x218]
mov dword [esp + 4], eax
mov edx, dword [ebp + 8]
mov dword [esp], edx
call sub.WS2_32.dll_recv
sub esp, 0x10
test eax, eax
js 0x40384b
cmp byte [ebp - 0x218], 5
je 0x403941
xor eax, eax
cmp byte [ebp - 0x217], 0
sete al
jmp 0x403946
mov eax, 1
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret