Function at 0x4a07f0
Capabilities:
Act as tcp client
Connect socket
Connect tcp socket
Connect udp socket
Create tcp socket
Create udp socket
Get socket status
Set socket configuration

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x158
mov eax, dword [0x58b7c8]
xor eax, ebp
mov dword [ebp - 0x18], eax
mov dword [ebp - 0x10], 0xffffffff
mov dword [ebp - 4], 0
mov eax, dword [ebp + 8]
mov ecx, dword [eax + 0xc]
mov dword [ebp - 0xc], ecx
mov edx, dword [ebp + 8]
push edx
call fcn.004a0da0
add esp, 4
mov eax, dword [ebp + 8]
mov dword [eax + 8], 0
push 4
push 0
lea ecx, [ebp - 0x14]
push ecx
call sub.MSVCR90.dll_memset
add esp, 0xc
mov edx, dword [ebp + 0xc]
push edx
call dword [sym.imp.WSOCK32.dll_inet_addr]
mov dword [ebp - 0x14], eax
cmp dword [ebp - 0x14], 0
jae 0x4a0865
call fcn.004a0d00
mov ecx, dword [ebp + 8]
mov dword [ecx + 8], eax
xor eax, eax
jmp 0x4a0ba9
push 0x576708
call dword [sym.imp.WSOCK32.dll_getprotobyname]
mov dword [ebp - 8], eax
push 0x10
push 0
lea edx, [ebp - 0x28]
push edx
call sub.MSVCR90.dll_memset
add esp, 0xc
mov ax, word [ebp + 0x10]
push eax
call dword [sym.imp.WSOCK32.dll_htons]
mov word [ebp - 0x26], ax
mov word [ebp - 0x28], 2
push 4
lea ecx, [ebp - 0x14]
push ecx
lea edx, [ebp - 0x24]
push edx
call sub.MSVCR90.dll_memcpy
add esp, 0xc
cmp dword [ebp - 8], 0
jne 0x4a08c4
push 0
push 1
push 2
call dword [sym.imp.WSOCK32.dll_socket]
mov ecx, dword [ebp + 8]
mov dword [ecx + 4], eax
jmp 0x4a08dc
mov edx, dword [ebp - 8]
movsx eax, word [edx + 8]
push eax
push 1
push 2
call dword [sym.imp.WSOCK32.dll_socket]
mov ecx, dword [ebp + 8]
mov dword [ecx + 4], eax
mov edx, dword [ebp + 8]
cmp dword [edx + 4], 0
jge 0x4a08f7
call fcn.004a0d00
mov ecx, dword [ebp + 8]
mov dword [ecx + 8], eax
xor eax, eax
jmp 0x4a0ba9
cmp dword [ebp + 0x14], 0
je 0x4a0907
mov edx, dword [ebp + 8]
mov dword [edx + 0xc], 1
mov eax, dword [ebp + 8]
push eax
call fcn.004a0fb0
add esp, 4
push 0x10
lea ecx, [ebp - 0x28]
push ecx
mov edx, dword [ebp + 8]
mov eax, dword [edx + 4]
push eax
call dword [sym.imp.WSOCK32.dll_connect]
mov dword [ebp - 0x10], eax
cmp dword [ebp - 0x10], 0
jge 0x4a0955
cmp dword [ebp + 0x14], 0
jne 0x4a0955
call fcn.004a0d00
mov ecx, dword [ebp + 8]
mov dword [ecx + 8], eax
mov eax, dword [ebp + 8]
mov ecx, dword [ebp - 0xc]
mov dword [eax + 0xc], ecx
xor eax, eax
jmp 0x4a0ba9
cmp dword [ebp - 0x10], 0
jge 0x4a0b71
cmp dword [ebp + 0x14], 0
je 0x4a0b71
call fcn.004a0d00
mov dword [ebp - 0x2c], eax
mov dword [ebp - 0x30], 0
mov edx, dword [ebp + 8]
mov eax, dword [ebp - 0x2c]
mov dword [edx + 8], eax
cmp dword [ebp - 0x2c], 0x2734
je 0x4a0997
cmp dword [ebp - 0x2c], 0x2733
jne 0x4a0b5e
mov dword [ebp - 0x140], 0
mov dword [ebp - 0x158], 0
jmp 0x4a09bc
mov ecx, dword [ebp - 0x158]
add ecx, 1
mov dword [ebp - 0x158], ecx
mov edx, dword [ebp - 0x158]
cmp edx, dword [ebp - 0x140]
jae 0x4a09e3
mov eax, dword [ebp - 0x158]
mov ecx, dword [ebp + 8]
mov edx, dword [ebp + eax*4 - 0x13c]
cmp edx, dword [ecx + 4]
jne 0x4a09e1
jmp 0x4a09e3
jmp 0x4a09ad
mov eax, dword [ebp - 0x158]
cmp eax, dword [ebp - 0x140]
jne 0x4a0a1c
cmp dword [ebp - 0x140], 0x40
jae 0x4a0a1c
mov ecx, dword [ebp - 0x158]
mov edx, dword [ebp + 8]
mov eax, dword [edx + 4]
mov dword [ebp + ecx*4 - 0x13c], eax
mov ecx, dword [ebp - 0x140]
add ecx, 1
mov dword [ebp - 0x140], ecx
xor edx, edx
jne 0x4a09a1
mov eax, dword [ebp + 0x14]
cdq
mov ecx, 0xf4240
idiv ecx
mov dword [ebp - 0x150], eax
mov eax, dword [ebp + 0x14]
cdq
mov ecx, 0xf4240
idiv ecx
mov dword [ebp - 0x14c], edx
push 0
call fcn.004a0bc0
add esp, 4
mov dword [ebp - 0x38], eax
mov dword [ebp - 0x34], edx
mov dword [ebp - 0x144], 0
mov eax, dword [ebp + 0x14]
cdq
mov ecx, 0xf4240
idiv ecx
mov dword [ebp - 0x154], eax
mov edx, 1
test edx, edx
je 0x4a0b22
lea eax, [ebp - 0x150]
push eax
push 0
lea ecx, [ebp - 0x140]
push ecx
push 0
mov edx, dword [ebp + 8]
mov eax, dword [edx + 4]
add eax, 1
push eax
call dword [sym.imp.WSOCK32.dll_select]
mov dword [ebp - 0x148], eax
cmp dword [ebp - 0x148], 0
jge 0x4a0b1b
call fcn.004a0d00
cmp eax, 0x2714
jne 0x4a0b0c
push 0
call fcn.004a0bc0
add esp, 4
sub eax, dword [ebp - 0x38]
sbb edx, dword [ebp - 0x34]
mov dword [ebp - 0x144], eax
mov ecx, dword [ebp - 0x144]
cmp ecx, dword [ebp - 0x154]
jg 0x4a0afe
mov edx, dword [ebp - 0x154]
sub edx, dword [ebp - 0x144]
mov dword [ebp - 0x150], edx
mov dword [ebp - 0x14c], 0
jmp 0x4a0a6d
mov eax, dword [ebp + 8]
mov dword [eax + 8], 0x274c
jmp 0x4a0b22
call fcn.004a0d00
mov ecx, dword [ebp + 8]
mov dword [ecx + 8], eax
jmp 0x4a0b22
jmp 0x4a0b22
cmp dword [ebp - 0x148], 0
jl 0x4a0b5e
cmp dword [ebp - 0x148], 0
jne 0x4a0b40
mov edx, dword [ebp + 8]
mov dword [edx + 8], 0x274c
jmp 0x4a0b5e
lea eax, [ebp - 0x140]
push eax
mov ecx, dword [ebp + 8]
mov edx, dword [ecx + 4]
push edx
call sub.WSOCK32.dll___WSAFDIsSet
test eax, eax
je 0x4a0b5e
mov dword [ebp - 0x30], 1
cmp dword [ebp - 0x30], 0
jne 0x4a0b71
mov eax, dword [ebp + 8]
mov ecx, dword [ebp - 0xc]
mov dword [eax + 0xc], ecx
xor eax, eax
jmp 0x4a0ba9
mov edx, dword [ebp + 8]
mov eax, dword [ebp - 0xc]
mov dword [edx + 0xc], eax
push 0x10
lea ecx, [ebp - 0x28]
push ecx
call fcn.004f2740
add esp, 8
mov edx, dword [ebp + 8]
mov dword [edx], eax
mov eax, dword [ebp + 8]
cmp dword [eax], 0
jne 0x4a0ba4
call fcn.004a0d00
mov ecx, dword [ebp + 8]
mov dword [ecx + 8], eax
xor eax, eax
jmp 0x4a0ba9
mov eax, 1
mov ecx, dword [ebp - 0x18]
xor ecx, ebp
call fcn.00472edc
mov esp, ebp
pop ebp
ret