Function at 0x402be0
Capabilities:
Get socket status
Print debug messages
Receive data
Receive data on socket
Send data
Send data on socket

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x634
mov eax, dword [0x4a3300]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
push edi
push 0x1ff
lea eax, [ebp - 0x207]
mov byte [ebp - 0x208], 0
push 0
push eax
mov esi, ecx
call fcn.00453200
mov ebx, dword [sym.imp.WS2_32.dll_recv]
add esp, 0xc
push 2
push 4
push dword [esi + 0x198]
push dword [esi]
call ebx
test eax, eax
je 0x4031ce
mov edi, dword [sym.imp.WS2_32.dll_WSAGetLastError]
cmp eax, 0xffffffff
jne 0x402c49
call edi
cmp eax, 0x2733
jne 0x4031ce
push 0xff
lea eax, [ebp - 0x407]
mov byte [ebp - 0x408], 0
push 0
push eax
call fcn.00453200
movzx eax, word [esi + 0x62]
add esp, 0xc
push eax
call dword [sym.imp.WS2_32.dll_htons]
movzx eax, ax
push eax
movzx eax, byte [esi + 0x67]
push eax
movzx eax, byte [esi + 0x66]
push eax
movzx eax, byte [esi + 0x65]
push eax
movzx eax, byte [esi + 0x64]
push eax
push dword [esi]
lea eax, [ebp - 0x408]
push 0x4817b4
push eax
call fcn.004582cf
add esp, 0x20
lea eax, [ebp - 0x408]
push eax
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
xor eax, eax
mov dword [ebp - 0x202], 0x2712
mov word [esi + 0x5c], ax
mov eax, 0x9a
mov word [ebp - 0x208], ax
mov eax, dword [esi + 0x68]
mov dword [ebp - 0x1b4], eax
movzx eax, word [esi + 0x100]
push eax
call dword [sym.imp.WS2_32.dll_htons]
movdqu xmm0, xmmword [esi + 0x186]
lea ecx, [esi + 0x186]
mov word [ebp - 0x1b0], ax
mov eax, dword [0x727600]
mov edx, 0x46
movdqu xmmword [ebp - 0x1c4], xmm0
mov dword [ebp - 0x1fe], eax
movdqu xmm0, xmmword [esi + 0xc0]
mov eax, dword [0x727604]
mov dword [ebp - 0x1fa], eax
mov eax, 1
movdqu xmmword [ebp - 0x1ae], xmm0
mov word [ebp - 0x1f6], ax
movdqu xmm0, xmmword [esi + 0xd0]
mov eax, dword [0x727608]
mov dword [ebp - 0x1f4], eax
mov eax, dword [0x72760c]
movdqu xmmword [ebp - 0x19e], xmm0
mov dword [ebp - 0x1f0], eax
movdqu xmm0, xmmword [esi + 0xe0]
mov eax, dword [0x727610]
mov dword [ebp - 0x1ec], eax
mov eax, dword [0x727614]
movdqu xmmword [ebp - 0x18e], xmm0
push ecx
movdqu xmm0, xmmword [esi + 0xf0]
lea ecx, [ebp - 0x1b4]
mov dword [ebp - 0x1e8], eax
movdqu xmmword [ebp - 0x17e], xmm0
movdqu xmm0, xmmword [0x727688]
movdqu xmmword [ebp - 0x1e4], xmm0
movdqu xmm0, xmmword [0x727698]
movdqu xmmword [ebp - 0x1d4], xmm0
call fcn.0040a210
add esp, 4
mov dword [ebp - 0x206], 0
mov edx, 0x9a
lea ecx, [ebp - 0x208]
call fcn.00409ee0
push 0
mov dword [ebp - 0x206], eax
push 0x9a
lea eax, [ebp - 0x208]
push eax
push dword [esi + 8]
call dword [sym.imp.WS2_32.dll_send]
call fcn.00409e10
mov dword [ebp - 0x624], eax
mov dword [ebp - 0x628], edx
call fcn.00409e10
sub eax, dword [ebp - 0x624]
sbb edx, dword [ebp - 0x628]
test edx, edx
jg 0x4031ce
jl 0x402e30
cmp eax, 0x1f4
ja 0x4031ce
lea esp, [esp]
push 0x100
lea eax, [ebp - 0x514]
push 0
push eax
call fcn.00453200
add esp, 0xc
lea eax, [ebp - 0x61c]
push 0x100
push 0
push eax
call fcn.00453200
mov eax, dword [esi + 8]
add esp, 0xc
mov dword [ebp - 0x514], eax
mov dword [ebp - 0x61c], eax
lea eax, [ebp - 0x410]
mov dword [ebp - 0x40c], 0
push eax
lea eax, [ebp - 0x620]
mov dword [ebp - 0x410], 0
push eax
push 0
lea eax, [ebp - 0x518]
mov dword [ebp - 0x40c], 0x64
push eax
push 0
mov dword [ebp - 0x518], 1
mov dword [ebp - 0x620], 1
call dword [sym.imp.WS2_32.dll_select]
push 0
push 0x200
lea eax, [ebp - 0x208]
push eax
push dword [esi + 8]
call ebx
test eax, eax
je 0x4031ce
cmp eax, 0xffffffff
jne 0x402eeb
call edi
cmp eax, 0x2733
jne 0x4031ce
jmp 0x402ef0
cmp eax, 0x60
je 0x402f2f
call fcn.00409e10
sub eax, dword [ebp - 0x624]
sbb edx, dword [ebp - 0x628]
mov dword [ebp - 0x62c], edx
js 0x402e30
jg 0x4031ce
cmp eax, 0x1f4
jbe 0x402e30
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004524fc
mov esp, ebp
pop ebp
ret
lea eax, [esi + 0x186]
mov edx, 0x60
push eax
lea ecx, [ebp - 0x208]
call fcn.0040a210
add esp, 4
test eax, eax
je 0x4031ce
mov edi, dword [ebp - 0x206]
lea ecx, [ebp - 0x208]
mov edx, 0x60
mov dword [ebp - 0x206], 0
mov word [ebp - 0x208], dx
call fcn.00409ee0
cmp edi, eax
jne 0x4031ce
mov di, word [ebp - 0x1f6]
mov eax, 0xc8
mov word [esi + 0x5c], di
cmp di, ax
je 0x403082
push 0xff
lea eax, [ebp - 0x517]
push 0
push eax
call fcn.00453200
movdqu xmm0, xmmword [ebp - 0x1e8]
add esp, 0xc
mov byte [ebp - 0x620], 0
lea eax, [ebp - 0x61f]
movdqu xmmword [ebp - 0x518], xmm0
movdqu xmm0, xmmword [ebp - 0x1d8]
push 0xff
push 0
movdqu xmmword [ebp - 0x508], xmm0
push eax
movdqu xmm0, xmmword [ebp - 0x1c8]
movdqu xmmword [ebp - 0x4f8], xmm0
movdqu xmm0, xmmword [ebp - 0x1b8]
movdqu xmmword [ebp - 0x4e8], xmm0
call fcn.00453200
add esp, 0xc
lea eax, [ebp - 0x518]
push eax
movzx eax, di
push eax
movzx eax, word [esi + 0x62]
push eax
call dword [sym.imp.WS2_32.dll_htons]
movzx eax, ax
push eax
movzx eax, byte [esi + 0x67]
push eax
movzx eax, byte [esi + 0x66]
push eax
movzx eax, byte [esi + 0x65]
push eax
movzx eax, byte [esi + 0x64]
push eax
call fcn.00409e10
sub eax, dword [ebp - 0x624]
sbb edx, dword [ebp - 0x628]
push edx
push eax
push dword [esi]
lea eax, [ebp - 0x620]
push 0x4817e0
push eax
call fcn.004582cf
add esp, 0x30
lea eax, [ebp - 0x620]
push eax
mov eax, dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
call eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004524fc
mov esp, ebp
pop ebp
ret
cmp dword [esi + 4], 0
je 0x4030b5
jmp 0x403090
push 2
push 4
push dword [esi + 0x198]
push dword [esi + 4]
call ebx
cmp eax, 1
jl 0x4030b5
mov ecx, esi
call fcn.004021f0
test eax, eax
je 0x4030b5
cmp dword [esi + 4], 0
jne 0x403090
mov eax, dword [esi + 4]
test eax, eax
je 0x4030ca
push eax
call dword [sym.imp.WS2_32.dll_closesocket]
mov dword [esi + 4], 0
mov ecx, dword [esi + 0x1a8]
mov edx, dword [ebp - 0x1f4]
sub ecx, edx
mov eax, dword [esi + 0x1ac]
mov edi, dword [ebp - 0x1f0]
sbb eax, edi
mov dword [ebp - 0x62c], eax
jne 0x4031c5
cmp ecx, 0x100000
ja 0x4031c5
push dword [ebp - 0x1ea]
mov ebx, dword [sym.imp.WS2_32.dll_htons]
mov dword [esi + 0x1a0], edx
mov dword [esi + 0x1a4], edi
call ebx
mov word [esi + 0x102], ax
call fcn.00409e10
mov dword [esi + 0x1c8], eax
mov dword [esi + 0x1cc], edx
call fcn.00409e10
push 0xff
mov dword [esi + 0x1d0], eax
lea eax, [ebp - 0x307]
push 0
push eax
mov dword [esi + 0x1d4], edx
mov byte [ebp - 0x308], 0
call fcn.00453200
movzx eax, word [esi + 0x62]
add esp, 0xc
push eax
call ebx
movzx eax, ax
push eax
movzx eax, byte [esi + 0x67]
push eax
movzx eax, byte [esi + 0x66]
push eax
movzx eax, byte [esi + 0x65]
push eax
movzx eax, byte [esi + 0x64]
push eax
call fcn.00409e10
sub eax, dword [ebp - 0x624]
sbb edx, dword [ebp - 0x628]
push edx
push eax
push dword [esi]
lea eax, [ebp - 0x308]
push str._DEBUG___u___lld__
push eax
call fcn.004582cf
add esp, 0x28
lea eax, [ebp - 0x308]
push eax
mov eax, dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
call eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004524fc
mov esp, ebp
pop ebp
ret
mov eax, 0x1f4
mov word [esi + 0x5c], ax
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.004524fc
mov esp, ebp
pop ebp
ret