Function at 0x4e0260
Capabilities:
Act as tcp client
Connect socket
Connect tcp socket
Create tcp socket
Get socket status
Resolve dns
Set socket configuration

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x248
mov dword [ebp - 0x34], 0
mov dword [ebp - 0x30], 0
mov dword [ebp - 0x2c], 0
mov dword [ebp - 0x28], 0
mov esi, edx
push eax
call sub.WSOCK32.DLL_gethostbyname
add esp, 0xc
mov ebx, eax
test eax, eax
je 0x4e053f
mov eax, dword [eax + 0xc]
mov edx, dword [eax]
test edx, edx
je 0x4e043c
cmp word [ebx + 8], 2
jne 0x4e043c
mov ax, word [ebx + 0xa]
cmp ax, 4
ja 0x4e0509
and esi, 0xffff
mov dword [ebp - 0x240], 4
mov dword [ebp - 0x244], esi
jmp 0x4e03d0
mov dword [ebp - 0x18], 1
push ecx
lea ecx, [ebp - 0x18]
push ecx
push 0x8004667e
push eax
call sub.WSOCK32.DLL_ioctlsocket
inc eax
setne al
and eax, 0xff
dec eax
mov dword [ebp - 0x14], eax
lea eax, [ebp - 0x34]
push 0x10
push eax
push edi
call sub.WSOCK32.DLL_connect
pop edx
inc eax
je 0x4e04e0
sub esp, 0xc
lea ecx, [ebp - 0x24]
lea eax, [ebp - 0x23c]
mov dword [ebp - 0x24], 0x3c
mov dword [ebp - 0x20], 0
mov dword [ebp - 0x134], edi
mov dword [ebp - 0x138], 1
mov dword [ebp - 0x238], edi
mov dword [ebp - 0x23c], 1
lea esi, [ebp - 0x138]
push ecx
push eax
lea eax, [edi + 1]
push esi
push 0
push eax
call sub.WSOCK32.DLL_select
add esp, 0xc
cmp eax, 0xffffffff
je 0x4e04d5
test eax, eax
jne 0x4e0450
push eax
push str.Connect_attempt_timed_out
push 0
push 0xa
call fcn.0048db10
mov dword [esp], edi
call sub.WSOCK32.DLL_closesocket
add esp, 0xc
mov eax, dword [ebx + 0xc]
mov ecx, dword [ebp - 0x240]
mov edx, dword [eax + ecx]
test edx, edx
je 0x4e043c
cmp word [ebx + 8], 2
jne 0x4e043c
mov esi, dword [ebp - 0x240]
mov ax, word [ebx + 0xa]
add esi, 4
cmp ax, 4
mov dword [ebp - 0x240], esi
ja 0x4e0509
cwde
push ecx
push eax
lea eax, [ebp - 0x10]
push edx
push eax
call sub.msvcrt.dll_memcpy
mov eax, dword [ebx + 8]
mov word [ebp - 0x34], ax
mov eax, dword [ebp - 0x10]
mov dword [ebp - 0x30], eax
pop eax
mov eax, dword [ebp - 0x244]
push eax
call sub.WSOCK32.DLL_htons
mov word [ebp - 0x32], ax
push edi
push edi
push 6
push 1
push 2
call sub.WSOCK32.DLL_socket
add esp, 0x14
mov edi, eax
cmp eax, 0xffffffff
jne 0x4e02e0
push esi
push str.socket_failed_n
push 0
push 0xa
call fcn.0048db10
mov eax, dword [ebx + 0xc]
mov ecx, dword [ebp - 0x240]
add esp, 0x10
mov edx, dword [eax + ecx]
test edx, edx
jne 0x4e03a8
or edi, 0xffffffff
lea esp, [ebp - 0xc]
mov eax, edi
pop ebx
pop esi
pop edi
pop ebp
ret
push eax
push eax
push esi
push edi
call sub.WSOCK32.DLL___WSAFDIsSet
pop edx
test eax, eax
pop ecx
jne 0x4e0478
lea ecx, [ebp - 0x23c]
push esi
push esi
push ecx
push edi
call sub.WSOCK32.DLL___WSAFDIsSet
pop edx
test eax, eax
pop ecx
je 0x4e04fe
sub esp, 0xc
mov dword [ebp - 0x1c], 4
lea eax, [ebp - 0x1c]
lea edx, [ebp - 0x14]
push eax
push edx
push 0x1007
push 0xffff
push edi
call sub.WSOCK32.DLL_getsockopt
add esp, 0xc
test eax, eax
js 0x4e0528
mov eax, dword [ebp - 0x14]
test eax, eax
je 0x4e043f
push eax
push str.Error_connecting_to_remote_host
push 0
push 0xa
call fcn.0048db10
mov dword [esp], edi
call sub.WSOCK32.DLL_closesocket
add esp, 0xc
call sub.msvcrt.dll__errno
mov edx, dword [ebp - 0x14]
mov dword [eax], edx
jmp 0x4e0394
push eax
push str.Connect_failed
jmp 0x4e0380
call fcn.004dfca0
sub eax, 0x2733
cmp eax, 1
jbe 0x4e0318
push eax
push str.error_connecting_to_HTTP_server
jmp 0x4e0380
push eax
push str.select_failed_n
jmp 0x4e0380
push ebx
push str.address_size_mismatch_n
push 0
push 0xa
call fcn.0048db10
or edi, 0xffffffff
mov eax, edi
add esp, 0x10
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
push eax
push str.getsockopt_failed_n
push 0
push 0xa
call fcn.0048db10
add esp, 0x10
jmp 0x4e0394
push edi
push str.Failed_to_resolve_host
jmp 0x4e050f