Function at 0x487684
Capabilities:
Connect socket

Disassembly:
push ebp
mov ebp, esp
add esp, 0xffffffe0
mov dword [ebp - 0xc], ecx
mov dword [ebp - 8], edx
mov dword [ebp - 4], eax
mov eax, dword [ebp - 0xc]
call fcn.0040569c
xor eax, eax
push ebp
push 0x4878f1
push dword fs:[eax]
mov dword fs:[eax], esp
mov byte [ebp - 0xd], 0
mov eax, dword [ebp - 4]
xor edx, edx
mov dword [eax + 0x54], edx
mov eax, dword [ebp - 4]
add eax, 0x3c
mov edx, dword [0x527e44]
mov ecx, dword [0x486bb8]
call fcn.00406158
mov eax, dword [ebp - 4]
add eax, 0x4c
mov edx, dword [ebp - 0xc]
call fcn.0040523c
mov ax, word [ebp - 8]
mov edx, dword [ebp - 4]
mov word [edx + 0x50], ax
mov eax, dword [ebp - 4]
cmp byte [eax + 0x58], 0
je 0x4876f7
mov eax, dword [ebp - 4]
mov byte [eax + 0x3c], 0
jmp 0x4876fc
call fcn.00486c48
mov eax, dword [ebp - 4]
cmp byte [eax + 0x3c], 0
je 0x48772a
lea edx, [ebp - 0x1c]
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x4c]
call fcn.00486f1c
test al, al
je 0x48772a
mov eax, dword [ebp - 0x1c]
call fcn.00486bec
test al, al
jne 0x48772a
mov eax, dword [ebp - 4]
mov byte [eax + 0x3c], 0
mov eax, dword [ebp - 4]
cmp byte [eax + 0x3c], 0
je 0x487821
lea edx, [ebp - 0x1c]
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x40]
call fcn.00486f1c
test al, al
jne 0x48775c
mov eax, dword [ebp - 4]
mov dword [eax + 0x10], 0xffffffff
mov byte [ebp - 0xd], 0
jmp 0x4878db
mov eax, dword [ebp - 4]
cmp dword [eax + 4], 0
jne 0x48777a
mov eax, dword [ebp - 4]
call fcn.00487900
test al, al
jne 0x48777a
mov byte [ebp - 0xd], 0
jmp 0x4878db
mov eax, dword [ebp - 4]
mov ax, word [eax + 0x44]
push eax
call sub.wsock32.dll_htons
mov word [ebp - 0x1e], ax
mov word [ebp - 0x20], 2
mov eax, dword [ebp - 4]
cmp dword [eax + 0x1c], 0
je 0x4877b4
push 0x30
push 0x400
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x1c]
push eax
mov eax, dword [ebp - 4]
mov eax, dword [eax + 4]
push eax
call sub.wsock32.dll_WSAAsyncSelect
push 0x10
lea eax, [ebp - 0x20]
push eax
mov eax, dword [ebp - 4]
mov eax, dword [eax + 4]
push eax
call sub.wsock32.dll_connect
inc eax
jne 0x4877fc
call sub.wsock32.dll_WSAGetLastError
mov edx, dword [ebp - 4]
mov dword [edx + 0x10], eax
mov eax, dword [ebp - 4]
cmp dword [eax + 0x10], 0x2733
jne 0x4878db
mov eax, dword [ebp - 4]
xor edx, edx
mov dword [eax + 0x10], edx
mov eax, dword [ebp - 4]
mov byte [eax + 8], 2
mov byte [ebp - 0xd], 1
jmp 0x4878db
mov eax, dword [ebp - 4]
call fcn.00487170
test al, al
je 0x487818
mov eax, dword [ebp - 4]
mov byte [eax + 8], 3
mov byte [ebp - 0xd], 1
jmp 0x4878db
mov byte [ebp - 0xd], 0
jmp 0x4878db
lea edx, [ebp - 0x1c]
mov eax, dword [ebp - 0xc]
call fcn.00486f1c
test al, al
jne 0x48783f
mov eax, dword [ebp - 4]
mov dword [eax + 0x10], 0xffffffff
jmp 0x4878db
mov eax, dword [ebp - 4]
cmp dword [eax + 4], 0
jne 0x487858
mov eax, dword [ebp - 4]
call fcn.00487900
test al, al
je 0x4878db
mov ax, word [ebp - 8]
push eax
call sub.wsock32.dll_htons
mov word [ebp - 0x1e], ax
mov word [ebp - 0x20], 2
mov eax, dword [ebp - 4]
cmp dword [eax + 0x1c], 0
je 0x48788f
push 0x30
push 0x400
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x1c]
push eax
mov eax, dword [ebp - 4]
mov eax, dword [eax + 4]
push eax
call sub.wsock32.dll_WSAAsyncSelect
push 0x10
lea eax, [ebp - 0x20]
push eax
mov eax, dword [ebp - 4]
mov eax, dword [eax + 4]
push eax
call sub.wsock32.dll_connect
inc eax
jne 0x4878d0
call sub.wsock32.dll_WSAGetLastError
mov edx, dword [ebp - 4]
mov dword [edx + 0x10], eax
mov eax, dword [ebp - 4]
cmp dword [eax + 0x10], 0x2733
jne 0x4878db
mov eax, dword [ebp - 4]
xor edx, edx
mov dword [eax + 0x10], edx
mov eax, dword [ebp - 4]
mov byte [eax + 8], 2
mov byte [ebp - 0xd], 1
jmp 0x4878db
mov eax, dword [ebp - 4]
mov byte [eax + 8], 3
mov byte [ebp - 0xd], 1
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x4878f8
lea eax, [ebp - 0xc]
call fcn.004051e8
ret