EMO Style ForumPro - Hos Geldiniz
Socket Tutorial Uyeols10

Join the forum, it's quick and easy

EMO Style ForumPro - Hos Geldiniz
Socket Tutorial Uyeols10
EMO Style ForumPro - Hos Geldiniz
Would you like to react to this message? Create an account in a few clicks or log in to continue.
Giriş yap

Şifremi unuttum

Istatistikler
Toplam 203 kayıtlı kullanıcımız var
Son kaydolan kullanıcımız: crayzboy76

Kullanıcılarımız toplam 1186 mesaj attılar bunda 862 konu
Tarıyıcı
 Kapı
 Indeks
 Üye Listesi
 Profil
 SSS
 Arama
Arama
 
 

Sonuç :
 


Rechercher çıkıntı araştırma

RSS akısı


Yahoo! 
MSN 
AOL 
Netvibes 
Bloglines 


Anahtar-kelime

pointer  kutu  loot  

Kimler hatta?
Toplam 2 kullanıcı online :: 0 Kayıtlı, 0 Gizli ve 2 Misafir :: 1 Arama motorları

Yok

[ Bütün listeye bak ]


Sitede bugüne kadar en çok 217 kişi C.tesi Tem. 29, 2017 1:46 am tarihinde online oldu.
En son konular
» İnternetten Para Kazandıran Oyun ! Ödeme Alt Limiti Yok ! DEV KONU
Socket Tutorial I_icon_minitimeCuma Ağus. 29, 2014 8:33 am tarafından Hello EMO

» goldenchase.net maden yaparak para kazanma
Socket Tutorial I_icon_minitimeCuma Ağus. 29, 2014 8:18 am tarafından Hello EMO

» etichal hacker görsel egitim seti
Socket Tutorial I_icon_minitimeÇarş. Ağus. 06, 2014 4:57 am tarafından Hello EMO

» KO TBL Source C#
Socket Tutorial I_icon_minitimePtsi Ara. 09, 2013 6:36 am tarafından Hello EMO

» x86 Registers
Socket Tutorial I_icon_minitimeC.tesi Ağus. 24, 2013 5:02 am tarafından Hello EMO

» [Tutorial] Pegando Address, Pointers de WYD
Socket Tutorial I_icon_minitimeÇarş. Tem. 10, 2013 7:25 am tarafından Hello EMO

» [Tutorial] Pegando Address, Pointers de CS Metodo²
Socket Tutorial I_icon_minitimeÇarş. Tem. 10, 2013 7:23 am tarafından Hello EMO

» [Tutorial] Aprendendo basico deASM OLLYDBG
Socket Tutorial I_icon_minitimeÇarş. Tem. 10, 2013 7:22 am tarafından Hello EMO

» Basic C# DLL injector
Socket Tutorial I_icon_minitimePtsi Tem. 08, 2013 7:48 am tarafından Hello EMO

Reklam

Socket Tutorial

Aşağa gitmek

Socket Tutorial Empty Socket Tutorial

Mesaj tarafından Hello EMO Çarş. Mart 02, 2011 3:38 am

[quote='xanphirex']
in order to use the Winsock API you have to link to the
libraries mpr.lib and wsock32.lib

Kod:


#pragma comment(lib,"Ws2_32")
#include <iostream>
#include <winsock2.h>

after that you will probably want Declare a couple variables for your server and port
Kod:

using namespace std;

int main()
{
   char *server ="74.124.224.180";
   int port = 80;
Now after that you have to initialize WSA witch im pretty sure stands for WinsockApi feel free to correct me if im wrong but the point is you need it
Kod:

WSADATA wsadata;
WSAStartup(MAKEWORD(2,0), &wsadata);
Now after we have initialized Winsock we have to create our socket.

Kod:

SOCKET sock;
SOCKADDR_IN sin;
sock = socket(AF_INET, SOCK_STREAM, 0);

ok now we have made a usable socket so lets use it to connect to google witch is the ip address assigned the variable server.
Kod:

sin.sin_addr.s_addr   = inet_addr(server);
sin.sin_family   = AF_INET;
sin.sin_port   = htons(port);
connect(sock, (SOCKADDR *)&sin, sizeof(sin));
now we write a simple if statement to see if we have successfully connected.
Kod:

if(sock == SOCKET_ERROR)
   {
   cout<<" socket has failed to connect";
   }
   else
   {
   cout<< "Connected!\n";
   }
and thats it Done ! hope this was helpful

and here is the full source
Kod:

#pragma comment(lib,"Ws2_32")
#include <iostream>
#include <winsock2.h>

using namespace std;

int main()
{
   char *server ="74.124.224.180";
   int port = 80;

   WSADATA wsadata;

   WSAStartup(MAKEWORD(2,0), &wsadata);

   SOCKET sock;
   
   SOCKADDR_IN sin;

   sock = socket(AF_INET, SOCK_STREAM, 0);

   sin.sin_addr.s_addr   = inet_addr(server);

   sin.sin_family   = AF_INET;

   sin.sin_port   = htons(port);

   connect(sock, (SOCKADDR *)&sin, sizeof(sin));

   if(sock == SOCKET_ERROR)
   {
   cout<<" socket has failed to connect";
   }
   else
   {
   cout<< "Connected!\n";
   }
   system("pause");
}


[/quote]
Hello EMO
Hello EMO
EMO Team
EMO Team

Cinsiyet : Erkek
Burçlar : Yay
Yılan
Mesaj Sayısı : 935
Puan : 374593
Rep Puanı : 18
Doğum tarihi : 28/11/89
Kayıt tarihi : 21/07/09
Yaş : 34
Nerden : EMO WorlD
İş/Hobiler : RCE Student / Game Hacking / Learn Beginner C#,C++,Delphi
Lakap : EMO

https://emostyle.yetkinforum.com

Sayfa başına dön Aşağa gitmek

Sayfa başına dön

- Similar topics

 
Bu forumun müsaadesi var:
Bu forumdaki mesajlara cevap veremezsiniz