Function at 0x401da9
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
add esp, 0xfffffdcc
push ebx
push esi
push edi
call fcn.00401d8c
mov esi, eax
cmp esi, 0xffffffff
jne 0x401dcb
mov eax, 0xfffffffa
jmp 0x40201f
push 0
push 1
push 2
call sub.WSOCK32.dll_socket
mov ebx, eax
cmp ebx, 0xffffffff
jne 0x401df8
call sub.KERNEL32.dll_GetLastError
push eax
push 0x409264
call fcn.004050b0
add esp, 8
or eax, 0xffffffff
jmp 0x40201f
lea edx, [ebp - 0x1c]
push edx
push dword [ebp + 8]
call fcn.00401d52
add esp, 8
test ax, ax
jge 0x401e29
call sub.KERNEL32.dll_GetLastError
push eax
push 0x40926e
call fcn.004050b0
add esp, 8
mov eax, 0xfffffffd
jmp 0x40201f
lea edx, [ebp - 0x1c]
push edx
call fcn.00401c34
pop ecx
mov dword [ebp - 0x28], eax
cmp dword [ebp - 0x28], 0
je 0x401ff6
push 0xa
lea ecx, [ebp - 0x1c]
push ecx
push dword [ebp + 0x14]
call fcn.004066fc
add esp, 0xc
lea eax, [ebp - 0x1c]
push eax
call fcn.00401c7d
pop ecx
mov word [ebp - 0x2a], ax
cmp word [ebp - 0x2a], 0
je 0x401ff6
push 0x409278
push dword [ebp + 0xc]
call fcn.004021a4
add esp, 8
test eax, eax
je 0x401e88
mov eax, 0xfffffffe
jmp 0x40201f
mov word [ebp - 0x2c], 2
mov dword [ebp - 0xc], 1
lea edx, [ebp - 0xc]
push edx
push 0x8004667e
push ebx
call sub.WSOCK32.dll_ioctlsocket
push 0x10
lea ecx, [ebp - 0x2c]
push ecx
push ebx
call sub.WSOCK32.dll_connect
mov edi, eax
inc edi
jne 0x401ff6
call sub.KERNEL32.dll_GetLastError
mov edi, eax
cmp edi, 0x2733
jne 0x401fdb
xor eax, eax
mov dword [ebp - 0x130], eax
xor edx, edx
mov dword [ebp - 0x234], edx
xor eax, eax
jmp 0x401eea
cmp ebx, dword [ebp + eax*4 - 0x12c]
je 0x401ef2
inc eax
cmp eax, dword [ebp - 0x130]
jb 0x401ee0
cmp eax, dword [ebp - 0x130]
jne 0x401f10
cmp dword [ebp - 0x130], 0x40
jae 0x401f10
mov dword [ebp + eax*4 - 0x12c], ebx
inc dword [ebp - 0x130]
xor eax, eax
jmp 0x401f1e
cmp ebx, dword [ebp + eax*4 - 0x230]
je 0x401f26
inc eax
cmp eax, dword [ebp - 0x234]
jb 0x401f14
cmp eax, dword [ebp - 0x234]
jne 0x401f44
cmp dword [ebp - 0x234], 0x40
jae 0x401f44
mov dword [ebp + eax*4 - 0x230], ebx
inc dword [ebp - 0x234]
mov dword [ebp - 8], 3
xor edx, edx
mov dword [ebp - 4], edx
lea ecx, [ebp - 8]
push ecx
lea eax, [ebp - 0x234]
push eax
lea edx, [ebp - 0x130]
push edx
push 0
push edi
call sub.WSOCK32.dll_select
mov edi, eax
dec edi
jge 0x401f92
mov edi, 0x274c
push ebx
call sub.WSOCK32.dll_closesocket
push edi
push 0x40927f
call fcn.004050b0
add esp, 8
mov eax, 0xfffffffb
jmp 0x40201f
lea edx, [ebp - 0x234]
push edx
push ebx
call sub.WSOCK32.dll___WSAFDIsSet
test eax, eax
je 0x401fc5
call sub.KERNEL32.dll_GetLastError
mov edi, eax
push ebx
call sub.WSOCK32.dll_closesocket
push edi
push 0x409291
call fcn.004050b0
add esp, 8
mov eax, 0xfffffffb
jmp 0x40201f
xor edx, edx
mov dword [ebp - 0xc], edx
lea ecx, [ebp - 0xc]
push ecx
push 0x8004667e
push ebx
call sub.WSOCK32.dll_ioctlsocket
jmp 0x401ff6
push ebx
call sub.WSOCK32.dll_closesocket
push edi
push 0x4092a3
call fcn.004050b0
add esp, 8
mov eax, 0xfffffffb
jmp 0x40201f
lea edx, [esi + esi*2]
mov dword [edx*8 + 0x42849c], ebx
push 0x10
lea ecx, [ebp - 0x2c]
push ecx
mov eax, esi
shl eax, 3
lea eax, [eax + eax*2]
add eax, 0x4284a0
push eax
call fcn.004020c8
add esp, 0xc
mov eax, esi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret