Function at 0x408970
Capabilities:
Connect 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.0040c6d0
push 0xffffffffffffffff
push 0x41e60b
mov eax, dword fs:[0]
push eax
sub esp, 0x44
mov eax, dword [0x425fe8]
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]
xor edx, edx
mov word [ebp - 0x18], dx
mov dword [ebp - 0x2c], ebx
xor eax, eax
mov word [ebp - 0x1c], ax
fst qword [ebp - 0x50]
xor ecx, ecx
mov word [ebp - 0x34], cx
fst qword [ebp - 0x3c]
mov dword [ebp - 0x24], ebx
mov dword [ebp - 0x30], ebx
mov byte [ebp + 0x11bc], al
mov eax, esi
mov dword [ebp - 0x40], ebx
fstp qword [ebp - 0x48]
mov byte [ebp - 4], 1
lea edx, [eax + 1]
jmp 0x408a20
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408a20
sub eax, edx
mov edi, eax
cmp edi, 0x7f
jg 0x408de2
fld1
xor eax, eax
cmp eax, edi
jg 0x408ad6
fld qword [0x423d20]
mov dl, byte [eax + esi]
fstp st(0)
mov byte [ebp + eax + 0x13bc], dl
fld qword [ebp - 0x3c]
mov ecx, dword [0x4239bc]
mov dword [ebp - 0x28], ecx
fild dword [ebp - 0x28]
fsubp st(1)
fadd qword [0x423d08]
fstp qword [0x423d08]
inc dword [0x4239bc]
fld qword [ebp - 0x3c]
cmp byte [ebp + eax + 0x13bc], 0x2f
fsub st(1)
fstp qword [ebp - 0x3c]
jne 0x408ad0
mov byte [ebp + eax + 0x13bc], 0
mov ecx, eax
or ebx, 0xffffffff
cmp ecx, edi
jg 0x408ad9
mov dx, word [ebp - 0x18]
movsx edx, dx
add edx, 0x4354352
mov dword [ebp - 0x28], edx
mov edx, ecx
sub edx, eax
fild dword [ebp - 0x28]
fadd qword [0x425468]
fstp qword [0x425468]
add dword [ebp - 0x18], ebx
mov bl, byte [ecx + esi]
mov byte [ebp + edx + 0x11bc], bl
inc ecx
mov ebx, 0xffffffff
jmp 0x408a94
inc eax
jmp 0x408a38
or ebx, 0xffffffff
fld qword [0x423d08]
fld qword [str.n_n_]
fsubr qword [0x41fa10]
fcompp
fnstsw ax
fld qword [str.n_n_]
fadd st(1)
fstp qword [str.n_n_]
fld qword [0x423d08]
fadd st(1)
fstp qword [0x423d08]
test ah, 1
jne 0x408b68
mov eax, dword [ebp - 0x24]
mov dword [ebp - 0x28], eax
fild dword [ebp - 0x28]
fadd dword [0x423b08]
fcomp qword [0x41fa08]
fnstsw ax
fld dword [0x423b08]
fadd st(1)
fstp dword [0x423b08]
add dword [ebp - 0x24], ebx
test ah, 1
jne 0x408b68
inc word [0x4256ac]
mov cx, word [0x425578]
fld qword [0x425790]
mov dx, word [0x4256ac]
fstp st(0)
fadd qword [0x425790]
fstp qword [0x425790]
jmp 0x408b6a
fstp st(0)
lea eax, [ebp + 0x11bc]
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408b73
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 0x408b86
sub eax, esi
add eax, edx
cmp eax, 0x1ff
jbe 0x408bb1
cmp dword [ebp + 0x1b8], 0x10
jb 0x408de2
mov eax, dword [ebp + 0x1a4]
push eax
jmp 0x408dda
mov eax, edi
mov edx, edi
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408bb5
lea edi, [ebp + 0x11bc]
sub eax, edx
add edi, ebx
mov cl, byte [edi + 1]
inc edi
test cl, cl
jne 0x408bc6
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 0x423cec
rep movsb byte es:[edi], byte [esi]
call fcn.004023a0
add esp, 8
mov esi, eax
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408bf2
sub eax, edx
push eax
push esi
lea ecx, [ebp + 0x1a0]
call fcn.00408750
xor eax, eax
xor ecx, ecx
mov word [ebp - 0x18], cx
xor edi, edi
mov dword [esi], eax
push esi
mov dword [ebp - 0x14], edi
mov byte [esi + 4], al
call fcn.0040b18b
lea eax, [ebp + 0x11bc]
add esp, 4
lea edx, [eax + 1]
lea esp, [esp]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408c30
sub eax, edx
push eax
lea edx, [ebp + 0x11bc]
push edx
lea ecx, [ebp + 0x1a0]
call fcn.00408830
fld qword [ebp - 0x3c]
fsub qword [0x41fa00]
mov eax, dword [ebp - 0x2c]
mov dword [ebp - 0x14], eax
fsub qword [0x41f9f8]
fild dword [ebp - 0x14]
faddp st(1)
call fcn.0040b450
mov dword [ebp - 0x2c], eax
fld qword [ebp - 0x3c]
fadd qword [0x41f348]
push 0x32
push 0x4239c8
fstp qword [ebp - 0x3c]
call fcn.004023a0
add esp, 8
mov esi, eax
lea edx, [eax + 1]
mov edi, edi
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408c90
sub eax, edx
push eax
push esi
lea ecx, [ebp + 0x1a0]
call fcn.00408830
push 0x32
xor ecx, ecx
push edi
mov word [ebp - 0x18], cx
push esi
mov dword [ebp - 0x14], edi
call fcn.0040b220
push esi
call fcn.0040b18b
lea eax, [ebp + 0x13bc]
add esp, 0x10
lea edx, [eax + 1]
lea ebx, [ebx]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408cd0
sub eax, edx
push eax
lea edx, [ebp + 0x13bc]
push edx
lea ecx, [ebp + 0x1a0]
call fcn.00408830
mov eax, dword [ebp - 0x24]
mov dword [ebp - 0x14], eax
fild dword [ebp - 0x14]
push 5
mov edi, 1
push 0x425714
fmul qword [ebp - 0x3c]
fstp qword [ebp - 0x3c]
add dword [ebp - 0x24], edi
call fcn.004023a0
mov ecx, dword [ebp - 0x30]
mov edx, 0x15fc32b5
sub edx, ecx
add edx, dword [ebp - 0x40]
add esp, 8
mov dword [ebp - 0x40], edx
add dword [ebp - 0x30], ebx
mov esi, eax
lea edx, [eax + 1]
lea ebx, [ebx]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408d30
sub eax, edx
push eax
push esi
lea ecx, [ebp + 0x1a0]
call fcn.00408830
fld qword [0x4256e0]
fadd qword [0x41f348]
xor eax, eax
push esi
fstp qword [0x4256e0]
fld qword [0x4256e0]
fsub qword [0x41f9f0]
fsub qword [0x41f9e8]
fstp dword [0x425bec]
mov word [ebp - 0x18], ax
mov dword [esi], eax
mov dword [ebp - 0x14], eax
mov byte [esi + 4], al
call fcn.0040b18b
add esp, 4
lea ecx, [ebp]
push ecx
push 0x202
call sub.WS2_32.dll_WSAStartup
test eax, eax
jne 0x408dca
push 6
push edi
push 2
call sub.WS2_32.dll_socket
mov esi, eax
mov dword [ebp - 0x28], esi
cmp esi, ebx
jne 0x408e07
add dword [0x425730], edi
mov eax, dword [0x425730]
mov ecx, 0x95150d47
sub ecx, eax
mov word [0x423be0], cx
call sub.WS2_32.dll_WSACleanup
cmp dword [ebp + 0x1b8], 0x10
jb 0x408de2
mov edx, dword [ebp + 0x1a4]
push edx
call fcn.0040ad9e
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.0040b436
add ebp, 0x1440
mov esp, ebp
pop ebp
ret
cmp dword [ebp + 0x1458], 0
je 0x408e29
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
je 0x408dca
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 0x408e8e
cmp dword [ebp + 0x1b8], edi
jmp 0x408b9f
mov cx, word [0x423d18]
movsx edx, cx
mov dword [ebp - 0x14], edx
fild dword [ebp - 0x14]
fadd qword [ebp - 0x48]
fadd qword [0x41f9e0]
call fcn.0040b450
mov dword [0x423ad8], eax
add word [0x423d18], bx
mov eax, dword [ebp + 0x1a4]
cmp dword [ebp + 0x1b8], edi
jae 0x408ecc
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 0x408f13
mov dx, word [str.q_bK]
movsx eax, dx
mov ecx, 0x5abd35e2
sub ecx, eax
mov dword [ebp - 0x14], ecx
fild dword [ebp - 0x14]
fmul qword [ebp - 0x48]
fstp qword [ebp - 0x48]
add word [str.q_bK], bx
cmp dword [ebp + 0x1b8], edi
jmp 0x408dd1
mov ecx, dword [ebp - 0x20]
push 0
push 0x41f9d8
call fcn.00408750
or edi, 0xffffffff
or ebx, edi
jmp 0x408f32
fstp st(0)
mov ecx, dword [ebp - 0x28]
push 0
push 0x1000
lea eax, [ebp + 0x1bc]
push eax
push ecx
call sub.WS2_32.dll_recv
test eax, eax
jle 0x409175
mov edx, dword [0x425cd0]
mov ecx, dword [ebp - 0x20]
push eax
lea eax, [ebp + 0x1bc]
add edx, 0x5e4d3e98
push eax
mov word [ebp - 0x1c], dx
call fcn.00408830
test edi, edi
jge 0x409109
push 5
push 0x425714
call fcn.004023a0
add esp, 8
mov esi, eax
lea edx, [eax + 1]
lea ecx, [ecx]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408f90
mov ecx, dword [ebp - 0x20]
sub eax, edx
push eax
push 0
push esi
call fcn.00404b60
mov cx, word [ebp - 0x1c]
movsx edx, cx
add edx, 0x4f284f4c
mov dword [ebp - 0x14], edx
mov edi, eax
xor eax, eax
fild dword [ebp - 0x14]
push esi
fadd qword [ebp - 0x3c]
fstp dword [0x425ef4]
mov word [ebp - 0x18], ax
mov dword [esi], eax
mov dword [ebp - 0x14], eax
mov byte [esi + 4], al
call fcn.0040b18b
add esp, 4
test edi, edi
jl 0x409109
mov ecx, dword [ebp - 0x20]
push ecx
add edi, 4
call fcn.00407150
mov ebx, eax
add esp, 4
mov dword [ebp - 0x18], ebx
test ebx, ebx
jge 0x4090e5
add dword [0x425778], 0x83213d1b
push 0xb
push 0x424950
call fcn.004023a0
mov ecx, dword [ebp - 0x20]
add esp, 8
mov esi, eax
push 0
push esi
call fcn.00406f70
push esi
push 0xb
mov ebx, eax
call fcn.004010c0
add esp, 8
test ebx, ebx
jge 0x409175
fld qword [ebp - 0x50]
fld1
fadd st(1), st(0)
fxch st(1)
fstp qword [ebp - 0x50]
mov dx, word [0x425720]
mov ecx, dword [ebp - 0x24]
movsx eax, dx
add eax, 0x478a4bb5
mov dword [ebp - 0x14], eax
mov edx, 0x3f41bcd7
sub edx, ecx
fild dword [ebp - 0x14]
mov dword [ebp - 0x14], edx
fild dword [ebp - 0x14]
fld qword [ebp - 0x50]
inc word [0x425720]
fsubp st(2)
fcompp
fnstsw ax
test ah, 0x41
jp 0x4090ce
mov ax, word [0x423a8c]
movsx ecx, ax
mov dword [ebp - 0x14], ecx
fild dword [ebp - 0x14]
fld qword [0x423a28]
mov edx, dword [0x42552c]
fsub qword [0x41f9d0]
mov dword [ebp - 0x14], edx
fild dword [ebp - 0x14]
fsubp st(1)
fsubp st(1)
call fcn.0040b450
mov ebx, dword [ebp - 0x18]
mov word [0x423a8c], ax
dec dword [0x42552c]
fld qword [0x423a28]
fadd st(1)
fstp qword [0x423a28]
jmp 0x4090e7
fld qword [0x423a70]
mov ebx, dword [ebp - 0x18]
fsubr qword [0x41f9c8]
fstp dword [0x423a24]
jmp 0x4090e7
fld1
mov eax, dword [0x423aac]
mov dword [ebp - 0x14], eax
fild dword [ebp - 0x14]
fadd qword [ebp - 0x48]
call fcn.0040b450
mov dword [0x423aac], eax
fld qword [ebp - 0x48]
fadd st(1)
fstp qword [ebp - 0x48]
jmp 0x40910b
fld1
test ebx, ebx
jl 0x40911b
mov ecx, dword [ebp - 0x20]
mov eax, dword [ecx + 0x14]
sub eax, edi
cmp eax, ebx
jae 0x409173
fld dword [0x425630]
fadd st(1)
fstp dword [0x425630]
fld dword [0x425630]
fsub qword [0x41f9c0]
fmul qword [0x425588]
cmp dword [ebp + 0x1458], 0
fstp qword [0x425588]
je 0x40928a
mov dx, word [0x425bfc]
movzx ecx, word [ebp - 0x34]
movsx eax, dx
mov edx, dword [ebp - 0x20]
imul ecx, eax
cmp dword [edx + 0x14], 0x4000
mov word [ebp - 0x34], cx
jb 0x40928a
fstp st(0)
dec dword [ebp - 0x2c]
mov eax, dword [ebp - 0x2c]
mov edx, dword [ebp - 0x28]
mov ecx, 0x20be539d
sub ecx, eax
add ecx, dword [0x4233f8]
push edx
mov dword [0x4233f8], ecx
call sub.WS2_32.dll_closesocket
mov eax, dword [ebp - 0x24]
mov ecx, dword [ebp - 0x40]
lea edx, [ecx + eax + 0x28395e34]
mov dword [ebp - 0x24], edx
call sub.WS2_32.dll_WSACleanup
test edi, edi
jl 0x4091cc
push edi
mov edi, dword [ebp - 0x20]
push 0
mov ecx, edi
call fcn.00406ee0
movzx eax, word [ebp - 0x1c]
sub eax, 0x1747ffb1
mov word [ebp - 0x1c], ax
jmp 0x4091cf
mov edi, dword [ebp - 0x20]
mov bl, byte [ebp + 0x1454]
test bl, bl
je 0x409224
xor esi, esi
jmp 0x4091e0
cmp esi, dword [edi + 0x14]
jae 0x409224
fld dword [0x425534]
mov ecx, dword [ebp - 0x2c]
mov edx, 0x80a5e53c
sub edx, ecx
mov dword [ebp - 0x14], edx
fisub dword [ebp - 0x14]
fstp dword [0x425534]
cmp esi, dword [edi + 0x14]
jbe 0x40920b
call fcn.0040bf99
cmp dword [edi + 0x18], 0x10
jb 0x40921a
mov eax, dword [edi + 4]
xor byte [eax + esi], bl
inc esi
jmp 0x4091e0
xor byte [edi + esi + 4], bl
lea eax, [edi + 4]
inc esi
jmp 0x4091e0
fld qword [0x425c40]
fadd qword [ebp - 0x50]
mov eax, dword [0x4254f8]
mov dword [ebp - 0x14], eax
fild dword [ebp - 0x14]
fsubp st(1)
fcomp qword [0x41f9b8]
fnstsw ax
fld qword [0x425c40]
fsub qword [0x41f348]
fstp qword [0x425c40]
test ah, 0x41
jne 0x409271
fld dword [0x425c14]
fadd qword [0x41f9b0]
fadd dword [0x423aa8]
fstp dword [0x423aa8]
cmp dword [ebp + 0x1b8], 0x10
jb 0x408de2
mov ecx, dword [ebp + 0x1a4]
push ecx
jmp 0x408dda
mov eax, dword [0x42557c]
mov dx, word [0x42493c]
movsx ecx, dx
add eax, 0xe4f1755c
cmp ecx, eax
jl 0x408f30
mov edx, dword [0x425558]
mov dword [ebp - 0x14], edx
fild dword [ebp - 0x14]
fadd qword [0x423a10]
mov eax, dword [ebp - 0x30]
mov dword [ebp - 0x14], eax
fild dword [ebp - 0x14]
fmulp st(1)
call fcn.0040b450
mov dword [ebp - 0x30], eax
fadd qword [0x423a10]
fstp qword [0x423a10]
inc dword [0x425558]
jmp 0x408f32