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

Disassembly:
push ebp
mov ebp, esp
mov ecx, 0x42
push 0
push 0
dec ecx
jne 0x40d5c8
mov dword [ebp - 8], eax
xor eax, eax
push ebp
push 0x40db5f
push dword fs:[eax]
mov dword fs:[eax], esp
cmp byte [0x414138], 0
jne 0x40d5f3
mov eax, 0x40db78
call fcn.00412fc4
mov byte [ebp - 9], 0
lea eax, [ebp - 0x1a0]
push eax
push 0x101
call sub.wsock32.dll_WSAStartup
push 0
push 1
push 2
call sub.wsock32.dll_socket
mov dword [ebp - 4], eax
mov word [ebp - 0x1b0], 2
push 0x19
call sub.wsock32.dll_htons
mov word [ebp - 0x1ae], ax
call fcn.0040eabc
lea edx, [ebp - 0x1b4]
mov eax, dword [0x495b68]
call fcn.00406518
mov edx, dword [ebp - 0x1b4]
mov eax, 0x495b6c
call fcn.00403780
mov eax, dword [0x495b6c]
call fcn.004038a4
cmp eax, 5
jge 0x40d6a4
push 0x40db88
push dword [0x495b68]
push 0x40db9c
lea edx, [ebp - 0x1bc]
xor eax, eax
call fcn.0040666c
push dword [ebp - 0x1bc]
lea eax, [ebp - 0x1b8]
mov edx, 4
call fcn.00403964
mov eax, dword [ebp - 0x1b8]
call fcn.00412fc4
jmp 0x40db39
mov eax, dword [0x495b6c]
call fcn.00403aa4
push eax
call sub.wsock32.dll_inet_addr
mov dword [ebp - 0x1ac], eax
push 0x10
lea eax, [ebp - 0x1b0]
push eax
mov eax, dword [ebp - 4]
push eax
call sub.wsock32.dll_connect
mov dword [0x415b38], eax
cmp dword [0x415b38], 0xffffffff
jne 0x40d715
lea edx, [ebp - 0x1c4]
xor eax, eax
call fcn.0040666c
mov ecx, dword [ebp - 0x1c4]
lea eax, [ebp - 0x1c0]
mov edx, 0x40dba8
call fcn.004038f0
mov eax, dword [ebp - 0x1c0]
call fcn.00412fc4
lea eax, [ebp - 4]
call fcn.00406650
jmp 0x40db39
push ebp
lea eax, [ebp - 0x1c8]
push eax
xor ecx, ecx
mov dl, 1
xor eax, eax
call fcn.0040d364
pop ecx
push ebp
lea eax, [ebp - 0x1cc]
push eax
mov ecx, 0x40dbb8
mov dl, 1
mov eax, 0x40dbc4
call fcn.0040d364
pop ecx
mov eax, dword [ebp - 0x1cc]
mov edx, 0x40dbdc
call fcn.004039f0
je 0x40db39
push ebp
lea eax, [ebp - 0x1d0]
push eax
mov ecx, 0x40dbe8
mov dl, 1
mov eax, 0x40dbf4
call fcn.0040d364
pop ecx
mov eax, dword [ebp - 0x1d0]
mov edx, 0x40dbdc
call fcn.004039f0
je 0x40db39
push ebp
lea eax, [ebp - 0x1d4]
push eax
mov ecx, 0x40dc08
mov dl, 1
mov eax, dword [0x495b70]
call fcn.0040d364
pop ecx
mov eax, dword [ebp - 0x1d4]
mov edx, 0x40dbdc
call fcn.004039f0
je 0x40db39
push ebp
lea eax, [ebp - 0x1d8]
push eax
lea eax, [ebp - 0x1dc]
mov ecx, dword [0x495b74]
mov edx, 0x40dc14
call fcn.004038f0
mov eax, dword [ebp - 0x1dc]
mov ecx, 0x40dbb8
mov dl, 1
call fcn.0040d364
pop ecx
mov eax, dword [ebp - 0x1d8]
mov edx, 0x40dbdc
call fcn.004039f0
je 0x40db39
push ebp
lea eax, [ebp - 0x1e0]
push eax
lea eax, [ebp - 0x1e4]
mov ecx, dword [0x415aec]
mov edx, 0x40dc28
call fcn.004038f0
mov eax, dword [ebp - 0x1e4]
mov ecx, 0x40dbb8
mov dl, 1
call fcn.0040d364
pop ecx
push ebp
lea eax, [ebp - 0x1e8]
push eax
lea eax, [ebp - 0x1ec]
mov ecx, dword [0x415af4]
mov edx, 0x40dc28
call fcn.004038f0
mov eax, dword [ebp - 0x1ec]
mov ecx, 0x40dbb8
mov dl, 1
call fcn.0040d364
pop ecx
mov eax, dword [ebp - 0x1e8]
mov edx, 0x40dbdc
call fcn.004039f0
je 0x40db39
push ebp
lea eax, [ebp - 0x1f0]
push eax
mov ecx, 0x40dc3c
mov dl, 1
mov eax, 0x40dc48
call fcn.0040d364
pop ecx
mov eax, dword [ebp - 0x1f0]
mov edx, 0x40dbdc
call fcn.004039f0
je 0x40db39
push 0x40dc58
lea edx, [ebp - 0x1f4]
mov eax, 0x71
call fcn.00405478
push dword [ebp - 0x1f4]
push 0x40db9c
push dword [0x415af8]
push 0x40db9c
lea edx, [ebp - 0x1f8]
mov eax, dword [ebp - 8]
call fcn.0040d1c0
push dword [ebp - 0x1f8]
lea eax, [ebp - 0x10]
mov edx, 6
call fcn.00403964
mov eax, dword [ebp - 0x10]
call fcn.004038a4
mov dword [0x415b34], eax
mov dword [0x415b38], 1
mov eax, 0x415ae4
mov edx, 0x4c
call fcn.00403bd4
jmp 0x40d992
lea eax, [ebp - 0x10]
call fcn.00403afc
mov edx, dword [0x415b38]
dec edx
test eax, eax
je 0x40d934
cmp edx, dword [eax - 4]
jb 0x40d939
call fcn.00402f14
inc edx
lea eax, [eax + edx - 1]
push eax
mov eax, 0x415ae4
call fcn.00403afc
mov edx, 1
dec edx
test eax, eax
je 0x40d958
cmp edx, dword [eax - 4]
jb 0x40d95d
call fcn.00402f14
inc edx
lea eax, [eax + edx - 1]
mov ecx, 0x4c
pop edx
call fcn.004049a4
push ebp
lea eax, [ebp - 0x1fc]
push eax
xor ecx, ecx
xor edx, edx
mov eax, dword [0x415ae4]
call fcn.0040d364
pop ecx
add dword [0x415b38], 0x4c
jno 0x40d992
call fcn.00402f1c
mov eax, dword [0x415b34]
sub eax, 0x4c
jno 0x40d9a1
call fcn.00402f1c
cmp eax, dword [0x415b38]
jge 0x40d91c
mov eax, dword [0x415b34]
sub eax, dword [0x415b38]
jno 0x40d9bf
call fcn.00402f1c
add eax, 1
jno 0x40d9c9
call fcn.00402f1c
mov dword [0x415b34], eax
mov eax, 0x415ae4
mov edx, dword [0x415b34]
call fcn.00403bd4
mov eax, 0x415ae4
call fcn.00403afc
mov edx, 1
dec edx
test eax, eax
je 0x40d9f7
cmp edx, dword [eax - 4]
jb 0x40d9fc
call fcn.00402f14
inc edx
lea eax, [eax + edx - 1]
mov ecx, 0x2b
mov edx, dword [0x415b34]
call fcn.00402bd8
lea eax, [ebp - 0x10]
call fcn.00403afc
mov edx, dword [0x415b38]
dec edx
test eax, eax
je 0x40da29
cmp edx, dword [eax - 4]
jb 0x40da2e
call fcn.00402f14
inc edx
lea eax, [eax + edx - 1]
push eax
mov eax, 0x415ae4
call fcn.00403afc
mov edx, 1
dec edx
test eax, eax
je 0x40da4d
cmp edx, dword [eax - 4]
jb 0x40da52
call fcn.00402f14
inc edx
lea eax, [eax + edx - 1]
mov ecx, dword [0x415b34]
test ecx, ecx
jns 0x40da66
call fcn.00402f14
pop edx
call fcn.004049a4
push ebp
lea eax, [ebp - 0x200]
push eax
xor ecx, ecx
xor edx, edx
mov eax, dword [0x415ae4]
call fcn.0040d364
pop ecx
push ebp
lea eax, [ebp - 0x204]
push eax
mov ecx, 0x40dbb8
mov dl, 1
mov eax, 0x40dc68
call fcn.0040d364
pop ecx
mov edx, dword [ebp - 0x204]
lea eax, [ebp - 0x10]
call fcn.004037c4
lea eax, [ebp - 0x10]
push eax
mov ecx, 3
xor edx, edx
mov eax, dword [ebp - 0x10]
call fcn.00403b04
push ebp
lea eax, [ebp - 0x208]
push eax
mov ecx, 0x40dbb8
mov dl, 1
mov eax, 0x40dc74
call fcn.0040d364
pop ecx
push ebp
lea eax, [ebp - 0x20c]
push eax
mov ecx, 0x40dc84
mov dl, 1
mov eax, 0x40dc90
call fcn.0040d364
pop ecx
lea eax, [ebp - 4]
call fcn.00406650
mov eax, dword [ebp - 0x10]
mov edx, 0x40dbb8
call fcn.004039f0
jne 0x40db39
mov byte [ebp - 9], 1
cmp byte [0x414138], 0
jne 0x40db34
lea eax, [ebp - 0x210]
mov ecx, dword [ebp - 8]
mov edx, 0x40dca0
call fcn.004038f0
mov eax, dword [ebp - 0x210]
call fcn.00412fc4
call fcn.00409d80
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x40db66
lea eax, [ebp - 0x210]
mov edx, 0x18
call fcn.00403750
lea eax, [ebp - 0x10]
call fcn.0040372c
ret