91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 0M
    文件類型: .cpp
    金幣: 1
    下載: 0 次
    發布日期: 2021-06-02
  • 語言: C/C++
  • 標簽: 其他??

資源簡介

源.cpp

資源截圖

代碼片段和文件信息

#define?HAVE_REMOTE
#include?
#include?
#include?
#include?
#pragma?comment(lib?“Packet“)
#pragma?comment(lib?“wpcap“)
#pragma?comment(lib?“WS2_32“)
typedef?struct?ip_header?{
u_char?ver_ihl;?//?Version?(4?bits)?+?Internet?header?length(4?bits)?
u_char?tos;?//?Type?of?service
u_short?tlen;?//?Total?length
u_short?identification;?//?Identification
u_short?flags_fo;?//?Flags?(3?bits)?+?Fragment?offset(13?bits)?
u_char?ttl;?//?Time?to?live
u_char?proto;?//?Protocol
u_short?crc;?//?Header?checksum
u_char?saddr[4];?//?Source?address
u_char?daddr[4];?//?Destination?address
u_int?op_pad;?//?Option?+?Padding
}?ip_header;
typedef?struct?mac_header?{
u_char?dest_addr[6];
u_char?src_addr[6];
u_char?type[2];
}?mac_header;
void?packet_handler(u_char?*param?const?struct?pcap_pkthdr
*header?const?u_char?*pkt_data);
int?main()
{
pcap_if_t?*alldevs;
pcap_if_t?*d;
int?inum;
int?i?=?0;
pcap_t?*adhandle;
u_int?netmask;
struct?bpf_program?fcode;
char?errbuf[PCAP_ERRBUF_SIZE];
/*?Retrieve?the?device?list?*/
if?(pcap_findalldevs_ex(PCAP_SRC_IF_STRING?NULL?&alldevs
errbuf)?==?-1)?{
fprintf(stderr?“Error?in?pcap_findalldevs:?%s\n“
errbuf);
exit(1);
}
/*?Print?the?list?*/
for?(d?=?alldevs;?d;?d?=?d->next)?{
printf(“%d.?%s“?++i?d->name);
if?(d->description)
printf(“?(%s)\n“?d->description);
else
printf(“?(No?description?available)\n“);
}
if?(i?==?0)?{
printf(“\nNo?interfaces?found!?Make?sure?WinPcap?is?installed.\n“);
return?-1;
}
printf(“Enter?the?interface?number?(1-%d):“?i);
scanf_s(“%d“?&inum);
if?(inum??i)?{
printf(“\nInterface?number?out?of?range.\n“);
/*?Free?the?device?list?*/
pcap_freealldevs(alldevs);
return?-1;
}
/*?Jump?to?the?selected?adapter?*/
for?(d?=?alldevs?i?=?0;?inext?i++);
/*?Open?the?adapter?*/

if?((adhandle?=?pcap_open(d->name?65536?PCAP_OPENFLAG_PROMISCUOUS?1000?NULL?errbuf))?==?NULL)?{
fprintf(stderr?“\nU

評論

共有 條評論