Function at 0x4059d3
Capabilities:
Act as tcp client
Connect socket
Connect tcp socket
Connect udp socket
Create tcp socket
Create udp socket

Disassembly:
push ebp
push edi
push esi
push ebx
sub esp, 0x3c
mov ebx, dword [esp + 0x50]
mov esi, dword [esp + 0x54]
mov dword [esp + 0x1c], 0xffffffff
call fcn.00408e53
cmp eax, 4
jne 0x405b30
cmp dword [0x42b300], 0
jne 0x405a0b
mov eax, dword [0x42b304]
mov dword [0x42b300], eax
lea edi, [esp + 0x20]
lea ebp, [esp + 0x1c]
mov eax, dword [0x42b300]
test eax, eax
je 0x405c64
mov dword [esp + 8], edi
mov edx, dword [eax + 0x44]
add eax, 4
mov dword [esp], eax
mov dword [esp + 4], edx
call fcn.004051b5
test al, al
je 0x405b1b
mov dword [esp + 8], 0
mov dword [esp + 4], 1
mov dword [esp], 2
call sub.WS2_32.dll_socket
sub esp, 0xc
mov dword [esp + 8], 0x10
mov dword [esp + 4], edi
mov dword [esp], eax
mov dword [esp + 0x1c], eax
call sub.WS2_32.dll_connect
sub esp, 0xc
test eax, eax
jne 0x405b13
mov edx, dword [0x42b300]
mov eax, dword [edx + 0x88]
mov ecx, dword [eax + 0x44]
add eax, 4
mov dword [esp + 4], edx
mov dword [esp + 8], eax
mov eax, dword [esp + 0x1c]
mov dword [esp + 0xc], ecx
mov dword [esp], eax
call fcn.004058e9
test al, al
je 0x405b13
mov eax, dword [0x42b300]
mov eax, dword [eax + 0x88]
mov dword [0x42b300], eax
mov edx, dword [0x42b300]
test edx, edx
je 0x405c64
mov eax, dword [edx + 0x88]
mov ecx, dword [esp + 0x1c]
test eax, eax
je 0x405b09
mov edi, dword [eax + 0x44]
add eax, 4
mov dword [esp + 8], eax
mov dword [esp + 0xc], edi
mov dword [esp + 4], edx
mov dword [esp], ecx
call fcn.004058e9
test al, al
jne 0x405aae
lea eax, [esp + 0x1c]
mov dword [esp], eax
call fcn.00405999
jmp 0x405c18
mov dword [esp + 0xc], esi
mov dword [esp + 8], ebx
jmp 0x405ae8
mov dword [esp], ebp
call fcn.00405999
mov eax, dword [0x42b300]
mov eax, dword [eax + 0x88]
mov dword [0x42b300], eax
jmp 0x405a13
call fcn.00408e53
cmp eax, 2
jne 0x405c00
cmp dword [0x42b300], 0
jne 0x405b51
mov eax, dword [0x42b304]
mov dword [0x42b300], eax
lea edi, [esp + 0x20]
lea ebp, [esp + 0x1c]
mov eax, dword [0x42b300]
test eax, eax
je 0x405c64
mov dword [esp + 8], edi
mov edx, dword [eax + 0x44]
add eax, 4
mov dword [esp], eax
mov dword [esp + 4], edx
call fcn.004051b5
test al, al
je 0x405beb
mov dword [esp + 8], 0
mov dword [esp + 4], 1
mov dword [esp], 2
call sub.WS2_32.dll_socket
sub esp, 0xc
mov dword [esp + 8], 0x10
mov dword [esp + 4], edi
mov dword [esp], eax
mov dword [esp + 0x1c], eax
call sub.WS2_32.dll_connect
sub esp, 0xc
test eax, eax
je 0x405bc8
mov dword [esp], ebp
call fcn.00405999
jmp 0x405beb
mov eax, dword [0x42b300]
mov dword [esp + 0xc], esi
mov dword [esp + 8], ebx
mov dword [esp + 4], eax
mov eax, dword [esp + 0x1c]
mov dword [esp], eax
call fcn.004058e9
test al, al
je 0x405bbe
jmp 0x405c64
mov eax, dword [0x42b300]
mov eax, dword [eax + 0x88]
mov dword [0x42b300], eax
jmp 0x405b59
lea edi, [esp + 0x20]
mov dword [esp + 4], esi
mov dword [esp], ebx
mov dword [esp + 8], edi
call fcn.004051b5
test al, al
jne 0x405c1d
or eax, 0xffffffff
jmp 0x405c68
mov dword [esp + 8], 6
mov dword [esp + 4], 1
mov dword [esp], 2
call sub.WS2_32.dll_socket
sub esp, 0xc
cmp eax, 0xffffffff
mov dword [esp + 0x1c], eax
je 0x405c18
mov dword [esp + 8], 0x10
mov dword [esp + 4], edi
mov dword [esp], eax
call sub.WS2_32.dll_connect
sub esp, 0xc
test eax, eax
jne 0x405af8
mov eax, dword [esp + 0x1c]
add esp, 0x3c
pop ebx
pop esi
pop edi
pop ebp
ret