Function at 0x4a864d
Capabilities:
Connect socket
Get socket status
Resolve dns
Set socket configuration

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x4020
call fcn.004bb490
push ebx
push esi
mov esi, ecx
xor ebx, ebx
push edi
cmp dword [esi + 0x2028], ebx
je 0x4a8687
push 0x36
push 0x51f674
push 0x51f658
push 0x50a2a4
push 0x508530
call fcn.00401466
add esp, 0x14
push 0x10
push dword [ebp + 8]
push esi
call fcn.004b2bcb
mov eax, dword [ebp + 0xc]
add esp, 0xc
mov dword [esi + 0x10], eax
mov eax, dword [ebp + 0x14]
mov dword [esi + 0x14], eax
mov eax, dword [ebp + 0x18]
mov ecx, esi
mov dword [esi + 0x18], eax
call fcn.004a8ee7
test al, al
jne 0x4a8945
cmp dword [esi + 0x2028], ebx
je 0x4a86c8
cmp dword [esi + 0x1c], 0xffffffff
jne 0x4a8880
cmp byte [esi + 0x202c], 0
je 0x4a86f7
lea eax, [esi + 0x2030]
lea ecx, [eax + 8]
mov dword [eax + 4], ebx
mov dword [eax], ebx
call fcn.004a8f2b
lea eax, [esi + 0x2238]
lea ecx, [eax + 8]
mov dword [eax + 4], ebx
mov dword [eax], ebx
call fcn.004a8f2b
cmp dword [esi + 0x1c], 0xffffffff
je 0x4a871b
push 0x49
push 0x51f674
push 0x51f63c
push 0x50a2a4
push 0x508530
call fcn.00401466
add esp, 0x14
push ebx
push 1
pop edi
push edi
push 2
call dword [sym.imp.ws2_32.dll_socket]
cmp eax, 0xffffffff
mov dword [esi + 0x1c], eax
jne 0x4a8737
push 0x51f624
jmp 0x4a8767
lea ecx, [ebp + 8]
mov dword [esi + 0x1020], ebx
push 4
push ecx
mov ebx, 0xffff
push 8
mov dword [ebp + 8], edi
mov edi, dword [sym.imp.ws2_32.dll_setsockopt]
push ebx
push eax
call edi
test eax, eax
je 0x4a8776
mov ecx, esi
call fcn.004a8d76
push 0x51e47c
call fcn.00401466
pop ecx
xor al, al
pop edi
pop esi
pop ebx
leave
ret 0x14
mov eax, dword [esi + 0x14]
test eax, eax
mov dword [ebp + 8], eax
je 0x4a87ad
lea eax, [ebp + 8]
push 4
push eax
push 0x1001
push ebx
push dword [esi + 0x1c]
call edi
test eax, eax
je 0x4a87ad
call dword [sym.imp.ws2_32.dll_WSAGetLastError]
push eax
push 0x51e454
call fcn.00401466
pop ecx
pop ecx
jmp 0x4a8918
mov eax, dword [esi + 0x18]
test eax, eax
mov dword [ebp + 8], eax
je 0x4a87da
lea eax, [ebp + 8]
push 4
push eax
push 0x1002
push ebx
push dword [esi + 0x1c]
call edi
test eax, eax
je 0x4a87da
call dword [sym.imp.ws2_32.dll_WSAGetLastError]
push eax
push 0x51e42c
jmp 0x4a87a1
push 1
lea eax, [ebp + 0xc]
pop edi
push eax
push 0x8004667e
push dword [esi + 0x1c]
mov dword [ebp + 0xc], edi
call dword [sym.imp.ws2_32.dll_ioctlsocket]
test eax, eax
je 0x4a87fd
push 0x51f608
jmp 0x4a881b
push esi
call dword [sym.imp.ws2_32.dll_inet_addr]
mov ebx, eax
cmp ebx, 0xffffffff
jne 0x4a8829
push esi
call dword [sym.imp.ws2_32.dll_gethostbyname]
test eax, eax
jne 0x4a8822
push 0x51f5f4
call fcn.00401466
jmp 0x4a87a7
mov eax, dword [eax + 0xc]
mov eax, dword [eax]
mov ebx, dword [eax]
push 0
lea eax, [ebp - 0x18]
push 0x10
push eax
call fcn.004bb4c0
mov ax, word [esi + 0x10]
add esp, 0xc
mov word [ebp - 0x18], 2
push eax
call dword [sym.imp.ws2_32.dll_htons]
mov word [ebp - 0x16], ax
lea eax, [ebp - 0x18]
push 0x10
push eax
push dword [esi + 0x1c]
mov dword [ebp - 0x14], ebx
call dword [sym.imp.ws2_32.dll_connect]
cmp eax, 0xffffffff
jne 0x4a8876
call dword [sym.imp.ws2_32.dll_WSAGetLastError]
cmp eax, 0x2733
jne 0x4a8918
mov dword [esi + 0x2028], edi
xor ebx, ebx
jmp 0x4a8883
push 1
pop edi
cmp dword [esi + 0x1c], 0xffffffff
je 0x4a8918
cmp dword [esi + 0x2028], edi
je 0x4a88b6
push 0xa2
push 0x51f674
push 0x51f5d8
push 0x50a2a4
push 0x508530
call fcn.00401466
add esp, 0x14
mov eax, dword [ebp + 0x10]
mov dword [ebp - 4], ebx
mov dword [ebp - 8], eax
mov eax, dword [esi + 0x1c]
mov dword [ebp - 0x401c], eax
mov dword [ebp - 0x2018], eax
lea eax, [ebp - 8]
mov dword [ebp - 0x4020], edi
push eax
lea eax, [ebp - 0x201c]
push eax
lea eax, [ebp - 0x4020]
push eax
push ebx
push 0x800
mov dword [ebp - 0x201c], edi
call dword [sym.imp.ws2_32.dll_select]
cmp eax, 0xffffffff
je 0x4a8918
cmp eax, ebx
jle 0x4a876d
lea eax, [ebp - 0x201c]
push eax
push dword [esi + 0x1c]
call sub.ws2_32.dll___WSAFDIsSet
test eax, eax
je 0x4a8924
mov ecx, esi
call fcn.004a8d76
jmp 0x4a876d
lea eax, [ebp - 0x4020]
push eax
push dword [esi + 0x1c]
call sub.ws2_32.dll___WSAFDIsSet
test eax, eax
je 0x4a876d
mov dword [esi + 0x2028], 2
mov al, 1
jmp 0x4a876f