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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x2c
push ebx
xor eax, eax
cmp dword [0x5426d0], 1
push esi
push edi
mov dword [esp + 0xc], eax
mov dword [esp + 0x14], eax
jb 0x440278
push 1
call fcn.00408960
add esp, 4
test eax, eax
je 0x440278
mov esi, dword [ebp + 0x14]
lea eax, [esp + 0xc]
push eax
push 2
push 0x5164a8
mov ebx, esi
call fcn.00441eb0
add esp, 0xc
push eax
push str.Attempting_to_establish_TCP_connection_with__s
push 1
call fcn.00408640
add esp, 0xc
jmp 0x44027b
mov esi, dword [ebp + 0x14]
mov eax, dword [0x5426b0]
test eax, eax
je 0x440377
cmp dword [eax + 0x3c], 0
lea edi, [eax + 0x3c]
mov esi, eax
je 0x440374
test byte [eax + 0x5c], 1
jne 0x440374
lea ecx, [esp + 0x18]
xor ebx, ebx
push ecx
mov dword [esp + 0x14], ebx
call fcn.004347d0
add esp, 4
test eax, eax
jne 0x4402d6
lea ebx, [esp + 0x18]
call fcn.00434490
mov edx, dword [0x5424f0]
mov eax, dword [0x542500]
mov dword [esp + 0x18], edx
mov dword [esp + 0x1c], eax
xor ebx, ebx
mov ecx, dword [0x5424f0]
mov edx, dword [0x5424f4]
xor eax, eax
mov dword [esp + 0x20], eax
mov dword [esp + 0x24], eax
mov dword [esp + 0x28], eax
mov dword [esp + 0x2c], eax
mov dword [esp + 0x30], eax
mov dword [esp + 0x34], eax
lea eax, [esp + 0x20]
push eax
mov eax, dword [edi]
mov dword [esp + 0x24], ecx
mov dword [esp + 0x28], edx
mov dword [esp + 0x38], 0xb
mov dword [esp + 0x2c], ebx
mov dword [esp + 0x30], ebx
mov dword [esp + 0x34], ebx
call fcn.00419250
add esp, 4
cmp dword [esi + 0x20dc], ebx
je 0x440374
lea ecx, [esp + 0x10]
push ecx
push 0xcec
lea edi, [esp + 0x28]
call fcn.00418ea0
add esp, 8
test eax, eax
je 0x440352
mov ecx, eax
mov eax, esi
call fcn.00415400
mov eax, dword [esp + 0x10]
test eax, eax
je 0x440374
mov dword [esp + 0x10], 0
mov edi, dword [eax]
push eax
call dword [sym.imp.MSVCR80.dll_free]
add esp, 4
test edi, edi
mov eax, edi
jne 0x440362
mov esi, dword [ebp + 0x14]
mov ebx, dword [ebp + 8]
mov eax, dword [ebx]
push 0x10
push esi
push eax
call dword [sym.imp.WS2_32.dll_connect]
mov edi, eax
test edi, edi
je 0x440394
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov edi, eax
call fcn.00453190
mov ecx, dword [ebp + 0x30]
mov dword [ecx], eax
mov edx, dword [ecx]
test edx, edx
jne 0x440563
test edi, edi
je 0x44051b
cmp dword [0x5426d0], 1
jb 0x44040a
push 0x1000021
call fcn.00408960
add esp, 4
test eax, eax
je 0x44040a
lea eax, [esp + 0xc]
push eax
push 2
push 0x5164a8
mov ebx, esi
call fcn.00441eb0
add esp, 0xc
mov ebx, eax
push edi
lea eax, [esp + 0x10]
call fcn.00419e60
mov ecx, dword [ebp + 0x24]
add esp, 4
push eax
push ecx
push ebx
push str.TCP:_connect_to__s_failed__will_try_again_in__d_seconds:__s
push 0x1000021
call fcn.00408640
mov ebx, dword [ebp + 8]
add esp, 0x14
mov eax, dword [esp + 0xc]
test eax, eax
je 0x440432
mov dword [esp + 0xc], 0
lea ebx, [ebx]
mov edi, dword [eax]
push eax
call dword [sym.imp.MSVCR80.dll_free]
add esp, 4
test edi, edi
mov eax, edi
jne 0x440420
mov edx, dword [ebx]
push edx
call dword [sym.imp.WS2_32.dll_closesocket]
mov eax, dword [ebp + 0x28]
test eax, eax
mov dword [ebx], 0xffffffff
jle 0x44045b
mov ecx, dword [esp + 0x14]
add ecx, 1
cmp ecx, eax
mov dword [esp + 0x14], ecx
jge 0x44055a
cmp dword [ebp + 0x18], 0
jne 0x44055a
mov eax, dword [0x5426b0]
test eax, eax
je 0x44047d
mov ecx, dword [ebp + 0x24]
push ecx
push eax
call fcn.004187f0
add esp, 8
jmp 0x44048d
mov edx, dword [ebp + 0x24]
imul edx, edx, 0x3e8
push edx
call dword [sym.imp.KERNEL32.dll_Sleep]
call fcn.00453190
mov ecx, dword [ebp + 0x30]
mov dword [ecx], eax
mov eax, dword [ecx]
test eax, eax
jne 0x440563
push 6
push 1
push 2
call dword [sym.imp.WS2_32.dll_socket]
cmp dword [ebp + 0x10], 0
mov dword [ebx], eax
je 0x4404c5
mov ecx, dword [ebp + 0xc]
push str.TCP_Client
call fcn.00440180
add esp, 4
cmp dword [ebp + 0x1c], 0
je 0x44027b
test esi, esi
je 0x44027b
movzx eax, byte [ebp + 0x2c]
mov ecx, dword [ebp + 0x1c]
push 0
and eax, 8
push 0
shl eax, 6
push 1
or eax, 0x101
push ecx
push eax
call fcn.0043f2f0
add esp, 0x14
test eax, eax
je 0x44027b
cmp dword [esi + 4], eax
je 0x44027b
mov edx, dword [ebp + 0x20]
mov dword [esi + 4], eax
mov dword [edx], 1
jmp 0x44027b
cmp dword [0x5426d0], 1
jb 0x440563
push 1
call fcn.00408960
add esp, 4
test eax, eax
je 0x440563
lea eax, [esp + 0xc]
push eax
push 2
push 0x5164a8
mov ebx, esi
call fcn.00441eb0
add esp, 0xc
push eax
push str.TCP_connection_established_with__s
push 1
call fcn.00408640
add esp, 0xc
jmp 0x440563
mov ecx, dword [ebp + 0x30]
mov dword [ecx], 1
mov eax, dword [esp + 0xc]
test eax, eax
je 0x440582
jmp 0x440570
mov edi, dword [eax]
push eax
call dword [sym.imp.MSVCR80.dll_free]
add esp, 4
test edi, edi
mov eax, edi
jne 0x440570
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret