Function at 0x402503
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, 0xfffffdc8
push ebx
push esi
push edi
mov edi, dword [ebp + 0x14]
call fcn.004024c4
mov esi, eax
cmp esi, 0xffffffff
jne 0x402528
mov eax, 0xfffffffa
jmp 0x4027ac
push 0
push 1
push 2
call sub.WSOCK32.dll_socket
mov ebx, eax
cmp ebx, 0xffffffff
jne 0x402555
call sub.KERNEL32.dll_GetLastError
push eax
push 0x40d397
call fcn.0040629c
add esp, 8
or eax, 0xffffffff
jmp 0x4027ac
mov dword [ebp - 0x10], 1
push 4
lea edx, [ebp - 0x10]
push edx
push 0xe
push 0
push ebx
call sub.WSOCK32.dll_setsockopt
lea ecx, [ebp - 0x20]
push ecx
push dword [ebp + 8]
call fcn.0040248a
add esp, 8
test ax, ax
jge 0x40259d
call sub.KERNEL32.dll_GetLastError
push eax
push str.Error__d
call fcn.0040629c
add esp, 8
mov eax, 0xfffffffd
jmp 0x4027ac
cmp dword [0x42d5c0], 0
je 0x4025b8
lea edx, [ebp - 0x20]
push edx
call fcn.004024e1
pop ecx
mov edi, eax
add edi, 0x7d0
lea eax, [ebp - 0x20]
push eax
call fcn.0040236c
pop ecx
mov dword [ebp - 0x2c], eax
cmp dword [ebp - 0x2c], 0
je 0x402783
push 0xa
lea edx, [ebp - 0x20]
push edx
push edi
call fcn.00408bc4
add esp, 0xc
lea ecx, [ebp - 0x20]
push ecx
call fcn.004023b5
pop ecx
mov word [ebp - 0x2e], ax
cmp word [ebp - 0x2e], 0
je 0x402783
push str.TCP_IP
push dword [ebp + 0xc]
call fcn.00402a14
add esp, 8
test eax, eax
je 0x402615
mov eax, 0xfffffffe
jmp 0x4027ac
mov word [ebp - 0x30], 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 - 0x30]
push ecx
push ebx
call sub.WSOCK32.dll_connect
mov edi, eax
inc edi
jne 0x402783
call sub.KERNEL32.dll_GetLastError
mov edi, eax
cmp edi, 0x2733
jne 0x402768
xor eax, eax
mov dword [ebp - 0x134], eax
xor edx, edx
mov dword [ebp - 0x238], edx
xor eax, eax
jmp 0x402677
cmp ebx, dword [ebp + eax*4 - 0x130]
je 0x40267f
inc eax
cmp eax, dword [ebp - 0x134]
jb 0x40266d
cmp eax, dword [ebp - 0x134]
jne 0x40269d
cmp dword [ebp - 0x134], 0x40
jae 0x40269d
mov dword [ebp + eax*4 - 0x130], ebx
inc dword [ebp - 0x134]
xor eax, eax
jmp 0x4026ab
cmp ebx, dword [ebp + eax*4 - 0x234]
je 0x4026b3
inc eax
cmp eax, dword [ebp - 0x238]
jb 0x4026a1
cmp eax, dword [ebp - 0x238]
jne 0x4026d1
cmp dword [ebp - 0x238], 0x40
jae 0x4026d1
mov dword [ebp + eax*4 - 0x234], ebx
inc dword [ebp - 0x238]
mov dword [ebp - 8], 3
xor edx, edx
mov dword [ebp - 4], edx
lea ecx, [ebp - 8]
push ecx
lea eax, [ebp - 0x238]
push eax
lea edx, [ebp - 0x134]
push edx
push 0
push edi
call sub.WSOCK32.dll_select
mov edi, eax
dec edi
jge 0x40271f
mov edi, 0x274c
push ebx
call sub.WSOCK32.dll_closesocket
push edi
push 0x40d3b0
call fcn.0040629c
add esp, 8
mov eax, 0xfffffffb
jmp 0x4027ac
lea edx, [ebp - 0x238]
push edx
push ebx
call sub.WSOCK32.dll___WSAFDIsSet
test eax, eax
je 0x402752
call sub.KERNEL32.dll_GetLastError
mov edi, eax
push ebx
call sub.WSOCK32.dll_closesocket
push edi
push 0x40d3c1
call fcn.0040629c
add esp, 8
mov eax, 0xfffffffb
jmp 0x4027ac
xor edx, edx
mov dword [ebp - 0xc], edx
lea ecx, [ebp - 0xc]
push ecx
push 0x8004667e
push ebx
call sub.WSOCK32.dll_ioctlsocket
jmp 0x402783
push ebx
call sub.WSOCK32.dll_closesocket
push edi
push str.Connect_error__d
call fcn.0040629c
add esp, 8
mov eax, 0xfffffffb
jmp 0x4027ac
lea edx, [esi + esi*2]
mov dword [edx*8 + 0x42d5c4], ebx
push 0x10
lea ecx, [ebp - 0x30]
push ecx
mov eax, esi
shl eax, 3
lea eax, [eax + eax*2]
add eax, 0x42d5c8
push eax
call fcn.004028c4
add esp, 0xc
mov eax, esi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret