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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x23c
mov dword [ebp - 0x14], 0xffffffff
push 0
push 1
lea eax, [ebp - 0x21]
push eax
mov ecx, dword [ebp + 8]
push ecx
call dword [sym.imp.WS2_32.dll_recv]
cmp eax, 1
je 0x402ccf
or eax, 0xffffffff
jmp 0x402f81
push 0
push 1
lea edx, [ebp - 1]
push edx
mov eax, dword [ebp + 8]
push eax
call dword [sym.imp.WS2_32.dll_recv]
cmp eax, 1
je 0x402cee
or eax, 0xffffffff
jmp 0x402f81
movzx ecx, byte [ebp - 1]
push ecx
lea edx, [ebp - 0x23c]
push edx
mov eax, dword [ebp + 8]
push eax
call fcn.00401b70
add esp, 0xc
mov dword [ebp - 0x34], eax
movzx ecx, byte [ebp - 1]
cmp dword [ebp - 0x34], ecx
je 0x402d1a
or eax, 0xffffffff
jmp 0x402f81
cmp dword [ebp + 0xc], 0
jne 0x402d56
mov edx, 1
imul edx, edx, 0
mov byte [ebp + edx - 8], 5
mov eax, 1
shl eax, 0
mov byte [ebp + eax - 8], 0
push 0
push 2
lea ecx, [ebp - 8]
push ecx
mov edx, dword [ebp + 8]
push edx
call dword [sym.imp.WS2_32.dll_send]
jmp 0x402ddb
mov dword [ebp - 0x18], 0
movzx eax, byte [ebp - 1]
test eax, eax
ja 0x402d99
mov ecx, 1
imul ecx, ecx, 0
mov byte [ebp + ecx - 8], 5
mov edx, 1
shl edx, 0
mov byte [ebp + edx - 8], 0xff
push 0
push 2
lea eax, [ebp - 8]
push eax
mov ecx, dword [ebp + 8]
push ecx
call dword [sym.imp.WS2_32.dll_send]
or eax, 0xffffffff
jmp 0x402f81
mov edx, dword [ebp - 0x18]
movzx eax, byte [ebp + edx - 0x23c]
cmp eax, 2
je 0x402dbf
mov ecx, dword [ebp - 0x18]
add ecx, 1
mov dword [ebp - 0x18], ecx
movzx edx, byte [ebp - 1]
cmp dword [ebp - 0x18], edx
jb 0x402dbd
jmp 0x402d65
jmp 0x402d99
mov eax, dword [ebp + 0x10]
push eax
mov ecx, dword [ebp + 8]
push ecx
call fcn.00402b00
add esp, 8
test eax, eax
jne 0x402ddb
or eax, 0xffffffff
jmp 0x402f81
push 0
push 0x104
lea edx, [ebp - 0x138]
push edx
mov eax, dword [ebp + 8]
push eax
call dword [sym.imp.WS2_32.dll_recv]
mov dword [ebp - 0x30], eax
cmp dword [ebp - 0x30], 6
jge 0x402e00
jmp 0x402e5a
mov ecx, 1
imul ecx, ecx, 3
movsx edx, byte [ebp + ecx - 0x138]
cmp edx, 3
je 0x402e76
mov eax, 1
imul eax, eax, 3
movsx ecx, byte [ebp + eax - 0x138]
cmp ecx, 1
jne 0x402e5a
mov edx, 1
shl edx, 3
mov ax, word [ebp + edx - 0x138]
mov word [ebp - 0x10], ax
mov ecx, 1
shl ecx, 2
mov edx, dword [ebp + ecx - 0x138]
mov dword [ebp - 0x1c], edx
jmp 0x402edd
mov ax, word [ebp - 0x14]
mov word [ebp - 0x10], ax
mov ecx, 1
shl ecx, 0
mov byte [ebp + ecx - 0x138], 0
jmp 0x402edd
mov edx, 1
shl edx, 2
movzx eax, byte [ebp + edx - 0x138]
lea ecx, [ebp + eax - 0x133]
mov dword [ebp - 0x20], ecx
mov edx, dword [ebp - 0x20]
mov ax, word [edx]
mov word [ebp - 0x10], ax
mov ecx, dword [ebp - 0x20]
mov dl, byte [ecx]
mov byte [ebp - 9], dl
mov eax, dword [ebp - 0x20]
mov byte [eax], 0
mov ecx, 1
imul ecx, ecx, 5
lea edx, [ebp + ecx - 0x138]
push edx
call fcn.00401bc0
add esp, 4
mov dword [ebp - 0x1c], eax
mov eax, 1
shl eax, 2
movzx ecx, byte [ebp + eax - 0x138]
mov dl, byte [ebp - 9]
mov byte [ebp + ecx - 0x133], dl
mov eax, 1
shl eax, 0
movsx ecx, byte [ebp + eax - 0x138]
cmp ecx, 1
jne 0x402f57
cmp dword [ebp - 0x1c], 0xffffffff
jne 0x402f0a
mov edx, 1
shl edx, 0
mov byte [ebp + edx - 0x138], 4
jmp 0x402f55
movzx eax, word [ebp - 0x10]
push eax
call dword [sym.imp.WS2_32.dll_htons]
mov word [ebp - 0x28], ax
movzx ecx, word [ebp - 0x28]
push ecx
mov edx, dword [ebp - 0x1c]
push edx
call fcn.00401170
add esp, 8
mov dword [ebp - 0x14], eax
cmp dword [ebp - 0x14], 0xffffffff
je 0x402f3c
mov dword [ebp - 0x2c], 0
jmp 0x402f43
mov dword [ebp - 0x2c], 4
mov eax, 1
shl eax, 0
mov cl, byte [ebp - 0x2c]
mov byte [ebp + eax - 0x138], cl
jmp 0x402f67
mov edx, 1
shl edx, 0
mov byte [ebp + edx - 0x138], 7
push 0
mov eax, dword [ebp - 0x30]
push eax
lea ecx, [ebp - 0x138]
push ecx
mov edx, dword [ebp + 8]
push edx
call dword [sym.imp.WS2_32.dll_send]
mov eax, dword [ebp - 0x14]
mov esp, ebp
pop ebp
ret