Function at 0x408450
Capabilities:
Connect socket
Receive data
Receive data on socket
Send data
Send data on socket
Set socket configuration

Disassembly:
sub esp, 0x38
mov edx, dword [esp + 0x3c]
xor eax, eax
push ebx
mov dword [esp + 0x2e], eax
push ebp
push esi
mov dword [esp + 0x3a], eax
lea ecx, [esp + 0x10]
push edi
xor ebp, ebp
mov dword [esp + 0x42], eax
push ecx
push edx
mov dword [esp + 0x2c], ebp
mov dword [esp + 0x30], ebp
mov dword [0x430798], ebp
mov word [esp + 0x40], bp
mov word [esp + 0x4e], ax
mov dword [esp + 0x24], ebp
xor edi, edi
mov dword [esp + 0x1c], ebp
mov dword [esp + 0x18], ebp
mov dword [esp + 0x20], ebp
call fcn.00407fb0
add esp, 8
cmp eax, ebp
mov dword [esp + 0x20], eax
je 0x408715
mov eax, dword [esp + 0x14]
mov esi, dword [sym.imp.WS2_32.dll_htons]
push eax
call esi
mov ecx, dword [esp + 0x50]
push 0x35
mov dword [esp + 0x1c], eax
mov dword [esp + 0x40], ecx
mov word [esp + 0x3c], 2
call esi
push ebp
push 1
push 2
mov word [esp + 0x46], ax
call dword [sym.imp.WS2_32.dll_socket]
mov esi, eax
cmp esi, 0xffffffff
je 0x408715
push ebp
push ebp
push 1
push ebp
call dword [sym.imp.KERNEL32.DLL_CreateEventA]
mov ebx, eax
cmp ebx, ebp
je 0x4087bb
push 0x10
push ebx
push esi
call dword [sym.imp.WS2_32.dll_WSAEventSelect]
cmp eax, 0xffffffff
je 0x4087bb
lea edx, [esp + 0x38]
push 0x10
push edx
push esi
call dword [sym.imp.WS2_32.dll_connect]
cmp eax, 0xffffffff
jne 0x40853a
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
cmp eax, 0x2733
jne 0x4087bb
mov eax, dword [esp + 0x54]
push eax
push ebx
call dword [sym.imp.KERNEL32.DLL_WaitForSingleObject]
test eax, eax
jne 0x4087bb
push ebp
push ebx
push esi
call dword [sym.imp.WS2_32.dll_WSAEventSelect]
cmp eax, 0xffffffff
je 0x4087bb
lea ecx, [esp + 0x1c]
push ecx
push 0x8004667e
push esi
call dword [sym.imp.WS2_32.dll_ioctlsocket]
cmp eax, 0xffffffff
je 0x4087bb
push ebx
call dword [sym.imp.KERNEL32.DLL_ResetEvent]
test eax, eax
je 0x4087bb
push ebp
mov ebp, dword [sym.imp.WS2_32.dll_send]
lea edx, [esp + 0x1c]
push 2
push edx
push esi
call ebp
cmp eax, 2
jne 0x4087b9
mov eax, dword [esp + 0x14]
mov ecx, dword [esp + 0x20]
and eax, 0xffff
push 0
push eax
push ecx
push esi
call ebp
mov edx, dword [esp + 0x14]
and edx, 0xffff
cmp eax, edx
jne 0x4087b9
push 1
push ebx
push esi
call dword [sym.imp.WS2_32.dll_WSAEventSelect]
cmp eax, 0xffffffff
je 0x4087b9
mov ebp, dword [sym.imp.WS2_32.dll_recv]
push 0
lea eax, [esp + 0x14]
push 2
push eax
push esi
call ebp
cmp eax, 2
je 0x40861a
mov ecx, dword [esp + 0x54]
push ecx
push ebx
call fcn.00408400
add esp, 8
test al, al
je 0x40861a
push 0
lea edx, [esp + 0x14]
push 2
push edx
push esi
call ebp
cmp eax, 2
jne 0x4087b9
mov eax, dword [esp + 0x10]
push eax
call dword [sym.imp.WS2_32.dll_htons]
mov dword [esp + 0x10], eax
and eax, 0xffff
push eax
call fcn.00409797
mov edi, eax
add esp, 4
test edi, edi
je 0x4087b9
mov ecx, dword [esp + 0x10]
push 0
and ecx, 0xffff
push ecx
push edi
push esi
call ebp
mov edx, dword [esp + 0x10]
and edx, 0xffff
cmp eax, edx
je 0x408695
mov eax, dword [esp + 0x54]
push eax
push ebx
call fcn.00408400
add esp, 8
test al, al
je 0x408695
mov ecx, dword [esp + 0x10]
push 0
and ecx, 0xffff
push ecx
push edi
push esi
call ebp
mov edx, dword [esp + 0x10]
and edx, 0xffff
cmp eax, edx
jne 0x4087b9
push ebx
call dword [sym.imp.KERNEL32.DLL_CloseHandle]
push esi
call dword [sym.imp.WS2_32.dll_closesocket]
or ecx, 0xffffffff
lea eax, [edi + 1]
sub ecx, edi
mov bl, byte [eax]
mov dl, byte [eax - 1]
mov byte [eax - 1], bl
mov byte [eax], dl
add eax, 2
lea edx, [ecx + eax]
cmp edx, 0xc
jb 0x4086ab
mov eax, edi
push 0
mov esi, dword [eax]
mov ecx, dword [eax + 4]
mov dword [esp + 0x34], ecx
mov ebx, dword [eax + 8]
mov dword [esp + 0x38], ebx
call fcn.00407f70
add esp, 4
cmp si, ax
jne 0x408706
mov esi, dword [esp + 0x32]
test si, si
je 0x408725
and esi, 0xffff
push esi
push edi
call fcn.00408350
add esp, 8
mov dword [esp + 0x28], eax
test eax, eax
je 0x408706
mov dword [esp + 0x24], esi
xor ebp, ebp
cmp edi, ebp
je 0x408715
push edi
call fcn.0040a490
add esp, 4
mov eax, dword [esp + 0x24]
mov edx, dword [esp + 0x28]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x38
ret
test bx, bx
je 0x408706
and ebx, 0xffff
push ebx
push edi
call fcn.00408350
mov ebp, eax
add esp, 8
test ebp, ebp
je 0x408706
push edi
call fcn.0040a490
add esp, 4
xor edi, edi
test ebx, ebx
jle 0x4087a0
lea esi, [ebp + 0x102]
mov eax, dword [esp + 0x28]
test eax, eax
jne 0x4087a0
cmp word [esi - 2], 2
jne 0x408795
cmp word [esi], 1
jne 0x408795
lea edx, [esi + 0xc]
push edx
call fcn.004083e0
add esp, 4
test eax, eax
je 0x408795
mov ecx, dword [esp + 0x54]
mov edx, dword [esp + 0x4c]
push ecx
push eax
push edx
call fcn.00408450
add esp, 0xc
mov dword [esp + 0x24], eax
mov dword [esp + 0x28], edx
inc edi
add esi, 0x210
cmp edi, ebx
jl 0x408755
push ebp
call fcn.00409bde
mov eax, dword [esp + 0x28]
mov edx, dword [esp + 0x2c]
add esp, 4
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x38
ret
xor ebp, ebp
push esi
call dword [sym.imp.WS2_32.dll_closesocket]
jmp 0x408708