联盟域名:www.cn-dos.net 论坛域名:www.cn-dos.net/forum DOS,代表着自由开放与发展,我们努力起来,学习FreeDOS和Linux的自由开放与GNU精神,共同创造和发展美好的自由与GNU GPL世界吧!
C:\>mawk "BEGIN{for(k=43;k<=90;k++){m=sprintf(\"%c\",k);n2i[m]=k};for(i=1;i==1;){printf \"\nPlease enter the SN: \";getline;if(length($0)<8){print \"SN must more than 8 characters\";continue};for(j=1;j<=length($0);j++){if (substr($0,j,1)!~/[0-9A-Z]/){print \"All characters must in [0-9A-Z]!!!\";break}};if (j>length($0)){i=0}};key_gen(0,-1);key_gen(1,-2);key_gen(2,-4);key_gen(3,-5);key_gen(-4,-1);key_gen(-3,-2);key_gen(-2,-4);key_gen(-1,-5);print \"The KEY is: \" key};function key_gen(p,q){key=sprintf(\"%s%c\",key,n2i[substr($0,(p>=0?p+1:length($0)+p+1),1)]+q)}"