Function at 0x41856a
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, 0x238
push ebx
push esi
push edi
mov esi, ecx
cmp byte [0x44559c], 0
jne 0x418608
call fcn.00418150
test eax, eax
je 0x418608
push 0xff
lea eax, [esi + 0x127]
push dword [ebp + 8]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcpynA]
push dword [ebp + 8]
lea edi, [esi + 0x28]
push edi
call fcn.00421870
mov eax, dword [ebp + 0xc]
push edi
mov dword [esi + 0x228], eax
call fcn.004182a2
add esp, 0xc
test eax, eax
jne 0x4185cd
push edi
push str.Couldnt_resolve___s_.
jmp 0x4185ff
push 0
push esi
call fcn.0041930b
pop ecx
pop ecx
mov ecx, esi
call fcn.004188b3
push 0
push 1
pop ebx
push ebx
push 2
call sub.WSOCK32.dll_socket
cmp eax, 0xffffffff
mov dword [esi], eax
jne 0x41860f
mov ecx, esi
call fcn.004192bf
push eax
push str.Couldnt_create_socket___d_.
push esi
call fcn.0041930b
add esp, 0xc
xor eax, eax
jmp 0x418847
lea ecx, [ebp - 8]
mov dword [ebp - 8], ebx
push ecx
push 0x8004667e
push eax
call sub.WSOCK32.dll_ioctlsocket
cmp eax, 0xffffffff
je 0x418822
push 0x10
lea eax, [ebp - 0x20]
pop edi
push edi
push 0
push eax
call fcn.004206e0
add esp, 0xc
and dword [ebp - 0x1c], 0
and word [ebp - 0x1e], 0
lea eax, [ebp - 0x20]
push edi
push eax
push dword [esi]
mov word [ebp - 0x20], 2
call sub.WSOCK32.dll_bind
cmp eax, 0xffffffff
jne 0x41866e
mov ecx, esi
call fcn.004192bf
push eax
push str.Couldnt_bind_socket___d_.
jmp 0x41882f
push edi
lea eax, [ebp - 0x30]
push 0
push eax
call fcn.004206e0
add esp, 0xc
lea eax, [esi + 0x28]
mov word [ebp - 0x30], 2
push eax
call sub.WSOCK32.dll_inet_addr
mov dword [ebp - 0x2c], eax
mov ax, word [esi + 0x228]
push eax
call sub.WSOCK32.dll_htons
mov word [ebp - 0x2e], ax
lea eax, [ebp - 0x30]
push edi
push eax
push dword [esi]
call sub.WSOCK32.dll_connect
xor ecx, ecx
cmp eax, 0xffffffff
setne cl
test ecx, ecx
mov dword [ebp + 8], ecx
jne 0x41883f
mov ecx, esi
call fcn.004192bf
cmp eax, 0x2733
jne 0x418813
mov ecx, dword [esi + 0x1c]
push 2
pop eax
cmp ecx, eax
jg 0x4186dd
mov eax, ecx
mov edi, eax
cmp byte [0x44559c], 0
jne 0x4187fe
cmp edi, ecx
jg 0x4187fe
and dword [ebp - 0xc], 0
lea ecx, [ebp - 0x10]
push ecx
lea ecx, [ebp - 0x134]
mov dword [ebp - 0x10], eax
mov eax, dword [esi]
push ecx
lea ecx, [ebp - 0x238]
mov dword [ebp - 0x234], eax
mov dword [ebp - 0x130], eax
push ecx
inc eax
push 0
push eax
mov dword [ebp - 0x238], ebx
mov dword [ebp - 0x134], ebx
call sub.WSOCK32.dll_select
test eax, eax
jle 0x41875d
lea eax, [ebp - 0x134]
push eax
push dword [esi]
call sub.WSOCK32.dll___WSAFDIsSet
test eax, eax
jne 0x41878d
lea eax, [ebp - 0x238]
push eax
push dword [esi]
call sub.WSOCK32.dll___WSAFDIsSet
test eax, eax
je 0x418763
mov dword [ebp + 8], ebx
jmp 0x418763
jl 0x4187e8
mov ecx, dword [esi + 0x1c]
mov eax, ecx
sub eax, edi
cmp eax, 2
jg 0x418778
cmp eax, ebx
jle 0x41877d
cmp eax, 2
jle 0x41877f
push 2
pop eax
jmp 0x41877f
mov eax, ebx
add edi, eax
cmp dword [ebp + 8], 0
je 0x4186df
jmp 0x4187fe
push 0
call dword [sym.imp.KERNEL32.dll_Sleep]
lea eax, [ebp - 4]
mov dword [ebp - 4], 4
push eax
lea eax, [ebp + 0xc]
push eax
push 0x1007
push 0xffff
push dword [esi]
call sub.WSOCK32.dll_getsockopt
cmp eax, 0xffffffff
jne 0x4187c9
mov ecx, esi
call fcn.004192bf
push eax
push str.CxSocket:_getsockopt_error___d_
jmp 0x4187f5
cmp dword [ebp + 0xc], 0
je 0x4187d9
push dword [ebp + 0xc]
push str.Connect_error___d_
jmp 0x4187f5
push str.Unknown_error
push esi
call fcn.0041930b
pop ecx
pop ecx
jmp 0x4187fe
mov ecx, esi
call fcn.004192bf
push eax
push str.Select_error_connect____d_
push esi
call fcn.0041930b
add esp, 0xc
cmp dword [ebp + 8], 0
jne 0x41883f
push str.Connect_timed_out.
push esi
call fcn.0041930b
pop ecx
pop ecx
jmp 0x418838
mov ecx, esi
call fcn.004192bf
push eax
push str.Couldnt_connect_socket___d_.
jmp 0x41882f
mov ecx, esi
call fcn.004192bf
push eax
push str.Couldnt_change_to_non_blocking_socket___d_.
push esi
call fcn.0041930b
add esp, 0xc
mov ecx, esi
call fcn.004188b3
xor eax, eax
cmp dword [esi], 0xffffffff
setne al
pop edi
pop esi
pop ebx
leave
ret 8