Please create an account to participate in the Slashdot moderation system

 



Forgot your password?
typodupeerror
Slashdot Deals: Prep for the CompTIA A+ certification exam. Save 95% on the CompTIA IT Certification Bundle ×
User Journal

Journal Ex-Linux-Fanboy's Journal: For real Slashdot users only

/*Placed in the public domain by Sam Trenholme*/
#include <arpa/inet.h>
#include <string.h>
#define Z struct sockaddr
#define Y sizeof(d)
int main(int a,char **b){long int i;char q[512],p
[17]="\xc0\f\0\x01\0\x01\0\0\0\0\0\x04";socklen_t
f=511;if(a>1){i=htonl(inet_addr(b[1]));p[15]=255&
i;struct sockaddr_in d;bzero(&d,Y);p[14]=(65280&i
)>>8;a=socket(AF_INET,SOCK_DGRAM,0);d.sin_family=
AF_INET;d.sin_port=htons(53);p[13]=(0xff0000&i)>>
16;p[12]=i>>24;bind(a,(Z*)&d,Y);for(;;){if(11<(i=
recvfrom(a,q,255,0,(Z*)&d,&f))&&q[2]>=0){q[7]++;q
[2]|=128;memcpy(q+i,p,16);sendto(a,q,i+16,0,(Z*)&
d,Y);}}}}

Note: There is a single compile-time warning when compiled with -Wall; if this bothers you, you can place 10 bytes of bloat in the form of return 0; at the end of the program (before the final })

Since you are a Slashdot user, I am sure you can figure out exactly what the above code does without needing anything wimpy like documentation.

This discussion has been archived. No new comments can be posted.

For real Slashdot users only

Comments Filter:

"Life begins when you can spend your spare time programming instead of watching television." -- Cal Keegan

Working...