Function at 0x40cf40
Capabilities:
Act as tcp client
Connect socket
Connect tcp socket
Connect udp socket
Create tcp socket
Create udp socket
Initialize winsock library
Resolve dns

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x47a111
mov eax, dword fs:[0]
push eax
sub esp, 0x240
mov eax, dword [0x48d744]
xor eax, ebp
mov dword [ebp - 0x10], eax
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x22c], ecx
mov eax, dword [ebp - 0x22c]
mov ecx, dword [eax + 0x24]
mov dword [ebp - 0x230], ecx
mov edx, dword [ebp - 0x230]
add edx, 1
mov dword [ebp - 0x234], edx
mov eax, dword [ebp - 0x230]
mov cl, byte [eax]
mov byte [ebp - 0x235], cl
add dword [ebp - 0x230], 1
cmp byte [ebp - 0x235], 0
jne 0x40cf8f
mov edx, dword [ebp - 0x230]
sub edx, dword [ebp - 0x234]
mov dword [ebp - 0x23c], edx
jne 0x40cfc8
xor al, al
jmp 0x40d4d2
mov eax, dword [ebp - 0x22c]
mov ecx, dword [eax + 0x24]
mov dword [ebp - 0x240], ecx
mov edx, dword [ebp - 0x240]
add edx, 1
mov dword [ebp - 0x244], edx
mov eax, dword [ebp - 0x240]
mov cl, byte [eax]
mov byte [ebp - 0x245], cl
add dword [ebp - 0x240], 1
cmp byte [ebp - 0x245], 0
jne 0x40cfe6
mov edx, dword [ebp - 0x240]
sub edx, dword [ebp - 0x244]
mov dword [ebp - 0x24c], edx
mov eax, dword [ebp - 0x24c]
add eax, 1
cmp eax, 0x800
jbe 0x40d02d
xor al, al
jmp 0x40d4d2
mov dword [ebp - 0x1ac], 0
mov ecx, dword [ebp - 0x22c]
call fcn.0040ca70
mov ecx, dword [ebp - 0x22c]
mov edx, dword [ecx + 0x34]
push edx
lea ecx, [ebp - 0x21c]
call fcn.00406c40
mov dword [ebp - 4], 0
mov eax, dword [ebp - 0x22c]
cmp dword [eax + 0x2c], 0xffffffff
je 0x40d08e
mov byte [ebp - 0x21d], 1
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x21c]
call fcn.00406d50
mov al, byte [ebp - 0x21d]
jmp 0x40d4d2
mov ecx, dword [ebp - 0x22c]
mov dword [ecx + 0x2c], 0xffffffff
mov edx, 0x101
mov word [ebp - 0x1f8], dx
lea eax, [ebp - 0x1a4]
push eax
movzx ecx, word [ebp - 0x1f8]
push ecx
call dword [sym.imp.WS2_32.dll_WSAStartup]
mov dword [ebp - 0x200], eax
cmp dword [ebp - 0x200], 0
je 0x40d0d8
push str.WSAStartup_error
call fcn.0044b718
add esp, 4
push 0
push 1
push 2
call dword [sym.imp.WS2_32.dll_socket]
mov edx, dword [ebp - 0x22c]
mov dword [edx + 0x2c], eax
mov eax, dword [ebp - 0x22c]
cmp dword [eax + 0x2c], 0
jge 0x40d11d
mov byte [ebp - 0x21e], 0
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x21c]
call fcn.00406d50
mov al, byte [ebp - 0x21e]
jmp 0x40d4d2
lea ecx, [ebp - 0x1e4]
call fcn.0041b6d0
mov byte [ebp - 4], 1
mov ecx, dword [ebp - 0x22c]
mov edx, dword [ecx + 0x24]
push edx
lea ecx, [ebp - 0x1e4]
call fcn.0041b2c0
lea ecx, [ebp - 0x1e4]
call fcn.00405830
mov dword [ebp - 0x1a8], eax
cmp dword [ebp - 0x1a8], 0
jge 0x40d18e
mov byte [ebp - 0x21f], 0
mov byte [ebp - 4], 0
lea ecx, [ebp - 0x1e4]
call fcn.0041b720
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x21c]
call fcn.00406d50
mov al, byte [ebp - 0x21f]
jmp 0x40d4d2
lea ecx, [ebp - 0x1e4]
call fcn.004144c0
test eax, eax
jne 0x40d1d0
mov byte [ebp - 0x220], 0
mov byte [ebp - 4], 0
lea ecx, [ebp - 0x1e4]
call fcn.0041b720
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x21c]
call fcn.00406d50
mov al, byte [ebp - 0x220]
jmp 0x40d4d2
lea ecx, [ebp - 0x1e4]
call fcn.004144c0
push eax
lea ecx, [ebp - 0x1c8]
call fcn.00406c40
mov byte [ebp - 4], 2
push 0x47fdde
lea eax, [ebp - 0x1c8]
push eax
call fcn.0040f210
add esp, 8
movzx ecx, al
test ecx, ecx
je 0x40d248
mov byte [ebp - 0x221], 0
mov byte [ebp - 4], 1
lea ecx, [ebp - 0x1c8]
call fcn.00406d50
mov byte [ebp - 4], 0
lea ecx, [ebp - 0x1e4]
call fcn.0041b720
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x21c]
call fcn.00406d50
mov al, byte [ebp - 0x221]
jmp 0x40d4d2
xor edx, edx
mov dword [ebp - 0x1f4], edx
mov dword [ebp - 0x1f0], edx
mov dword [ebp - 0x1ec], edx
mov dword [ebp - 0x1e8], edx
mov eax, 2
mov word [ebp - 0x1f4], ax
movzx ecx, word [ebp - 0x1a8]
push ecx
call dword [sym.imp.WS2_32.dll_htons]
mov word [ebp - 0x1f2], ax
lea ecx, [ebp - 0x1c8]
call fcn.0040f110
push eax
call dword [sym.imp.WS2_32.dll_gethostbyname]
mov dword [ebp - 0x1ac], eax
cmp dword [ebp - 0x1ac], 0
jne 0x40d2f1
mov ecx, dword [ebp - 0x22c]
call fcn.0040d5e0
mov byte [ebp - 0x222], 0
mov byte [ebp - 4], 1
lea ecx, [ebp - 0x1c8]
call fcn.00406d50
mov byte [ebp - 4], 0
lea ecx, [ebp - 0x1e4]
call fcn.0041b720
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x21c]
call fcn.00406d50
mov al, byte [ebp - 0x222]
jmp 0x40d4d2
mov edx, dword [ebp - 0x1ac]
movsx eax, word [edx + 0xa]
push eax
mov ecx, dword [ebp - 0x1ac]
mov edx, dword [ecx + 0xc]
mov eax, dword [edx]
push eax
lea ecx, [ebp - 0x1f0]
push ecx
call fcn.0044fb00
add esp, 0xc
push 0x10
lea edx, [ebp - 0x1f4]
push edx
mov eax, dword [ebp - 0x22c]
mov ecx, dword [eax + 0x2c]
push ecx
call dword [sym.imp.WS2_32.dll_connect]
mov dword [ebp - 0x1fc], eax
cmp dword [ebp - 0x1fc], 0
jne 0x40d383
mov byte [ebp - 0x223], 1
mov byte [ebp - 4], 1
lea ecx, [ebp - 0x1c8]
call fcn.00406d50
mov byte [ebp - 4], 0
lea ecx, [ebp - 0x1e4]
call fcn.0041b720
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x21c]
call fcn.00406d50
mov al, byte [ebp - 0x223]
jmp 0x40d4d2
cmp dword [ebp - 0x1fc], 0
jge 0x40d3e3
call fcn.0044bab4
cmp dword [eax], 0x70
je 0x40d3e3
mov ecx, dword [ebp - 0x22c]
call fcn.0040d5e0
mov byte [ebp - 0x224], 0
mov byte [ebp - 4], 1
lea ecx, [ebp - 0x1c8]
call fcn.00406d50
mov byte [ebp - 4], 0
lea ecx, [ebp - 0x1e4]
call fcn.0041b720
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x21c]
call fcn.00406d50
mov al, byte [ebp - 0x224]
jmp 0x40d4d2
mov edx, dword [ebp - 0x22c]
mov eax, dword [edx + 0x2c]
push eax
mov ecx, dword [ebp - 0x22c]
call fcn.0040c0b0
mov dword [ebp - 0x1fc], eax
cmp dword [ebp - 0x1fc], 0
jle 0x40d44b
mov byte [ebp - 0x225], 1
mov byte [ebp - 4], 1
lea ecx, [ebp - 0x1c8]
call fcn.00406d50
mov byte [ebp - 4], 0
lea ecx, [ebp - 0x1e4]
call fcn.0041b720
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x21c]
call fcn.00406d50
mov al, byte [ebp - 0x225]
jmp 0x40d4d2
mov ecx, dword [ebp - 0x22c]
call fcn.0040d5e0
mov byte [ebp - 0x226], 0
mov byte [ebp - 4], 1
lea ecx, [ebp - 0x1c8]
call fcn.00406d50
mov byte [ebp - 4], 0
lea ecx, [ebp - 0x1e4]
call fcn.0041b720
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x21c]
call fcn.00406d50
mov al, byte [ebp - 0x226]
jmp 0x40d4d2
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.0044ab62
mov esp, ebp
pop ebp
ret