Function at 0x4513d0
Capabilities:
Connect socket
Resolve dns
Set socket configuration

Disassembly:
sub esp, 0x1c
push ebx
push ebp
mov ebp, ecx
push esi
mov ecx, dword [esp + 0x30]
xor esi, esi
cmp ecx, esi
push edi
je 0x4516bc
cmp dword [esp + 0x38], esi
je 0x4516bc
mov eax, dword [ebp + 4]
cmp eax, 0xffffffff
je 0x4514c2
push eax
call sub.wsock32.dll_closesocket
mov edi, 0x6dfe28
or ecx, 0xffffffff
xor eax, eax
mov dword [ebp + 4], esi
mov dword [ebp + 8], esi
lea ebx, [ebp + 0xc]
repne scasb al, byte es:[edi]
not ecx
dec ecx
push 1
mov edi, ecx
mov ecx, ebx
push edi
mov dword [esp + 0x1c], edi
call fcn.00403350
test al, al
je 0x451453
mov ecx, edi
mov edi, dword [ebx + 4]
mov eax, ecx
mov esi, 0x6dfe28
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [ebx + 4]
mov dword [ebx + 8], eax
xor esi, esi
mov byte [ecx + eax], 0
mov edx, dword [ebp + 0x4003c]
mov dword [ebp + 0x1c], esi
push edx
mov dword [ebp + 0x40020], esi
mov dword [ebp + 0x40094], 1
mov dword [ebp + 0x40038], esi
call fcn.006713a0
add esp, 4
mov ecx, 0x7d33a0
mov dword [ebp + 0x4003c], esi
call fcn.00671280
push esi
push esi
mov ecx, 0x7d33a0
call fcn.00671240
push 0x12345678
push 0x90123456
mov ecx, 0x7d33a0
call fcn.00671260
mov ecx, dword [esp + 0x34]
mov dword [0x81355c], esi
mov word [0x813560], si
mov dword [0x813558], esi
mov al, byte [ecx]
cmp al, 0x30
jl 0x451500
cmp al, 0x39
jg 0x451500
xor eax, eax
push ecx
mov dword [esp + 0x20], eax
mov word [esp + 0x20], 2
mov dword [esp + 0x24], eax
mov dword [esp + 0x28], eax
mov dword [esp + 0x2c], eax
call sub.wsock32.dll_inet_addr
mov ecx, dword [esp + 0x38]
mov dword [esp + 0x20], eax
push ecx
call sub.wsock32.dll_htons
mov word [esp + 0x1e], ax
jmp 0x451555
push ecx
call sub.wsock32.dll_gethostbyname
cmp eax, esi
je 0x4516bc
xor edx, edx
lea edi, [esp + 0x20]
mov dword [esp + 0x1c], edx
mov dword [esp + 0x20], edx
mov dword [esp + 0x24], edx
mov dword [esp + 0x28], edx
mov edx, dword [eax + 0xc]
movsx ecx, word [eax + 0xa]
mov esi, dword [edx]
mov edx, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [esp + 0x38]
mov ax, word [eax + 8]
push ecx
mov word [esp + 0x20], ax
call sub.wsock32.dll_htons
mov word [esp + 0x1e], ax
xor esi, esi
push esi
push 1
push 2
call sub.wsock32.dll_socket
cmp eax, 1
mov dword [ebp + 4], eax
jae 0x451576
call sub.wsock32.dll_WSAGetLastError
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x1c
ret 0xc
lea edx, [esp + 0x18]
push 4
push edx
push 0x1002
push 0xffff
push eax
mov dword [esp + 0x2c], 0x40000
call sub.wsock32.dll_setsockopt
mov ecx, dword [ebp + 4]
lea eax, [esp + 0x10]
push 4
push eax
push 0x80
push 0xffff
push ecx
mov word [esp + 0x24], 1
mov word [esp + 0x26], si
call sub.wsock32.dll_setsockopt
mov eax, dword [ebp + 4]
lea edx, [esp + 0x1c]
push 0x10
push edx
push eax
call sub.wsock32.dll_connect
test eax, eax
je 0x4515f2
call sub.wsock32.dll_WSAGetLastError
mov ecx, dword [ebp + 4]
mov esi, eax
push ecx
call sub.wsock32.dll_closesocket
mov eax, esi
pop edi
mov dword [ebp + 4], 0xffffffff
pop esi
pop ebp
pop ebx
add esp, 0x1c
ret 0xc
mov esi, dword [esp + 0x30]
mov edx, dword [ebp + 4]
push 0x31
push 0x401
push esi
push edx
call sub.wsock32.dll_WSAAsyncSelect
mov dword [ebp + 8], esi
mov esi, dword [esp + 0x34]
mov edi, esi
or ecx, 0xffffffff
xor eax, eax
lea ebx, [ebp + 0xc]
repne scasb al, byte es:[edi]
not ecx
dec ecx
mov edi, ecx
cmp edi, 0xfffffffd
mov dword [esp + 0x34], edi
jbe 0x45162d
call fcn.006713ab
mov ecx, dword [ebx + 4]
test ecx, ecx
je 0x451652
mov al, byte [ecx - 1]
test al, al
je 0x451652
cmp al, 0xff
je 0x451652
test edi, edi
jne 0x451676
dec al
push edi
mov byte [ecx - 1], al
mov ecx, ebx
call fcn.004031c0
jmp 0x45169f
test edi, edi
jne 0x451661
push 1
mov ecx, ebx
call fcn.004031c0
jmp 0x45169f
mov eax, dword [ebx + 0xc]
cmp eax, 0x1f
ja 0x45166d
cmp eax, edi
jae 0x45167e
push 1
mov ecx, ebx
call fcn.004031c0
push edi
mov ecx, ebx
call fcn.00403480
mov ecx, edi
mov edi, dword [ebx + 4]
mov eax, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
mov eax, dword [esp + 0x34]
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [ebx + 4]
mov dword [ebx + 8], eax
mov byte [ecx + eax], 0
mov edx, dword [esp + 0x38]
pop edi
mov dword [ebp + 0x1c], edx
mov dword [ebp + 0x40020], 1
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x1c
ret 0xc
pop edi
pop esi
pop ebp
or eax, 0xffffffff
pop ebx
add esp, 0x1c
ret 0xc