我是C ++的新手,我正在尝试编译这个应用程序但是我收到一个错误:'语法错误:意外类型'P_HDR'。如果您需要更多代码,请告诉我,所有代码都可以在http://www.binarytides.com/blog/raw-sockets-packets-with-winpcap/
看到pseudo_header.source_address = inet_addr("1.2.3.4"); //forge it >:) srcip.s_addr;
pseudo_header.dest_address = inet_addr("203.200.89.200");
pseudo_header.placeholder = 0;
pseudo_header.protocol = IPPROTO_TCP;
pseudo_header.tcp_length = htons(sizeof(TCP_HDR) + strlen(dump));
memcpy(&pseudo_header.tcp , tcphdr , sizeof TCP_HDR);
unsigned char *seudo;
seudo = new unsigned char(sizeof P_HDR + strlen(dump));
memcpy(seudo, &pseudo_header, sizeof P_HDR);
memcpy(seudo + sizeof P_HDR , data , strlen(dump));
此行是错误
seudo = new unsigned char(sizeof P_HDR + strlen(dump));
答案 0 :(得分:2)
你可能在“P_HDR”之前错过了“TC”吗?