Function at 0x408580
Capabilities:
Act as tcp client
Connect socket
Connect tcp socket
Create tcp socket
Initialize winsock library
Receive data
Receive data on socket
Resolve dns
Send data
Send data on socket
Set socket configuration

Disassembly:
push ebp
lea ebp, [esp - 0x1440]
mov eax, 0x1440
call fcn.0040c8f0
push 0xffffffffffffffff
push 0x41e82b
mov eax, dword fs:[0]
push eax
sub esp, 0x40
mov eax, dword [0x4260b0]
xor eax, ebp
mov dword [ebp + 0x143c], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x10], esp
mov eax, dword [ebp + 0x144c]
mov ecx, dword [ebp + 0x1450]
xor ebx, ebx
mov dword [ebp - 0x18], eax
mov dword [ebp - 0x3c], ecx
mov dword [ebp - 4], ebx
mov dword [ebp + 0x1b8], 0xf
mov dword [ebp + 0x1b4], ebx
mov byte [ebp + 0x1a4], bl
fldz
mov esi, dword [ebp + 0x1448]
xor edx, edx
mov word [ebp - 0x20], dx
xor eax, eax
mov word [ebp - 0x1c], ax
fst qword [ebp - 0x44]
mov dword [ebp - 0x38], ebx
fstp qword [ebp - 0x4c]
fldz
xor ecx, ecx
fstp dword [ebp - 0x2c]
mov byte [ebp + 0x11bc], al
mov word [ebp - 0x28], cx
mov word [ebp - 0x24], dx
mov word [ebp - 0x30], ax
mov eax, esi
mov byte [ebp - 4], 1
mov word [ebp - 0x34], cx
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408630
sub eax, edx
movzx edx, word [0x424d64]
imul edx, edx, 0x6c38f4ef
mov edi, eax
cmp edi, 0x7f
mov word [0x424d64], dx
jg 0x408f0d
mov ax, word [ebp - 0x28]
movsx ecx, ax
mov dword [ebp - 0x14], ecx
fild dword [ebp - 0x14]
fld qword [ebp - 0x44]
fadd qword [0x41f8f0]
fcompp
fnstsw ax
fld qword [ebp - 0x44]
fadd qword [0x41f348]
fstp qword [ebp - 0x44]
test ah, 0x41
jp 0x4086a5
movzx edx, word [ebp - 0x34]
mov ecx, dword [0x4240cc]
movsx eax, dx
movzx edx, word [ebp - 0x28]
lea eax, [eax + ecx + 0x16854a46]
imul edx, eax
mov word [ebp - 0x28], dx
inc dword [ebp - 0x34]
xor eax, eax
cmp eax, edi
jg 0x408706
mov cl, byte [eax + esi]
mov byte [ebp + eax + 0x13bc], cl
cmp cl, 0x2f
jne 0x408701
mov ecx, dword [0x4240a0]
mov dword [ebp - 0x14], ecx
fild dword [ebp - 0x14]
mov ecx, eax
fmul qword [ebp - 0x4c]
mov byte [ebp + eax + 0x13bc], 0
fstp qword [ebp - 0x4c]
fld qword [0x41f8e8]
cmp ecx, edi
jg 0x408704
fld qword [0x424588]
mov bl, byte [ecx + esi]
mov edx, ecx
fadd st(1)
sub edx, eax
mov byte [ebp + edx + 0x11bc], bl
inc ecx
fstp qword [0x424588]
xor ebx, ebx
jmp 0x4086dc
inc eax
jmp 0x4086a7
fstp st(0)
lea eax, [ebp + 0x11bc]
lea edx, [eax + 1]
nop
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408710
mov edi, dword [ebp - 0x18]
sub eax, edx
mov edx, eax
mov eax, edi
lea esi, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408723
sub eax, esi
add eax, edx
cmp eax, 0x1ff
jbe 0x408741
cmp dword [ebp + 0x1b8], 0x10
jmp 0x408efc
mov eax, edi
mov edx, edi
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408745
lea edi, [ebp + 0x11bc]
sub eax, edx
dec edi
mov cl, byte [edi + 1]
inc edi
test cl, cl
jne 0x408755
mov ecx, eax
shr ecx, 2
mov esi, edx
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
push 5
push 0x423d30
rep movsb byte es:[edi], byte [esi]
call fcn.00402a70
add esp, 8
mov esi, eax
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408781
sub eax, edx
push eax
push esi
lea ecx, [ebp + 0x1a0]
call fcn.00408150
xor eax, eax
xor ecx, ecx
mov dword [esi], eax
mov dword [ebp - 0x14], ebx
push esi
mov word [ebp - 0x34], cx
mov byte [esi + 4], al
call fcn.0040b3ab
lea eax, [ebp + 0x11bc]
add esp, 4
lea edx, [eax + 1]
lea esp, [esp]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x4087c0
sub eax, edx
push eax
lea edx, [ebp + 0x11bc]
push edx
lea ecx, [ebp + 0x1a0]
call fcn.00408440
push 0x32
push 0x4247e8
call fcn.00402a70
mov esi, eax
movzx eax, word [0x424d74]
movsx ecx, ax
mov edx, 0xdf0f4a54
sub edx, ecx
mov dword [ebp - 0x14], edx
add esp, 8
fild dword [ebp - 0x14]
fadd dword [ebp - 0x2c]
movzx eax, word [ebp - 0x1c]
movsx ecx, ax
mov dword [ebp - 0x14], ecx
fild dword [ebp - 0x14]
fmulp st(1)
call fcn.0040b5f0
mov word [ebp - 0x1c], ax
fld dword [ebp - 0x2c]
fsub qword [0x41f348]
mov eax, esi
lea edx, [eax + 1]
fstp dword [ebp - 0x2c]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408830
sub eax, edx
push eax
push esi
lea ecx, [ebp + 0x1a0]
call fcn.00408440
fld dword [0x424e70]
fsub qword [0x41f348]
fstp dword [0x424e70]
fld dword [0x424e70]
call fcn.0040b5f0
push 0x32
mov word [ebp - 0x1c], ax
xor edx, edx
push ebx
mov dword [ebp - 0x14], ebx
push esi
mov word [ebp - 0x34], dx
call fcn.0040b6e0
push esi
call fcn.0040b3ab
lea eax, [ebp + 0x13bc]
add esp, 0x10
lea edx, [eax + 1]
jmp 0x408890
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408890
sub eax, edx
push eax
lea eax, [ebp + 0x13bc]
push eax
lea ecx, [ebp + 0x1a0]
call fcn.00408440
push 5
push 0x424168
call fcn.00402a70
add esp, 8
mov esi, eax
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x4088c0
sub eax, edx
push eax
push esi
lea ecx, [ebp + 0x1a0]
call fcn.00408440
xor eax, eax
xor ecx, ecx
mov dword [esi], eax
mov dword [ebp - 0x14], ebx
push esi
mov word [ebp - 0x34], cx
mov byte [esi + 4], al
call fcn.0040b3ab
add esp, 4
lea edx, [ebp]
push edx
push 0x202
call sub.WS2_32.dll_WSAStartup
test eax, eax
je 0x40890d
cmp dword [ebp + 0x1b8], 0x10
jmp 0x408efc
push 6
push 1
push 2
call sub.WS2_32.dll_socket
mov esi, eax
mov dword [ebp - 0x14], esi
cmp esi, 0xffffffff
jne 0x408940
call sub.WS2_32.dll_WSACleanup
cmp dword [ebp + 0x1b8], 0x10
jb 0x408f0d
mov ecx, dword [ebp + 0x1a4]
push ecx
jmp 0x408f05
cmp dword [ebp + 0x1458], ebx
je 0x408961
push 4
lea edx, [ebp + 0x1458]
push edx
push 0x1006
push 0xffff
push esi
call sub.WS2_32.dll_setsockopt
lea eax, [ebp + 0x13bc]
push eax
call sub.WS2_32.dll_gethostbyname
cmp eax, ebx
je 0x408927
mov edx, 2
mov word [ebp + 0x190], dx
add dword [ebp - 0x38], 0xb1db0f4
mov eax, dword [eax + 0xc]
mov ecx, dword [eax]
mov edx, dword [ecx]
push edx
call sub.WS2_32.dll_inet_ntoa
push eax
call sub.WS2_32.dll_inet_addr
push 0x50
mov dword [ebp + 0x194], eax
call sub.WS2_32.dll_htons
mov word [ebp + 0x192], ax
mov edi, 0x10
push edi
lea eax, [ebp + 0x190]
push eax
push esi
call sub.WS2_32.dll_connect
cmp eax, 0xffffffff
jne 0x4089db
cmp dword [ebp + 0x1b8], edi
jb 0x408f0d
mov ecx, dword [ebp + 0x1a4]
push ecx
jmp 0x408f05
inc word [0x424220]
mov dx, word [0x424220]
fld qword [0x424ea0]
mov ecx, dword [0x42313c]
movsx eax, dx
sub eax, ecx
add eax, 0x151404ca
mov dword [ebp - 0x18], eax
fild dword [ebp - 0x18]
fucompp
fnstsw ax
fld qword [0x424ea0]
fsub qword [0x41f348]
fstp qword [0x424ea0]
test ah, 0x44
jnp 0x408a36
movzx edx, word [0x423118]
imul edx, edx, 0x3908bad6
mov word [0x423118], dx
jmp 0x408a6b
mov ax, word [ebp - 0x24]
movsx ecx, ax
mov edx, 0x6f4914c
sub edx, ecx
add edx, dword [0x424794]
cmp edx, 0x8c4eb980
jl 0x408a6b
mov ax, word [ebp - 0x20]
movsx ecx, ax
sub ecx, 0x5eb426b4
mov dword [ebp - 0x18], ecx
fild dword [ebp - 0x18]
fstp dword [0x4247d8]
mov eax, dword [ebp + 0x1a4]
cmp dword [ebp + 0x1b8], edi
jae 0x408a7f
lea eax, [ebp + 0x1a4]
mov edx, dword [ebp + 0x1b4]
push ebx
push edx
push eax
push esi
call sub.WS2_32.dll_send
fld qword [0x425fa8]
fld1
mov ecx, eax
fsub st(1), st(0)
fxch st(1)
fstp qword [0x425fa8]
fld qword [0x425fa8]
mov ax, word [ebp - 0x30]
movsx edx, ax
mov dword [ebp - 0x18], edx
fild dword [ebp - 0x18]
fsubp st(1)
fsub qword [ebp - 0x44]
fcomp qword [0x41f8e0]
fnstsw ax
fsubr qword [ebp - 0x44]
fstp qword [ebp - 0x44]
test ah, 1
jne 0x408b07
fld dword [0x424e6c]
mov ax, word [0x424e88]
fsubr qword [0x41f8d8]
movsx edx, ax
sub edx, 0x2caad440
mov dword [ebp - 0x18], edx
fild dword [ebp - 0x18]
fcompp
fnstsw ax
test ah, 5
jp 0x408b07
inc dword [ebp - 0x1c]
mov ax, word [ebp - 0x1c]
fld dword [ebp - 0x2c]
mov dx, word [ebp - 0x20]
fstp st(0)
cmp ecx, dword [ebp + 0x1b4]
jae 0x408b1a
cmp dword [ebp + 0x1b8], edi
jmp 0x408efc
mov ecx, dword [ebp - 0x3c]
push ebx
push 0x41f8d0
call fcn.00408150
mov ebx, dword [ebp - 0x3c]
or edi, 0xffffffff
mov dword [ebp - 0x18], edi
fld dword [0x424fa4]
fsub qword [0x41f8c8]
fsub qword [0x41f8c0]
fld dword [0x424228]
fsub qword [ebp - 0x4c]
fcompp
fnstsw ax
fld dword [0x424fa4]
fadd qword [0x41f348]
fstp dword [0x424fa4]
test ah, 1
jne 0x408b75
movzx ecx, word [ebp - 0x24]
imul ecx, ecx, 0x29a2f507
mov word [ebp - 0x24], cx
mov eax, dword [ebp - 0x14]
push 0
push 0x1000
lea edx, [ebp + 0x1bc]
push edx
push eax
call sub.WS2_32.dll_recv
movzx ecx, word [ebp - 0x24]
movzx edx, word [0x424040]
add ecx, 0x73d4d7d9
imul ecx, edx
mov word [0x424040], cx
inc dword [ebp - 0x24]
test eax, eax
jle 0x408da3
push eax
lea eax, [ebp + 0x1bc]
push eax
mov ecx, ebx
call fcn.00408440
mov cx, word [0x4240c8]
movsx edx, cx
mov dword [ebp - 0x1c], edx
fild dword [ebp - 0x1c]
fsub qword [ebp - 0x4c]
mov eax, dword [ebp - 0x38]
mov dword [ebp - 0x38], eax
fsub qword [0x41f8b8]
fild dword [ebp - 0x38]
fmulp st(1)
call fcn.0040b5f0
mov dword [ebp - 0x38], eax
inc word [0x4240c8]
test edi, edi
jge 0x408d74
push 5
push 0x424168
call fcn.00402a70
add esp, 8
mov esi, eax
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408c10
sub eax, edx
push eax
push 0
push esi
mov ecx, ebx
call fcn.004048e0
mov edi, eax
xor eax, eax
xor ecx, ecx
mov dword [ebp - 0x1c], eax
mov dword [esi], eax
push esi
mov word [ebp - 0x34], cx
mov byte [esi + 4], al
call fcn.0040b3ab
add esp, 4
test edi, edi
jl 0x408d40
mov edx, dword [0x4247a0]
mov dword [ebp - 0x18], edx
fild dword [ebp - 0x18]
fsub dword [0x4240a8]
fcomp qword [0x41f8b0]
fnstsw ax
test ah, 0x44
jnp 0x408cdb
inc word [0x424184]
mov ax, word [0x424184]
movsx ecx, ax
mov dword [ebp - 0x18], ecx
fild dword [ebp - 0x18]
fadd dword [0x424ef4]
fadd qword [0x41f8a8]
fcomp qword [0x41f8a0]
fnstsw ax
fld dword [0x424ef4]
fsub qword [0x41f348]
fstp dword [0x424ef4]
test ah, 0x44
jnp 0x408cdb
mov dx, word [0x423dc8]
movsx eax, dx
mov dword [ebp - 0x18], eax
fild dword [ebp - 0x18]
fsub qword [0x424e18]
mov cx, word [ebp - 0x24]
movsx edx, cx
mov dword [ebp - 0x18], edx
fsub qword [0x41f898]
fild dword [ebp - 0x18]
fmulp st(1)
call fcn.0040b5f0
mov word [ebp - 0x24], ax
push ebx
add edi, 4
call fcn.00407340
add esp, 4
mov dword [ebp - 0x18], eax
test eax, eax
jge 0x408d40
push 0xb
push 0x42415c
call fcn.00402a70
mov ecx, dword [ebp - 0x3c]
add esp, 8
mov esi, eax
push 0
push esi
call fcn.00406830
push esi
push 0xb
mov ebx, eax
call fcn.00401940
add esp, 8
test ebx, ebx
jge 0x408da0
fld dword [ebp - 0x2c]
fsub qword [0x41f348]
fstp dword [ebp - 0x2c]
fld dword [ebp - 0x2c]
fsub qword [0x41f890]
call fcn.0040b5f0
mov ebx, dword [ebp - 0x3c]
mov word [ebp - 0x1c], ax
mov ax, word [ebp - 0x28]
movsx ecx, ax
cmp ecx, 0xef8d45da
jl 0x408d74
fld dword [0x424180]
fld qword [ebp - 0x4c]
fsub qword [0x41f888]
fadd qword [0x41f880]
fcompp
fnstsw ax
test ah, 1
jne 0x408d74
mov dx, word [0x423d38]
mov ecx, dword [ebp - 0x18]
test ecx, ecx
jl 0x408d84
mov eax, dword [ebx + 0x14]
sub eax, edi
cmp eax, ecx
jae 0x408da3
cmp dword [ebp + 0x1458], 0
je 0x408b31
cmp dword [ebx + 0x14], 0x4000
jb 0x408b31
jmp 0x408da3
mov ebx, dword [ebp - 0x3c]
mov eax, dword [ebp - 0x14]
push eax
call sub.WS2_32.dll_closesocket
call sub.WS2_32.dll_WSACleanup
test edi, edi
jl 0x408e09
fld qword [0x424190]
fsub qword [0x41f348]
fstp qword [0x424190]
fld qword [0x424190]
mov cx, word [ebp - 0x20]
movsx edx, cx
mov dword [ebp - 0x14], edx
fild dword [ebp - 0x14]
faddp st(1)
call fcn.0040b5f0
push edi
mov word [ebp - 0x20], ax
push 0
mov ecx, ebx
call fcn.004067a0
mov ax, word [ebp - 0x24]
movsx ecx, ax
mov edx, 0xcd5c6fda
sub edx, ecx
mov dword [ebp - 0x14], edx
fild dword [ebp - 0x14]
fstp qword [0x423d88]
mov dl, byte [ebp + 0x1454]
mov esi, 0x10
test dl, dl
je 0x408e46
xor eax, eax
lea ebx, [ebx]
cmp eax, dword [ebx + 0x14]
jae 0x408e46
cmp dword [ebx + 0x18], esi
jb 0x408e2f
mov ecx, dword [ebx + 4]
jmp 0x408e32
lea ecx, [ebx + 4]
xor byte [eax + ecx], dl
movzx ecx, word [ebp - 0x30]
add ecx, 0x41dca
mov word [ebp - 0x30], cx
inc eax
jmp 0x408e20
mov dx, word [0x4245dc]
movsx eax, dx
mov dword [ebp - 0x14], eax
fild dword [ebp - 0x14]
fsub qword [0x425fa8]
mov cx, word [0x42418c]
mov edx, dword [ebp - 0x38]
movsx eax, cx
add edx, eax
mov dword [ebp - 0x14], edx
fild dword [ebp - 0x14]
fcompp
fnstsw ax
fld qword [0x425fa8]
fadd qword [0x41f348]
fstp qword [0x425fa8]
test ah, 0x41
jp 0x408ecf
mov ax, word [0x4245dc]
mov ecx, dword [0x423dc0]
dec dword [0x423dc0]
cwde
add ecx, eax
cmp ecx, 0x9009a77
jle 0x408ef6
mov edx, dword [0x4230dc]
movzx ecx, word [0x424110]
mov eax, 0x518a1f6b
sub eax, edx
imul ecx, eax
mov word [0x424110], cx
inc dword [0x4230dc]
jmp 0x408ef6
mov edx, dword [0x425f74]
mov dword [ebp - 0x14], edx
fild dword [ebp - 0x14]
fld dword [ebp - 0x2c]
fsub qword [0x41f878]
fsub qword [0x41f870]
fsubp st(1)
call fcn.0040b5f0
mov dword [0x425f74], eax
cmp dword [ebp + 0x1b8], esi
jb 0x408f0d
mov eax, dword [ebp + 0x1a4]
push eax
call fcn.0040afb6
add esp, 4
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp + 0x143c]
xor ecx, ebp
call fcn.0040b5d5
add ebp, 0x1440
mov esp, ebp
pop ebp
ret