亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? windows internet programming part1.html

?? a collection of mega hacking tools
?? HTML
?? 第 1 頁 / 共 5 頁
字號:
Here we have chosen to display the result in a messagebox tough rather than a text file.



The result should be a message box with caption, "Port" and text saying Port 80 = 20480.





5.3 EXPLORING WINSOCK FUNCTIONS

=======================================





/* <---- SOURCE CODE STARTS HERE ----> */





#include <windows.h>

#include <stdio.h>

 

WSADATA  ws;

DWORD    wsock;



char       msge[200];





LRESULT CALLBACK recall (HWND, UINT, WPARAM, LPARAM);



int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCmdLine, int iCmdShow)



{

      static TCHAR szAppName[] = TEXT("Interface");



      HWND      	hwnd;

      MSG      	msg;

      WNDCLASS      wndclass;



      wndclass.style      	= CS_HREDRAW | CS_VREDRAW;

      wndclass.lpfnWndProc    = recall;

      wndclass.cbClsExtra     = 0;

      wndclass.cbWndExtra     = 0;

      wndclass.hInstance      = hInstance;

      wndclass.hIcon      	= LoadIcon (NULL, IDI_APPLICATION);

      wndclass.hCursor      	= LoadCursor (NULL, IDC_ARROW);

      wndclass.hbrBackground  = (HBRUSH) GetStockObject (WHITE_BRUSH);

      wndclass.lpszMenuName   = NULL;

      wndclass.lpszClassName  = "Interface";

      



      RegisterClass (&wndclass);



      hwnd = CreateWindow (szAppName,      	// Windows Class Name

      	      	 "Interface",      	// Windows Caption

      	      	 WS_OVERLAPPEDWINDOW,   // Windows Style

      	      	 CW_USEDEFAULT,      	// initial x position

      	      	 CW_USEDEFAULT,      	// initial y position

      	      	 200,      	      	// initial x size

      	      	 200,      	      	// initial y size

      	      	 0,      	      	// parent window handle

      	      	 0,      	      	// parent menu handle

      	      	 hInstance,      	      // program instance handle

      	      	 0);      	      	// creation parameters





      ShowWindow(hwnd, iCmdShow);



      while (GetMessage (&msg, NULL, 0, 0))

      {

      	DispatchMessage  (&msg);

      }

      return 1;



}





LRESULT CALLBACK recall (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)

{

if (message == WM_LBUTTONDOWN)

{



      wsock = WSAStartup(0x0101,&ws);



      sprintf(msge,"wsock..%ld",wsock);

      MessageBox(0,msge,msge,0);



      sprintf(msge,"wVersion....%d",ws.wVersion);

      MessageBox(0,msge,msge,0);



      sprintf(msge,"wHighVersion....%d",ws.wHighVersion);

      MessageBox(0,msge,msge,0);



      sprintf(msge,"szDescription....%s",&ws.szDescription);

      MessageBox(0,msge,msge,0);



      sprintf(msge,"szSystemStatus....%s",&ws.szSystemStatus);

      MessageBox(0,msge,msge,0);



      sprintf(msge,"iMaxSockets....%u",ws.iMaxSockets);

      MessageBox(0,msge,msge,0);



      sprintf(msge,"iMaxUdpDg....%u",ws.iMaxUdpDg);

      MessageBox(0,msge,msge,0);



      sprintf(msge,"lpVendorInfo....%s",ws.lpVendorInfo);

      MessageBox(0,msge,msge,0);



      MessageBox(0,"Finished","End",0);



      WSACleanup();



}



      if (message == WM_DESTROY)

      	PostQuitMessage(0);



      return DefWindowProc(hwnd, message, wParam, lParam);

}





/* <---- SOURCE CODE ENDS HERE ----> */







This program calls several functions of winsock and displays the results to us in message box's.

These can be handy if, for example I wanted to tell some-1 what version of winsock there running I

would call &ws.szDescription which in my case would say Winsock 2.0, in a nicely human readable value.







[ EXERCISES ]



Look trough the file winsock.h in your compiler include folder. See what else there is in winsock

that can be demonstrated in these kinds of programs.



________________________________________________________________________________________________________



6.0 Common Internet programs

=======================================



In this section were going to build a few common internet applications using the information that

we have learnt so far.



These programs are:



1. DNS      	-  Gets a hostname and returns its IP address.

2. Portscan      	-  Gets port numbers and tells user whether there open or not.

3. Nuke      	-  Sends OOB data to a listening port.







6.1 DNS

=======================================





/* <---- SOURCE CODE STARTS HERE ----> */



#include <windows.h>

#include <tchar.h>

#include <stdio.h>



int CDECL MessageBoxPrintf (TCHAR * szCaption, TCHAR * szFormat, ...)

{

      TCHAR      szBuffer [1024];

      va_list pArgList;



      va_start (pArgList, szFormat);



      _vsntprintf (szBuffer, sizeof (szBuffer) / sizeof (TCHAR),

      	      szFormat, pArgList);



      va_end (pArgList);



      return MessageBox (NULL, szBuffer, szCaption, 0);



}



          WSADATA  wsdata;

      SOCKET   sock; 

      DWORD    wsock;



LRESULT CALLBACK recall (HWND, UINT, WPARAM, LPARAM);



int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCmdLine, int iCmdShow)



{

      static TCHAR szAppName[] = TEXT("Interface");



      HWND      	hwnd;

      MSG      	msg;

      WNDCLASS      wndclass;



      wndclass.style      	= CS_HREDRAW | CS_VREDRAW;

      wndclass.lpfnWndProc    = recall;

      wndclass.cbClsExtra     = 0;

      wndclass.cbWndExtra     = 0;

      wndclass.hInstance      = hInstance;

      wndclass.hIcon      	= LoadIcon (NULL, IDI_APPLICATION);

      wndclass.hCursor      	= LoadCursor (NULL, IDC_ARROW);

      wndclass.hbrBackground  = (HBRUSH) GetStockObject (WHITE_BRUSH);

      wndclass.lpszMenuName   = NULL;

      wndclass.lpszClassName  = "Interface";

      

      RegisterClass (&wndclass);



      hwnd = CreateWindow (szAppName,      	// Windows Class Name

      	      	 "Interface",      	// Windows Caption

      	      	 WS_OVERLAPPEDWINDOW,   // Windows Style

      	      	 CW_USEDEFAULT,      	// initial x position

      	      	 CW_USEDEFAULT,      	// initial y position

      	      	 200,      	      	// initial x size

      	      	 200,      	      	// initial y size

      	      	 0,      	      	// parent window handle

      	      	 0,      	      	// parent menu handle

      	      	 hInstance,      	      // program instance handle

      	      	 0);      	      	// creation parameters





      ShowWindow(hwnd, iCmdShow);



      while (GetMessage (&msg, NULL, 0, 0))

      {

      	DispatchMessage  (&msg);

      }

      return 1;



}





LRESULT CALLBACK recall (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)

{

if (message == WM_LBUTTONDOWN)

{



 wsock = WSAStartup(0x0101,&wsdata);

 struct hostent *h;





 h = gethostbyname("localhost");





 MessageBoxPrintf(TEXT ("Hostname"),h->h_name);



 MessageBoxPrintf(TEXT ("IP Address"),inet_ntoa(*((struct in_addr *)h->h_addr)));

 





 WSACleanup();



}



      if (message == WM_DESTROY)

      	PostQuitMessage(0);



      return DefWindowProc(hwnd, message, wParam, lParam);

}





/* <---- SOURCE CODE ENDS HERE ----> */







This program utilizes the hostent structure, like we discussed earlier, and uses the gethostbyname();

function to get the name of the host were looking for.



The hostent structure is filled up and we access the members h_name and h_addr and display them in Messagebox's.



These aren't normal message box's as normal ones wouldn't be able to display the info for them so we added

some extra code to create MessageBoxPrintf(); to emulate the consoles printf() function.







6.2 Portscan

=======================================





/* <---- SOURCE CODE STARTS HERE ----> */





#include <windows.h>

#include <stdio.h>





int CheckPortUDP(short int Port)

{

    struct sockaddr_in client;



    WSADATA wsaData;



    int Busy = 0;

    int sock;



    if(WSAStartup(0x0101, &wsaData) == 0)

    {



        client.sin_family      = AF_INET;

        client.sin_port        = htons(Port);

        client.sin_addr.s_addr = inet_addr("127.0.0.1");



        /* Check UDP Protocol */

        sock = socket(AF_INET, SOCK_DGRAM, 0);



        Busy = (bind(sock, (SOCKADDR FAR *) &client,sizeof(SOCKADDR_IN)) == SOCKET_ERROR);





        if(Busy)



        WSACleanup();

    }

    return(Busy);

}





int CheckPortTCP(short int Port)

{

    struct sockaddr_in client;



    WSADATA wsaData;



    int Busy = 0;

    int sock;



    if(WSAStartup(0x0101, &wsaData) == 0)

    {



        client.sin_family      = AF_INET;

        client.sin_port        = htons(Port);

        client.sin_addr.s_addr = inet_addr("127.0.0.1");



        sock = socket(AF_INET, SOCK_STREAM, 0);



        Busy = (connect(sock, (struct sockaddr *) &client,sizeof(client)) == 0);





        if(Busy)



        WSACleanup();

    }



    return(Busy);

}









LRESULT CALLBACK recall (HWND, UINT, WPARAM, LPARAM);



int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCmdLine, int iCmdShow)



{

      static TCHAR szAppName[] = TEXT("Interface");



      HWND      	hwnd;

      MSG      	msg;

      WNDCLASS      wndclass;



      wndclass.style      	= CS_HREDRAW | CS_VREDRAW;

      wndclass.lpfnWndProc    = recall;

      wndclass.cbClsExtra     = 0;

      wndclass.cbWndExtra     = 0;

      wndclass.hInstance      = hInstance;

      wndclass.hIcon      	= LoadIcon (NULL, IDI_APPLICATION);

      wndclass.hCursor      	= LoadCursor (NULL, IDC_ARROW);

      wndclass.hbrBackground  = (HBRUSH) GetStockObject (WHITE_BRUSH);

      wndclass.lpszMenuName   = NULL;

      wndclass.lpszClassName  = "Interface";

      

      RegisterClass (&wndclass);



      hwnd = CreateWindow (szAppName,      	// Windows Class Name

      	      	 "Interface",      	// Windows Caption

      	      	 WS_OVERLAPPEDWINDOW,   // Windows Style

      	      	 CW_USEDEFAULT,      	// initial x position

      	      	 CW_USEDEFAULT,      	// initial y position

      	      	 200,      	      	// initial x size

      	      	 200,      	      	// initial y size

      	      	 0,      	      	// parent window handle

      	      	 0,      	      	// parent menu handle

      	      	 hInstance,      	      // program instance handle

      	      	 0);      	      	// creation parameters





      ShowWindow(hwnd, iCmdShow);



      



    if(CheckPortTCP(80))



        MessageBox(0,"HTTP Server is running","HTTP",0);

    else

        MessageBox(0,"HTTP Server is down","HTTP",0);





    if(CheckPortUDP(13))



        MessageBox(0,"DayTime Server is running","DayTime",0);

    else

        MessageBox(0,"DayTime Server is down","DayTime",0);







      while (GetMessage (&msg, NULL, 0, 0))

      {

      	DispatchMessage  (&msg);

      }

      return 1;



}





LRESULT CALLBACK recall (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)

{

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩免费看的电影| 中日韩免费视频中文字幕| 精品久久免费看| 1区2区3区国产精品| 青青国产91久久久久久| 成人免费视频一区二区| 日韩毛片在线免费观看| 日本美女一区二区三区| 成人动漫一区二区在线| 日韩欧美一区二区视频| 亚洲在线视频网站| 色综合亚洲欧洲| 久久久久99精品一区| 日韩高清一区二区| 欧美视频一二三区| 亚洲欧洲日产国码二区| 成人免费看片app下载| 26uuu亚洲婷婷狠狠天堂| 亚洲成人第一页| 色诱亚洲精品久久久久久| 国产视频在线观看一区二区三区| 日本视频一区二区| 欧美在线看片a免费观看| 亚洲欧美日韩精品久久久久| 国产sm精品调教视频网站| 久久综合色鬼综合色| 美女网站视频久久| 日韩免费电影一区| 丝袜亚洲精品中文字幕一区| 欧美亚男人的天堂| 亚洲mv在线观看| 在线看不卡av| 亚洲成人777| 在线精品观看国产| 婷婷综合五月天| 9191成人精品久久| 日本成人在线网站| 亚洲精品一区二区三区福利| 青青草国产精品亚洲专区无| 91精品欧美综合在线观看最新| 偷窥少妇高潮呻吟av久久免费| 欧美日韩黄视频| 日韩精品亚洲专区| 日韩一级完整毛片| 韩国av一区二区三区在线观看| 久久久午夜精品理论片中文字幕| 国产精品综合一区二区三区| 久久久久久毛片| 国产99久久久国产精品潘金 | 国产激情偷乱视频一区二区三区| 3d成人动漫网站| 久久av中文字幕片| 国产日本欧美一区二区| eeuss鲁片一区二区三区在线看| 18欧美亚洲精品| 欧美日韩亚洲综合一区| 久久99蜜桃精品| 日本一区二区视频在线| 欧洲一区二区三区在线| 青青草国产精品97视觉盛宴| 国产日韩欧美精品综合| 欧美性受xxxx| 精品一二线国产| 中文字幕一区二区在线观看| 欧美伊人久久大香线蕉综合69| 日韩国产在线观看一区| 国产亚洲欧洲一区高清在线观看| 91社区在线播放| 美女www一区二区| 欧美国产一区二区在线观看| 在线免费观看一区| 国产毛片精品国产一区二区三区| 亚洲精选视频免费看| 欧美不卡一区二区三区四区| 成人的网站免费观看| 日本在线不卡视频一二三区| 中文字幕一区二区三区四区 | 日本精品视频一区二区三区| 日本不卡高清视频| 国产精品久久久久国产精品日日| 欧美一区在线视频| 波多野结衣的一区二区三区| 男男视频亚洲欧美| 亚洲欧美日韩国产一区二区三区| 欧美r级在线观看| 欧美亚日韩国产aⅴ精品中极品| 国产电影精品久久禁18| 肉丝袜脚交视频一区二区| 中文字幕一区二区不卡| 欧美成人伊人久久综合网| 在线精品视频免费播放| 成人午夜视频福利| 激情小说欧美图片| 亚洲成人一区在线| 一区二区三区四区中文字幕| 国产亚洲精品aa| 日韩精品一区二区三区四区| 欧美视频一区二区三区四区| 成年人国产精品| 国产精品香蕉一区二区三区| 久久99日本精品| 日韩国产在线观看一区| 亚洲一区二区欧美激情| 亚洲人被黑人高潮完整版| 国产区在线观看成人精品| 日韩精品一区二区三区视频| 欧美一二三区在线| 91麻豆精品国产综合久久久久久| 91成人网在线| 日本精品一区二区三区高清| 91视频91自| 色综合久久88色综合天天免费| 成人一道本在线| 成人高清视频免费观看| 粉嫩av一区二区三区在线播放| 国产精品一区在线观看你懂的| 国产一区激情在线| 国产又黄又大久久| 狠狠色丁香九九婷婷综合五月| 久久99精品久久久久久国产越南 | 成人午夜电影久久影院| 国产一区欧美日韩| 国产999精品久久久久久| 国产精品亚洲人在线观看| 成人黄色在线看| 91在线一区二区三区| 91蝌蚪国产九色| 在线免费精品视频| 欧美日韩国产一区二区三区地区| 欧美少妇性性性| 欧美一级艳片视频免费观看| 精品久久久久久亚洲综合网| 久久综合久久久久88| 国产视频一区二区三区在线观看| 国产精品丝袜在线| 亚洲精品欧美专区| 日韩成人免费电影| 国产一区二区久久| 波多野结衣中文一区| 在线看国产日韩| 精品伦理精品一区| 国产精品久久99| 亚洲成人1区2区| 国产精品资源在线看| 91网页版在线| 欧美一区二区三区免费大片| 国产日本欧美一区二区| 亚洲午夜免费视频| 国产一区二区电影| 欧美亚洲禁片免费| 久久久精品综合| 午夜日韩在线电影| 风间由美一区二区三区在线观看 | thepron国产精品| 欧美日韩国产片| 国产三级欧美三级| 一区二区三区成人在线视频| 麻豆精品在线播放| 色婷婷久久久久swag精品| 日韩免费观看2025年上映的电影| 亚洲欧美自拍偷拍| 久久99久久久久| 色吊一区二区三区| 久久尤物电影视频在线观看| 亚洲精品乱码久久久久久黑人| 久久97超碰色| 欧美色老头old∨ideo| 久久精品一区蜜桃臀影院| 亚洲国产cao| 成人午夜视频福利| 精品国产sm最大网站免费看| 亚洲国产一区视频| av电影天堂一区二区在线| 日韩一级二级三级精品视频| 亚洲欧洲99久久| 成人午夜激情在线| 久久久久高清精品| 久久精品国产澳门| 欧美在线观看禁18| 中文字幕一区二区三区四区| 国产精品一区久久久久| 日韩三级免费观看| 婷婷夜色潮精品综合在线| www.亚洲国产| 国产欧美日韩三级| 黑人巨大精品欧美一区| 日韩亚洲国产中文字幕欧美| 香蕉久久夜色精品国产使用方法| 波多野结衣一区二区三区| 国产日韩精品视频一区| 麻豆91小视频| 5858s免费视频成人| 亚洲成人先锋电影| 欧美日本不卡视频| 亚洲午夜久久久久久久久电影院| 91一区二区在线观看| 国产精品丝袜一区| 99精品欧美一区二区三区小说| 中文字幕 久热精品 视频在线 | 欧美一区二区三区思思人|