├── Net spoofer c+ ├── NetConfig │ ├── kmboxNet.cpp │ └── kmboxNet.h ├── kmNetLib.vcxproj ├── kmNetLib.vcxproj.filters ├── kmNetLib.vcxproj.user ├── picture.h ├── spoofer.cpp └── spoofer.sln ├── README.md ├── c+++demo ├── NetConfig │ ├── HidTable.h │ ├── kmboxNet.cpp │ └── kmboxNet.h ├── README.md ├── calldemo.cpp ├── doc │ ├── +²+▌▌ñ+_ │ │ ├── WCHMcuIAP_WinAPP.exe │ │ └── WCHMcuIAP_WinAPP_DEMO.zip │ ├── kmboxNet+++º-+▌ß.docx │ └── lcd+í-ú▌ñ+_ │ │ ├── +-+++í-ú+f+▌(+·--) │ │ ├── 16X16▌▌+++í-ú+F++2.png │ │ ├── 2.png │ │ ├── PCtoLCD2002+í-ú+F++--▌▌++.JPG │ │ ├── PCtoLCD2002-O++▌µ │ │ │ ├── 11.TXT │ │ │ ├── 11.TXT_index.TXT │ │ │ ├── 112.FON │ │ │ ├── 11_index.TXT │ │ │ ├── ASC.PTL │ │ │ ├── Gb2312.PTL │ │ │ ├── PCtoLCD2002.INI │ │ │ ├── PCtoLCD2002.exe │ │ │ ├── RTL60.BPL │ │ │ ├── VCL60.BPL │ │ │ ├── _index.TXT │ │ │ ├── notice.txt │ │ │ └── readme2002.txt │ │ └── ▌Ñ+S▌-16X16-+-+▌»-².txt │ │ └── -+▌¼+í-ú+f+▌(+·--) │ │ └── Image2Lcd 2.9(▌▌+G▌µ) │ │ ├── Img2Lcd.exe │ │ ├── Img2Lcd_chs.chm │ │ ├── Img2Lcd_cht.chm │ │ ├── emenu.dll │ │ ├── sss.dll │ │ ├── unins000.dat │ │ └── unins000.exe ├── kmNetLib.sln ├── kmNetLib.vcxproj ├── kmNetLib.vcxproj.filters ├── kmNetLib.vcxproj.user ├── picture.h └── x64 │ └── Debug │ ├── calldemo.obj │ ├── kmNetLib.Build.CppClean.log │ ├── kmNetLib.exe │ ├── kmNetLib.exe.recipe │ ├── kmNetLib.ilk │ ├── kmNetLib.log │ ├── kmNetLib.pdb │ ├── kmNetLib.tlog │ ├── CL.command.1.tlog │ ├── CL.read.1.tlog │ ├── CL.write.1.tlog │ ├── Cl.items.tlog │ ├── kmNetLib.lastbuildstate │ ├── link.command.1.tlog │ ├── link.read.1.tlog │ └── link.write.1.tlog │ ├── kmNetLib.vcxproj.FileListAbsolute.txt │ ├── kmboxNet.obj │ ├── vc143.idb │ └── vc143.pdb ├── exe.zip ├── kmbox╙├╗º╩╓▓ßpython░µ▒╛.doc ├── kmnet auto confg.py ├── python+demo ├── PYD │ ├── kmNet.cp310-win_amd64.ilk │ ├── kmNet.cp310-win_amd64.pyd │ ├── kmNet.cp311-win_amd64.ilk │ ├── kmNet.cp311-win_amd64.pyd │ ├── kmNet.cp312-win_amd64.ilk │ ├── kmNet.cp312-win_amd64.pyd │ ├── kmNet.cp36-win_amd64.ilk │ ├── kmNet.cp36-win_amd64.pyd │ ├── kmNet.cp37-win_amd64.ilk │ ├── kmNet.cp37-win_amd64.pyd │ ├── kmNet.cp38-win_amd64.ilk │ ├── kmNet.cp38-win_amd64.pyd │ ├── kmNet.cp39-win_amd64.ilk │ ├── kmNet.cp39-win_amd64.pyd │ └── kmNet3_9.pyd ├── demo(EN).py ├── demo(IT).py ├── demo.py └── kmNet.cp311-win_amd64.pyd └── upgrade tools ├── 01-Drive.exe ├── 02-Upgrade Tool.exe ├── WCHUSBNIC.EXE ├── firmware ├── kmboxNet20240921_13h39m43s.bin ├── kmboxNet20241001_16h36m27s.bin ├── kmboxNet20241016_12h25m42s.bin ├── kmboxNet20241114_13h57m33s.bin └── kmboxNet_fw20240525_11h37m58s.bin └── kmboxNet TOOLS.exe /Net spoofer c+/NetConfig/kmboxNet.cpp: -------------------------------------------------------------------------------- 1 | #include "kmboxNet.h" 2 | 3 | #include 4 | #define monitor_ok 2 5 | #define monitor_exit 0 6 | SOCKET sockClientfd = 0; 7 | SOCKET sockMonitorfd = 0; 8 | client_tx tx; 9 | client_tx rx; 10 | SOCKADDR_IN addrSrv; 11 | soft_mouse_t softmouse; 12 | soft_keyboard_t softkeyboard; 13 | static int monitor_run = 0; 14 | static int mask_keyboard_mouse_flag = 0; 15 | static short monitor_port = 0; 16 | 17 | 18 | #pragma pack(1) 19 | typedef struct { 20 | unsigned char report_id; 21 | unsigned char buttons; 22 | short x; 23 | short y; 24 | short wheel; 25 | }standard_mouse_report_t; 26 | 27 | typedef struct { 28 | unsigned char report_id; 29 | unsigned char buttons; 30 | unsigned char data[10]; 31 | }standard_keyboard_report_t; 32 | #pragma pack() 33 | 34 | standard_mouse_report_t hw_mouse; 35 | standard_keyboard_report_t hw_keyboard; 36 | 37 | 38 | int myrand(int a, int b) 39 | { 40 | int min = a < b ? a : b; 41 | int max = a > b ? a : b; 42 | return ((rand() % (max - min)) + min); 43 | } 44 | 45 | unsigned int StrToHex(char* pbSrc, int nLen) 46 | { 47 | char h1, h2; 48 | unsigned char s1, s2; 49 | int i; 50 | unsigned int pbDest[16] = { 0 }; 51 | for (i = 0; i < nLen; i++) { 52 | h1 = pbSrc[2 * i]; 53 | h2 = pbSrc[2 * i + 1]; 54 | s1 = toupper(h1) - 0x30; 55 | if (s1 > 9) 56 | s1 -= 7; 57 | s2 = toupper(h2) - 0x30; 58 | if (s2 > 9) 59 | s2 -= 7; 60 | pbDest[i] = s1 * 16 + s2; 61 | } 62 | return pbDest[0] << 24 | pbDest[1] << 16 | pbDest[2] << 8 | pbDest[3]; 63 | } 64 | 65 | int NetRxReturnHandle(client_tx* rx, client_tx* tx) 66 | { 67 | if (rx->head.cmd != tx->head.cmd) 68 | return err_net_cmd; 69 | if (rx->head.indexpts != tx->head.indexpts) 70 | return err_net_pts; 71 | return 0; 72 | 73 | 74 | } 75 | 76 | 77 | 78 | int kmNet_init(char* ip, char* port, char* mac) 79 | { 80 | WORD wVersionRequested;WSADATA wsaData; int err; 81 | wVersionRequested = MAKEWORD(1, 1); 82 | err = WSAStartup(wVersionRequested, &wsaData); 83 | if (err != 0) return err_creat_socket; 84 | if (LOBYTE(wsaData.wVersion) != 1 || HIBYTE(wsaData.wVersion) != 1) { 85 | WSACleanup(); sockClientfd = -1; 86 | return err_net_version; 87 | } 88 | srand((unsigned)time(NULL)); 89 | sockClientfd = socket(AF_INET, SOCK_DGRAM, 0); 90 | addrSrv.sin_addr.S_un.S_addr = inet_addr(ip); 91 | addrSrv.sin_family = AF_INET; 92 | addrSrv.sin_port = htons(atoi(port)); 93 | tx.head.mac = StrToHex(mac, 4); 94 | tx.head.rand = rand(); 95 | tx.head.indexpts = 0; 96 | tx.head.cmd = cmd_connect; 97 | memset(&softmouse, 0, sizeof(softmouse)); 98 | memset(&softkeyboard, 0, sizeof(softkeyboard)); 99 | err = sendto(sockClientfd, (const char*)&tx, sizeof(cmd_head_t), 0, (struct sockaddr*)&addrSrv, sizeof(addrSrv)); 100 | Sleep(20); 101 | int clen = sizeof(addrSrv); 102 | err = recvfrom(sockClientfd, (char*)&rx, 1024, 0, (struct sockaddr*)&addrSrv, &clen); 103 | if (err < 0) 104 | return err_net_rx_timeout; 105 | return NetRxReturnHandle(&rx, &tx); 106 | } 107 | 108 | 109 | 110 | 111 | int kmNet_reboot(void) 112 | { 113 | int err; 114 | if (sockClientfd <= 0) return err_creat_socket; 115 | tx.head.indexpts++; 116 | tx.head.cmd = cmd_reboot; 117 | tx.head.rand = rand(); 118 | int length = sizeof(cmd_head_t); 119 | sendto(sockClientfd, (const char*)&tx, length, 0, (struct sockaddr*)&addrSrv, sizeof(addrSrv)); 120 | SOCKADDR_IN sclient; 121 | int clen = sizeof(sclient); 122 | err = recvfrom(sockClientfd, (char*)&rx, 1024, 0, (struct sockaddr*)&sclient, &clen); 123 | WSACleanup(); 124 | sockClientfd = -1; 125 | if (err < 0) 126 | return err_net_rx_timeout; 127 | return NetRxReturnHandle(&rx, &tx); 128 | 129 | } 130 | 131 | 132 | 133 | int kmNet_setconfig(char* ip, unsigned short port) 134 | { 135 | int err; 136 | if (sockClientfd <= 0) return err_creat_socket; 137 | tx.head.indexpts++; 138 | tx.head.cmd = cmd_setconfig; 139 | tx.head.rand = inet_addr(ip); ; 140 | tx.u8buff.buff[0] = port >> 8; 141 | tx.u8buff.buff[1] = port >> 0; 142 | int length = sizeof(cmd_head_t) + 2; 143 | sendto(sockClientfd, (const char*)&tx, length, 0, (struct sockaddr*)&addrSrv, sizeof(addrSrv)); 144 | SOCKADDR_IN sclient; 145 | int clen = sizeof(sclient); 146 | err = recvfrom(sockClientfd, (char*)&rx, 1024, 0, (struct sockaddr*)&sclient, &clen); 147 | if (err < 0) 148 | return err_net_rx_timeout; 149 | return NetRxReturnHandle(&rx, &tx); 150 | } 151 | 152 | int kmNet_setvidpid(unsigned short vid, unsigned short pid) 153 | { 154 | int err; 155 | if (sockClientfd <= 0) return err_creat_socket; 156 | 157 | tx.head.indexpts++; 158 | tx.head.cmd = cmd_setvidpid; 159 | tx.head.rand = vid | pid << 16; 160 | int length = sizeof(cmd_head_t); 161 | sendto(sockClientfd, (const char*)&tx, length, 0, (struct sockaddr*)&addrSrv, sizeof(addrSrv)); 162 | SOCKADDR_IN sclient; 163 | int clen = sizeof(sclient); 164 | err = recvfrom(sockClientfd, (char*)&rx, 1024, 0, (struct sockaddr*)&sclient, &clen); 165 | return NetRxReturnHandle(&rx, &tx); 166 | } 167 | -------------------------------------------------------------------------------- /Net spoofer c+/NetConfig/kmboxNet.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "math.h" 4 | #pragma warning(disable : 4996) 5 | 6 | #define cmd_connect 0xaf3c2828 7 | #define cmd_mouse_move 0xaede7345 8 | #define cmd_mouse_left 0x9823AE8D 9 | #define cmd_mouse_middle 0x97a3AE8D 10 | #define cmd_mouse_right 0x238d8212 11 | #define cmd_mouse_wheel 0xffeead38 12 | #define cmd_mouse_automove 0xaede7346 13 | #define cmd_keyboard_all 0x123c2c2f 14 | #define cmd_reboot 0xaa8855aa 15 | #define cmd_bazerMove 0xa238455a 16 | #define cmd_monitor 0x27388020 17 | #define cmd_debug 0x27382021 18 | #define cmd_mask_mouse 0x23234343 19 | #define cmd_unmask_all 0x23344343 20 | #define cmd_setconfig 0x1d3d3323 21 | #define cmd_showpic 0x12334883 22 | #define cmd_setvidpid 0xffed3232 23 | 24 | extern SOCKET sockClientfd; 25 | typedef struct 26 | { 27 | unsigned int mac; 28 | unsigned int rand; 29 | unsigned int indexpts; 30 | unsigned int cmd; 31 | }cmd_head_t; 32 | 33 | typedef struct 34 | { 35 | unsigned char buff[1024]; // 36 | }cmd_data_t; 37 | typedef struct 38 | { 39 | unsigned short buff[512]; // 40 | }cmd_u16_t; 41 | 42 | 43 | typedef struct 44 | { 45 | int button; 46 | int x; 47 | int y; 48 | int wheel; 49 | int point[10]; 50 | }soft_mouse_t; 51 | 52 | 53 | typedef struct 54 | { 55 | char ctrl; 56 | char resvel; 57 | char button[10]; 58 | }soft_keyboard_t; 59 | 60 | 61 | typedef struct 62 | { 63 | cmd_head_t head; 64 | union { 65 | cmd_data_t u8buff; 66 | cmd_u16_t u16buff; 67 | soft_mouse_t cmd_mouse; 68 | soft_keyboard_t cmd_keyboard; 69 | }; 70 | }client_tx; 71 | 72 | enum 73 | { 74 | err_creat_socket = -9000, 75 | err_net_version, 76 | err_net_tx, 77 | err_net_rx_timeout, 78 | err_net_cmd, 79 | err_net_pts, 80 | success = 0, 81 | usb_dev_tx_timeout, 82 | }; 83 | 84 | 85 | 86 | 87 | int kmNet_init(char* ip, char* port, char* mac);//ok 88 | int kmNet_reboot(void); 89 | int kmNet_setconfig(char* ip, unsigned short port); 90 | int kmNet_setvidpid(unsigned short vid, unsigned short pid); 91 | 92 | 93 | 94 | -------------------------------------------------------------------------------- /Net spoofer c+/kmNetLib.vcxproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | Win32 7 | 8 | 9 | Release 10 | Win32 11 | 12 | 13 | Debug 14 | x64 15 | 16 | 17 | Release 18 | x64 19 | 20 | 21 | 22 | 16.0 23 | Win32Proj 24 | {ff64a96c-d455-4670-b4a8-be4cda0d746e} 25 | kmNetLib 26 | 10.0 27 | KmboxNet spoofer 28 | 29 | 30 | 31 | Application 32 | true 33 | v143 34 | Unicode 35 | 36 | 37 | Application 38 | false 39 | v143 40 | true 41 | Unicode 42 | 43 | 44 | Application 45 | true 46 | v143 47 | Unicode 48 | 49 | 50 | Application 51 | false 52 | v143 53 | true 54 | Unicode 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | Level3 77 | true 78 | WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) 79 | true 80 | 81 | 82 | Console 83 | true 84 | 85 | 86 | 87 | 88 | Level3 89 | true 90 | true 91 | true 92 | WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) 93 | true 94 | 95 | 96 | Console 97 | true 98 | true 99 | true 100 | 101 | 102 | 103 | 104 | Level3 105 | true 106 | _DEBUG;_CONSOLE;%(PreprocessorDefinitions) 107 | true 108 | 109 | 110 | Console 111 | true 112 | ws2_32.lib;%(AdditionalDependencies) 113 | 114 | 115 | 116 | 117 | Level3 118 | true 119 | true 120 | true 121 | NDEBUG;_CONSOLE;%(PreprocessorDefinitions) 122 | true 123 | 124 | 125 | Console 126 | true 127 | true 128 | true 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | -------------------------------------------------------------------------------- /Net spoofer c+/kmNetLib.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | 源文件 20 | 21 | 22 | 源文件 23 | 24 | 25 | 26 | 27 | 头文件 28 | 29 | 30 | -------------------------------------------------------------------------------- /Net spoofer c+/kmNetLib.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /Net spoofer c+/picture.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZCban/kmboxNET/1312f862a1ea7a213581d3f581e4473d35f4a103/Net spoofer c+/picture.h -------------------------------------------------------------------------------- /Net spoofer c+/spoofer.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include "NetConfig/kmboxNet.h" 7 | #include 8 | 9 | const std::string configFileName = "device_config.txt"; 10 | 11 | void saveConfig(const std::string& ip, int port, const std::string& uuid) { 12 | std::ofstream configFile(configFileName); 13 | if (configFile.is_open()) { 14 | configFile << ip << std::endl; 15 | configFile << port << std::endl; 16 | configFile << uuid << std::endl; 17 | configFile.close(); 18 | std::cout << "Configurazione salvata: IP = " << ip << ", Porta = " << port << ", UUID = " << uuid << std::endl; 19 | } 20 | else { 21 | std::cout << "Impossibile aprire il file per salvare la configurazione." << std::endl; 22 | } 23 | } 24 | 25 | bool loadConfig(std::string& ip, int& port, std::string& uuid) { 26 | std::ifstream configFile(configFileName); 27 | if (configFile.is_open()) { 28 | if (getline(configFile, ip) && (configFile >> port) && getline(configFile >> std::ws, uuid)) { 29 | configFile.close(); 30 | std::cout << "Configurazione caricata: IP = " << ip << ", Porta = " << port << ", UUID = " << uuid << std::endl; 31 | return true; 32 | } 33 | configFile.close(); 34 | } 35 | std::cout << "Caricamento configurazione fallito. Inserisci i dati manualmente." << std::endl; 36 | return false; 37 | } 38 | 39 | bool initializeAndConfigureDevice(const std::string& deviceIP, int devicePort, const std::string& uuid) { 40 | std::cout << "Tentativo di connessione al dispositivo su " << deviceIP << ":" << devicePort << "..." << std::endl; 41 | 42 | char* ipBuffer = new char[deviceIP.length() + 1]; 43 | std::strcpy(ipBuffer, deviceIP.c_str()); 44 | 45 | std::string portStr = std::to_string(devicePort); 46 | char* portBuffer = new char[portStr.length() + 1]; 47 | std::strcpy(portBuffer, portStr.c_str()); 48 | 49 | char* uuidBuffer = new char[uuid.length() + 1]; 50 | std::strcpy(uuidBuffer, uuid.c_str()); 51 | 52 | if (kmNet_init(ipBuffer, portBuffer, uuidBuffer) != 0) { 53 | std::cout << "KmBoxNet Inizializzazione fallita." << std::endl; 54 | delete[] ipBuffer; 55 | delete[] portBuffer; 56 | delete[] uuidBuffer; 57 | return false; 58 | } 59 | 60 | delete[] ipBuffer; 61 | delete[] portBuffer; 62 | delete[] uuidBuffer; 63 | 64 | std::cout << "KmBoxNet Inizializzato correttamente." << std::endl; 65 | return true; 66 | } 67 | 68 | bool setDeviceVIDPID(unsigned short vid, unsigned short pid) { 69 | int result = kmNet_setvidpid(vid, pid); 70 | if (result != 0) { 71 | std::cout << "Impossibile impostare VID e PID. Codice errore: " << result << std::endl; 72 | return false; 73 | } 74 | 75 | std::cout << "VID e PID impostati con successo." << std::endl; 76 | return true; 77 | } 78 | 79 | bool configureAndRebootDevice(std::string& newIP, int& newPort) { 80 | std::random_device rd; 81 | std::mt19937 gen(rd()); 82 | std::uniform_int_distribution<> ipDistrib(150, 199); 83 | std::uniform_int_distribution<> portDistrib(1024, 65535); 84 | 85 | newIP = "192.168.2." + std::to_string(ipDistrib(gen)); 86 | newPort = portDistrib(gen); 87 | std::cout << "Nuova configurazione generata - IP: " << newIP << ", Porta: " << newPort << std::endl; 88 | 89 | char* newIPBuffer = new char[newIP.length() + 1]; 90 | std::strcpy(newIPBuffer, newIP.c_str()); 91 | 92 | if (kmNet_setconfig(newIPBuffer, static_cast(newPort)) != 0) { 93 | std::cout << "Impossibile impostare la nuova configurazione di IP e Porta." << std::endl; 94 | delete[] newIPBuffer; 95 | return false; 96 | } 97 | 98 | delete[] newIPBuffer; 99 | 100 | std::cout << "Nuova configurazione di IP e Porta impostata con successo." << std::endl; 101 | 102 | saveConfig(newIP, newPort, "9FC05414"); // Salva la configurazione con un UUID esistente o nuovo 103 | 104 | if (kmNet_reboot() != 0) { 105 | std::cout << "Impossibile riavviare il dispositivo." << std::endl; 106 | return false; 107 | } 108 | 109 | std::cout << "Dispositivo in fase di riavvio..." << std::endl; 110 | std::this_thread::sleep_for(std::chrono::seconds(5)); // Attendere che il dispositivo si riavvii 111 | std::cout << "Dispositivo riavviato correttamente." << std::endl; 112 | 113 | return true; 114 | } 115 | 116 | int main() { 117 | std::string deviceIP; 118 | int devicePort; 119 | std::string deviceUUID; 120 | 121 | // 1. Caricare o chiedere all'utente la configurazione del dispositivo 122 | if (!loadConfig(deviceIP, devicePort, deviceUUID)) { 123 | std::cout << "Inserisci l'IP del dispositivo: "; 124 | std::cin >> deviceIP; 125 | std::cout << "Inserisci la porta del dispositivo: "; 126 | std::cin >> devicePort; 127 | std::cout << "Inserisci il codice UUID (autorizzazione): "; 128 | std::cin >> deviceUUID; 129 | } 130 | 131 | // 2. Inizializzare il dispositivo 132 | if (!initializeAndConfigureDevice(deviceIP, devicePort, deviceUUID)) { 133 | return 1; // Uscita in caso di fallimento nell'inizializzazione 134 | } 135 | 136 | // 3. Configurare nuovo IP, Porta e riavviare il dispositivo 137 | std::string newIP; 138 | int newPort; 139 | if (!configureAndRebootDevice(newIP, newPort)) { 140 | return 1; // Uscita in caso di fallimento nella configurazione 141 | } 142 | 143 | // 4. Re-inizializzare il dispositivo con la nuova configurazione 144 | if (!initializeAndConfigureDevice(newIP, newPort, deviceUUID)) { 145 | return 1; // Uscita in caso di fallimento nella re-inizializzazione 146 | } 147 | 148 | // 4.5 Wait for the device to be fully ready 149 | std::cout << "Waiting for the device to be fully ready..." << std::endl; 150 | std::this_thread::sleep_for(std::chrono::seconds(3)); // Wait a few seconds 151 | 152 | // 5. Impostare il VID e PID randomizzati 153 | std::random_device rd; 154 | std::mt19937 gen(rd()); 155 | std::uniform_int_distribution distrib(0x0000, 0xFFFF); // Genera un valore tra 0x0000 e 0xFFFF 156 | 157 | unsigned short vid = distrib(gen); // Randomizza il Vendor ID (VID) 158 | unsigned short pid = distrib(gen); // Randomizza il Product ID (PID) 159 | 160 | std::cout << "New VID:" << std::hex << vid << std::endl; 161 | std::cout << "New PID:" << std::hex << pid << std::endl; 162 | 163 | if (!setDeviceVIDPID(vid, pid)) { 164 | return 1; // Uscita in caso di fallimento nell'impostazione di VID e PID 165 | } 166 | 167 | std::cout << "Dispositivo completamente configurato e riavviato con le nuove impostazioni." << std::endl; 168 | 169 | // Wait 10 seconds before the program exits automatically 170 | std::cout << "Il programma si chiuderà automaticamente in 10 secondi." << std::endl; 171 | std::this_thread::sleep_for(std::chrono::seconds(10)); 172 | return 0; 173 | } 174 | -------------------------------------------------------------------------------- /Net spoofer c+/spoofer.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.4.33205.214 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "kmNetLib", "kmNetLib.vcxproj", "{FF64A96C-D455-4670-B4A8-BE4CDA0D746E}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|x64 = Debug|x64 11 | Debug|x86 = Debug|x86 12 | Release|x64 = Release|x64 13 | Release|x86 = Release|x86 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {FF64A96C-D455-4670-B4A8-BE4CDA0D746E}.Debug|x64.ActiveCfg = Debug|x64 17 | {FF64A96C-D455-4670-B4A8-BE4CDA0D746E}.Debug|x64.Build.0 = Debug|x64 18 | {FF64A96C-D455-4670-B4A8-BE4CDA0D746E}.Debug|x86.ActiveCfg = Debug|Win32 19 | {FF64A96C-D455-4670-B4A8-BE4CDA0D746E}.Debug|x86.Build.0 = Debug|Win32 20 | {FF64A96C-D455-4670-B4A8-BE4CDA0D746E}.Release|x64.ActiveCfg = Release|x64 21 | {FF64A96C-D455-4670-B4A8-BE4CDA0D746E}.Release|x64.Build.0 = Release|x64 22 | {FF64A96C-D455-4670-B4A8-BE4CDA0D746E}.Release|x86.ActiveCfg = Release|Win32 23 | {FF64A96C-D455-4670-B4A8-BE4CDA0D746E}.Release|x86.Build.0 = Release|Win32 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | GlobalSection(ExtensibilityGlobals) = postSolution 29 | SolutionGuid = {10067566-17BE-476F-908B-38C075AB01D7} 30 | EndGlobalSection 31 | EndGlobal 32 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ################ 2 | # EN # IT 3 | ################ 4 | 5 | The kmboxNet library provides an interface for programming physical keyboard and mouse input controls over the network, usable in Python environments. This guide offers an overview of how to set up and use kmboxNet for your projects. 6 | 7 | # Introduction 8 | kmboxNet is designed to enable Python programmers to programmatically simulate physical actions of a keyboard and mouse. Whether you're developing automations for testing or creating complex interactions for applications, kmboxNet offers the necessary tools to integrate physical controls into your software. 9 | 10 | # Physical Installation and Initial Configuration 11 | To use kmboxNet, you need to follow some initial steps to correctly configure the device with your PC. These steps ensure that the device is ready to communicate with your Python scripts. 12 | 13 | # Hardware Connection 14 | Cable Connection: Connect the two blue cables provided by the device to your PC. These cables are essential for establishing the connection between the kmboxNet device and the PC. 15 | Input Devices Connection: Connect the mouse, keyboard, or both to the kmboxNet device according to your operational needs. 16 | Software Configuration 17 | The first time the device is connected to the PC, it will be recognized as a storage device. Follow these steps to configure the necessary software: 18 | 19 | # Software Installation: Open the storage device in your file explorer and find the provided executable (e.g., setup.exe or a similar name). Run this file to install the necessary software for kmboxNet on your PC. 20 | 21 | # Automatic Configuration: After completing the installation, start kmNet auto config to automatically configure the device. This step is crucial to ensure that the device is ready to be used with your Python scripts. 22 | 23 | # Installation Verification 24 | Once the software configuration is complete, the kmboxNet device is ready for use. You can begin integrating the library's functions into your Python projects to automate and control physical input devices. You can verify the installation in the command prompt using the command “ping 192.168.2.188”. 25 | 26 | # Configuration 27 | Before starting, make sure to copy the kmNet_xxxxx.pyd file into your project's source code directory, where xxxxx indicates the specific version and Python platform you are using. 28 | 29 | # Requirements 30 | Python 3.x 31 | Windows OS (64 bit) 32 | Installation 33 | Rename the kmNet.cp311-win_amd64.pyd file to kmNet.pyd to match your Python environment. Ensure all cables are correctly connected before proceeding. 34 | 35 | # Detailed Functions 36 | Below, you'll find a detailed overview of the functions available in kmboxNet and how to use them in your Python project. 37 | 38 | # Initialization 39 | init(ip, port, UUID): Initializes the connection to the device. Must be called once at the beginning. 40 | 41 | ip: Device's IP address. 42 | port: Port number. 43 | UUID: Unique identifier of the device. 44 | 45 | # Mouse Control 46 | move(x, y): Moves the mouse relative to the specified coordinates. 47 | 48 | move_auto(x, y, duration): Moves the mouse towards the specified coordinates with a motion that simulates human action, within the time (in milliseconds) defined by duration. 49 | 50 | move_beizer(x, y, duration, cx1, cy1, [cx2, cy2]): Moves the mouse along a specified Bézier curve through control points. 51 | 52 | left(state): Controls the state of the left mouse button (state can be 0 for release or 1 for press). 53 | 54 | right(state): Controls the state of the right mouse button. 55 | 56 | middle(state): Controls the state of the middle mouse button. 57 | 58 | wheel(direction): Simulates the movement of the mouse wheel. Positive values for scrolling up, negative for down. 59 | 60 | # Keyboard Control 61 | keydown(key): Simulates pressing a keyboard key. 62 | keyup(key): Simulates releasing a keyboard key. 63 | 64 | # Monitoring and Locking 65 | monitor(enable): Enables or disables monitoring of the physical state of keys and mouse (enable can be 0 or 1). 66 | isdown_left(), isdown_right(), isdown_middle(), isdown_side1(), isdown_side2(): Checks if the respective mouse button is pressed at the time of the call. 67 | 68 | Examples of how to use the main functions: 69 | 70 | python 71 | 72 | # Initialization 73 | kmNet.init('192.168.1.100', '8080', 'UNIQUE-DEVICE-UUID') 74 | 75 | # Mouse movement 76 | kmNet.move(100, 100) # Immediate movement 77 | kmNet.move_auto(1920, 1080, 200) # Movement simulates human action 78 | 79 | # Mouse button press and release 80 | kmNet.left(1) # Press 81 | kmNet.left(0) # Release 82 | 83 | # Keyboard key press and release 84 | kmNet.keydown(0x04) # Key 'A' 85 | kmNet.keyup(0x04) 86 | 87 | # Monitoring and locking 88 | kmNet.monitor(1) # Enable monitoring 89 | print(kmNet.isdown_left()) # Check left button state 90 | 91 | Make sure to replace values like the IP address, port number, and UUID with those specific to your device. 92 | 93 | ## Net spoofer (New 05/09/2024) 94 | 95 | - Load and save configuration (IP, port, and UUID) from a configuration file (`device_config.txt`). 96 | - Prompt the user for device configuration **only on the first run** if no configuration file is found. After the first run, the configuration is handled dynamically using the file. 97 | - Initialize the device using the provided configuration. 98 | - Automatically generate new IP and port, configure the device, and reboot it. 99 | - Randomize the `VID` and `PID` values for each execution. 100 | - Print the generated `VID` and `PID` values. 101 | - Auto close after 10s 102 | 103 | Example Output: 104 | - Configurazione caricata: IP = 192.168.1.100, Porta = 8080, UUID = 9FC05414 105 | - Tentativo di connessione al dispositivo su 192.168.1.100:8080... 106 | - KmBoxNet Inizializzato correttamente. 107 | - Nuova configurazione generata - IP: 192.168.2.153, Porta: 32451 108 | - Nuova configurazione di IP e Porta impostata con successo. 109 | - Dispositivo in fase di riavvio... 110 | - Dispositivo riavviato correttamente. 111 | - VID randomizzato: 0x3e8f 112 | - PID randomizzato: 0x7d52 113 | - VID e PID impostati con successo. 114 | - Dispositivo completamente configurato e riavviato con le nuove impostazioni. 115 | 116 | ## Kmnet auto confg.py (new 20/10/20204) 117 | - aggiunginto controllo del ping dopo aver configurato ip di kmbox in windows consente una facile interpretazione per capire se il collegamento funziona 118 | - added ping control after configuring ip of kmbox in windows allows easy interpretation to understand if the connection works 119 | - aggiunta autoinstallazione del modulo pyd di kmboxnet nei moduli python (potrai importare kmboxNet nei tuoi codici senza dover avere il file pyd nella cartella del codice) 120 | - added self-installation of the kmboxnet pyd module in python modules (you can import kmboxNet into your codes without having to have the pyd file in the code folder) 121 | 122 | -------------------------------------------------------------------------------- /c+++demo/NetConfig/HidTable.h: -------------------------------------------------------------------------------- 1 | #ifndef __keyboard__table__ 2 | #define __keyboard__table__ 3 | #define KEY_NONE 0x00 4 | #define KEY_ERRORROLLOVER 0x01 5 | #define KEY_POSTFAIL 0x02 6 | #define KEY_ERRORUNDEFINED 0x03 7 | #define KEY_A 0x04 8 | #define KEY_B 0x05 9 | #define KEY_C 0x06 10 | #define KEY_D 0x07 11 | #define KEY_E 0x08 12 | #define KEY_F 0x09 13 | #define KEY_G 0x0A 14 | #define KEY_H 0x0B 15 | #define KEY_I 0x0C 16 | #define KEY_J 0x0D 17 | #define KEY_K 0x0E 18 | #define KEY_L 0x0F 19 | #define KEY_M 0x10 20 | #define KEY_N 0x11 21 | #define KEY_O 0x12 22 | #define KEY_P 0x13 23 | #define KEY_Q 0x14 24 | #define KEY_R 0x15 25 | #define KEY_S 0x16 26 | #define KEY_T 0x17 27 | #define KEY_U 0x18 28 | #define KEY_V 0x19 29 | #define KEY_W 0x1A 30 | #define KEY_X 0x1B 31 | #define KEY_Y 0x1C 32 | #define KEY_Z 0x1D 33 | #define KEY_1_EXCLAMATION_MARK 0x1E 34 | #define KEY_2_AT 0x1F 35 | #define KEY_3_NUMBER_SIGN 0x20 36 | #define KEY_4_DOLLAR 0x21 37 | #define KEY_5_PERCENT 0x22 38 | #define KEY_6_CARET 0x23 39 | #define KEY_7_AMPERSAND 0x24 40 | #define KEY_8_ASTERISK 0x25 41 | #define KEY_9_OPARENTHESIS 0x26 42 | #define KEY_0_CPARENTHESIS 0x27 43 | #define KEY_ENTER 0x28 44 | #define KEY_ESCAPE 0x29 45 | #define KEY_BACKSPACE 0x2A 46 | #define KEY_TAB 0x2B 47 | #define KEY_SPACEBAR 0x2C 48 | #define KEY_MINUS_UNDERSCORE 0x2D 49 | #define KEY_EQUAL_PLUS 0x2E 50 | #define KEY_OBRACKET_AND_OBRACE 0x2F 51 | #define KEY_CBRACKET_AND_CBRACE 0x30 52 | #define KEY_BACKSLASH_VERTICAL_BAR 0x31 53 | #define KEY_NONUS_NUMBER_SIGN_TILDE 0x32 54 | #define KEY_SEMICOLON_COLON 0x33 55 | #define KEY_SINGLE_AND_DOUBLE_QUOTE 0x34 56 | #define KEY_GRAVE ACCENT AND TILDE 0x35 57 | #define KEY_COMMA_AND_LESS 0x36 58 | #define KEY_DOT_GREATER 0x37 59 | #define KEY_SLASH_QUESTION 0x38 60 | #define KEY_CAPS LOCK 0x39 61 | #define KEY_F1 0x3A 62 | #define KEY_F2 0x3B 63 | #define KEY_F3 0x3C 64 | #define KEY_F4 0x3D 65 | #define KEY_F5 0x3E 66 | #define KEY_F6 0x3F 67 | #define KEY_F7 0x40 68 | #define KEY_F8 0x41 69 | #define KEY_F9 0x42 70 | #define KEY_F10 0x43 71 | #define KEY_F11 0x44 72 | #define KEY_F12 0x45 73 | #define KEY_PRINTSCREEN 0x46 74 | #define KEY_SCROLL LOCK 0x47 75 | #define KEY_PAUSE 0x48 76 | #define KEY_INSERT 0x49 77 | #define KEY_HOME 0x4A 78 | #define KEY_PAGEUP 0x4B 79 | #define KEY_DELETE 0x4C 80 | #define KEY_END1 0x4D 81 | #define KEY_PAGEDOWN 0x4E 82 | #define KEY_RIGHTARROW 0x4F 83 | #define KEY_LEFTARROW 0x50 84 | #define KEY_DOWNARROW 0x51 85 | #define KEY_UPARROW 0x52 86 | #define KEY_KEYPAD_NUM_LOCK_AND_CLEAR 0x53 87 | #define KEY_KEYPAD_SLASH 0x54 88 | #define KEY_KEYPAD_ASTERIKS 0x55 89 | #define KEY_KEYPAD_MINUS 0x56 90 | #define KEY_KEYPAD_PLUS 0x57 91 | #define KEY_KEYPAD_ENTER 0x58 92 | #define KEY_KEYPAD_1_END 0x59 93 | #define KEY_KEYPAD_2_DOWN_ARROW 0x5A 94 | #define KEY_KEYPAD_3_PAGEDN 0x5B 95 | #define KEY_KEYPAD_4_LEFT_ARROW 0x5C 96 | #define KEY_KEYPAD_5 0x5D 97 | #define KEY_KEYPAD_6_RIGHT_ARROW 0x5E 98 | #define KEY_KEYPAD_7_HOME 0x5F 99 | #define KEY_KEYPAD_8_UP_ARROW 0x60 100 | #define KEY_KEYPAD_9_PAGEUP 0x61 101 | #define KEY_KEYPAD_0_INSERT 0x62 102 | #define KEY_KEYPAD_DECIMAL_SEPARATOR_DELETE 0x63 103 | #define KEY_NONUS_BACK_SLASH_VERTICAL_BAR 0x64 104 | #define KEY_APPLICATION 0x65 105 | #define KEY_POWER 0x66 106 | #define KEY_KEYPAD_EQUAL 0x67 107 | #define KEY_F13 0x68 108 | #define KEY_F14 0x69 109 | #define KEY_F15 0x6A 110 | #define KEY_F16 0x6B 111 | #define KEY_F17 0x6C 112 | #define KEY_F18 0x6D 113 | #define KEY_F19 0x6E 114 | #define KEY_F20 0x6F 115 | #define KEY_F21 0x70 116 | #define KEY_F22 0x71 117 | #define KEY_F23 0x72 118 | #define KEY_F24 0x73 119 | #define KEY_EXECUTE 0x74 120 | #define KEY_HELP 0x75 121 | #define KEY_MENU 0x76 122 | #define KEY_SELECT 0x77 123 | #define KEY_STOP 0x78 124 | #define KEY_AGAIN 0x79 125 | #define KEY_UNDO 0x7A 126 | #define KEY_CUT 0x7B 127 | #define KEY_COPY 0x7C 128 | #define KEY_PASTE 0x7D 129 | #define KEY_FIND 0x7E 130 | #define KEY_MUTE 0x7F 131 | #define KEY_VOLUME_UP 0x80 132 | #define KEY_VOLUME_DOWN 0x81 133 | #define KEY_LOCKING_CAPS_LOCK 0x82 134 | #define KEY_LOCKING_NUM_LOCK 0x83 135 | #define KEY_LOCKING_SCROLL_LOCK 0x84 136 | #define KEY_KEYPAD_COMMA 0x85 137 | #define KEY_KEYPAD_EQUAL_SIGN 0x86 138 | #define KEY_INTERNATIONAL1 0x87 139 | #define KEY_INTERNATIONAL2 0x88 140 | #define KEY_INTERNATIONAL3 0x89 141 | #define KEY_INTERNATIONAL4 0x8A 142 | #define KEY_INTERNATIONAL5 0x8B 143 | #define KEY_INTERNATIONAL6 0x8C 144 | #define KEY_INTERNATIONAL7 0x8D 145 | #define KEY_INTERNATIONAL8 0x8E 146 | #define KEY_INTERNATIONAL9 0x8F 147 | #define KEY_LANG1 0x90 148 | #define KEY_LANG2 0x91 149 | #define KEY_LANG3 0x92 150 | #define KEY_LANG4 0x93 151 | #define KEY_LANG5 0x94 152 | #define KEY_LANG6 0x95 153 | #define KEY_LANG7 0x96 154 | #define KEY_LANG8 0x97 155 | #define KEY_LANG9 0x98 156 | #define KEY_ALTERNATE_ERASE 0x99 157 | #define KEY_SYSREQ 0x9A 158 | #define KEY_CANCEL 0x9B 159 | #define KEY_CLEAR 0x9C 160 | #define KEY_PRIOR 0x9D 161 | #define KEY_RETURN 0x9E 162 | #define KEY_SEPARATOR 0x9F 163 | #define KEY_OUT 0xA0 164 | #define KEY_OPER 0xA1 165 | #define KEY_CLEAR_AGAIN 0xA2 166 | #define KEY_CRSEL 0xA3 167 | #define KEY_EXSEL 0xA4 168 | #define KEY_KEYPAD_00 0xB0 169 | #define KEY_KEYPAD_000 0xB1 170 | #define KEY_THOUSANDS_SEPARATOR 0xB2 171 | #define KEY_DECIMAL_SEPARATOR 0xB3 172 | #define KEY_CURRENCY_UNIT 0xB4 173 | #define KEY_CURRENCY_SUB_UNIT 0xB5 174 | #define KEY_KEYPAD_OPARENTHESIS 0xB6 175 | #define KEY_KEYPAD_CPARENTHESIS 0xB7 176 | #define KEY_KEYPAD_OBRACE 0xB8 177 | #define KEY_KEYPAD_CBRACE 0xB9 178 | #define KEY_KEYPAD_TAB 0xBA 179 | #define KEY_KEYPAD_BACKSPACE 0xBB 180 | #define KEY_KEYPAD_A 0xBC 181 | #define KEY_KEYPAD_B 0xBD 182 | #define KEY_KEYPAD_C 0xBE 183 | #define KEY_KEYPAD_D 0xBF 184 | #define KEY_KEYPAD_E 0xC0 185 | #define KEY_KEYPAD_F 0xC1 186 | #define KEY_KEYPAD_XOR 0xC2 187 | #define KEY_KEYPAD_CARET 0xC3 188 | #define KEY_KEYPAD_PERCENT 0xC4 189 | #define KEY_KEYPAD_LESS 0xC5 190 | #define KEY_KEYPAD_GREATER 0xC6 191 | #define KEY_KEYPAD_AMPERSAND 0xC7 192 | #define KEY_KEYPAD_LOGICAL_AND 0xC8 193 | #define KEY_KEYPAD_VERTICAL_BAR 0xC9 194 | #define KEY_KEYPAD_LOGIACL_OR 0xCA 195 | #define KEY_KEYPAD_COLON 0xCB 196 | #define KEY_KEYPAD_NUMBER_SIGN 0xCC 197 | #define KEY_KEYPAD_SPACE 0xCD 198 | #define KEY_KEYPAD_AT 0xCE 199 | #define KEY_KEYPAD_EXCLAMATION_MARK 0xCF 200 | #define KEY_KEYPAD_MEMORY_STORE 0xD0 201 | #define KEY_KEYPAD_MEMORY_RECALL 0xD1 202 | #define KEY_KEYPAD_MEMORY_CLEAR 0xD2 203 | #define KEY_KEYPAD_MEMORY_ADD 0xD3 204 | #define KEY_KEYPAD_MEMORY_SUBTRACT 0xD4 205 | #define KEY_KEYPAD_MEMORY_MULTIPLY 0xD5 206 | #define KEY_KEYPAD_MEMORY_DIVIDE 0xD6 207 | #define KEY_KEYPAD_PLUSMINUS 0xD7 208 | #define KEY_KEYPAD_CLEAR 0xD8 209 | #define KEY_KEYPAD_CLEAR_ENTRY 0xD9 210 | #define KEY_KEYPAD_BINARY 0xDA 211 | #define KEY_KEYPAD_OCTAL 0xDB 212 | #define KEY_KEYPAD_DECIMAL 0xDC 213 | #define KEY_KEYPAD_HEXADECIMAL 0xDD 214 | #define KEY_LEFTCONTROL 0xE0 215 | #define KEY_LEFTSHIFT 0xE1 216 | #define KEY_LEFTALT 0xE2 217 | #define KEY_LEFT_GUI 0xE3 218 | #define KEY_RIGHTCONTROL 0xE4 219 | #define KEY_RIGHTSHIFT 0xE5 220 | #define KEY_RIGHTALT 0xE6 221 | #define KEY_RIGHT_GUI 0xE7 222 | 223 | 224 | #define BIT0 0X01 225 | #define BIT1 0X02 226 | #define BIT2 0X04 227 | #define BIT3 0X08 228 | #define BIT4 0X10 229 | #define BIT5 0X20 230 | #define BIT6 0X40 231 | #define BIT7 0X80 232 | 233 | 234 | #endif -------------------------------------------------------------------------------- /c+++demo/NetConfig/kmboxNet.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZCban/kmboxNET/1312f862a1ea7a213581d3f581e4473d35f4a103/c+++demo/NetConfig/kmboxNet.cpp -------------------------------------------------------------------------------- /c+++demo/NetConfig/kmboxNet.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZCban/kmboxNET/1312f862a1ea7a213581d3f581e4473d35f4a103/c+++demo/NetConfig/kmboxNet.h -------------------------------------------------------------------------------- /c+++demo/README.md: -------------------------------------------------------------------------------- 1 | # kmboxnet 2 | kmboxNet调用源码 3 | 4 | 这是kmbox网络版调用源码。相关开发协议文档见doc文件夹。 5 | -------------------------------------------------------------------------------- /c+++demo/calldemo.cpp: -------------------------------------------------------------------------------- 1 | // kmNetLib.cpp : This file contains the "main" function. Program execution begins and ends there. 2 | // 3 | 4 | #include 5 | #include 6 | #include 7 | #include "math.h" 8 | #include "NetConfig/kmboxNet.h" 9 | #include "NetConfig/HidTable.h" 10 | #include "picture.h" 11 | 12 | #pragma warning(disable : 4996) 13 | 14 | int main() { 15 | int ret; 16 | 17 | // Initial connection test - Must connect successfully before using other APIs 18 | printf("---------------- This program is a demo for kmboxNet version call test --------------\r\n"); 19 | ret = kmNet_init((char*)"192.168.2.188", (char*)"8338", (char*)"24ba5054"); // Connect to the box 20 | // If this function does not return, it means IP or UUID is incorrect. Please check if it matches the display on the box screen 21 | 22 | kmNet_monitor(10000); // Use port 10000 to monitor physical keyboard and mouse messages, ensure the port does not conflict with other programs 23 | Sleep(1000); 24 | 25 | while (true) { 26 | if (kmNet_monitor_mouse_left() == 1) { // If the left mouse button is pressed 27 | printf("Left mouse button pressed\r\n"); 28 | while (kmNet_monitor_mouse_left() == 1) Sleep(1); // Wait for the left button to be released 29 | kmNet_monitor(0); // Disable monitoring 30 | } 31 | Sleep(1); // Sleep to avoid high CPU usage 32 | } 33 | 34 | printf("Call speed test, please wait about 10 seconds...\r\n"); 35 | int cnt = 10000; 36 | long startime = GetTickCount(); 37 | while (cnt > 0) { 38 | ret = kmNet_mouse_move(0, -100); cnt--; 39 | if (ret) 40 | printf("tx error %d ret0=%d\r\n", cnt, ret); 41 | ret = kmNet_mouse_move(0, 100); cnt--; 42 | if (ret) 43 | printf("tx error %d ret1=%d\r\n", cnt, ret); 44 | } 45 | printf("\t10000 calls took = %ld ms\r\n", GetTickCount() - startime); 46 | 47 | printf("Display test:\r\n"); 48 | while (1) { 49 | startime = GetTickCount(); 50 | kmNet_lcd_color(0); 51 | printf("\tFull screen solid color fill took = %ld ms\r\n", GetTickCount() - startime); 52 | startime = GetTickCount(); 53 | kmNet_lcd_picture_bottom(gImage_128x80); // Display 128x80 image on the bottom half 54 | printf("\tHalf screen picture refresh took = %ld ms\r\n", GetTickCount() - startime); 55 | startime = GetTickCount(); 56 | kmNet_lcd_picture(gImage_128x160); // Display 128x160 image on the full screen 57 | printf("\tFull screen picture refresh took = %ld ms\r\n", GetTickCount() - startime); 58 | break; 59 | } 60 | 61 | #if 0 62 | kmNet_init((char*)"192.168.2.166", (char*)"1234", (char*)"F101383B"); // Connect to the box 63 | printf("Change box IP address\r\n"); 64 | kmNet_setconfig((char*)"192.168.2.166", 1234); 65 | printf("Reboot is required to take effect\r\n"); 66 | kmNet_reboot(); 67 | #endif 68 | 69 | // Physical keyboard and mouse monitoring function test 70 | printf("Physical keyboard and mouse monitoring function, press left, middle, and right buttons to exit the test\r\n"); 71 | printf("Note: If you cannot monitor the key information, please turn off the Windows firewall\r\n"); 72 | kmNet_monitor(1000); // Enable keyboard and mouse monitoring function, listening port is 1000 73 | int exit = 0; 74 | while ((exit & 0x07) != 0x07) { 75 | // Mouse button detection 76 | if (kmNet_monitor_mouse_left() == 1) { // Left mouse button pressed 77 | printf("Left mouse button pressed\r\n"); 78 | do { Sleep(1); } while (kmNet_monitor_mouse_left() == 1); // Wait for the left button to be released 79 | printf("Left mouse button released\r\n"); 80 | exit |= 0x01; 81 | } 82 | 83 | if (kmNet_monitor_mouse_middle() == 1) { // Middle mouse button pressed 84 | printf("Middle mouse button pressed\r\n"); 85 | do { Sleep(1); } while (kmNet_monitor_mouse_middle() == 1); // Wait for the middle button to be released 86 | printf("Middle mouse button released\r\n"); 87 | exit |= 0x02; 88 | } 89 | 90 | if (kmNet_monitor_mouse_right() == 1) { // Right mouse button pressed 91 | printf("Right mouse button pressed\r\n"); 92 | do { Sleep(1); } while (kmNet_monitor_mouse_right() == 1); // Wait for the right button to be released 93 | printf("Right mouse button released\r\n"); 94 | exit |= 0x04; 95 | } 96 | 97 | if (kmNet_monitor_mouse_side1() == 1) { // Side mouse button 1 pressed 98 | printf("Side mouse button 1 pressed\r\n"); 99 | do { Sleep(1); } while (kmNet_monitor_mouse_side1() == 1); // Wait for side button 1 to be released 100 | printf("Side mouse button 1 released\r\n"); 101 | exit |= 0x08; 102 | } 103 | 104 | if (kmNet_monitor_mouse_side2() == 1) { // Side mouse button 2 pressed 105 | printf("Side mouse button 2 pressed\r\n"); 106 | do { Sleep(1); } while (kmNet_monitor_mouse_side2() == 1); // Wait for side button 2 to be released 107 | printf("Side mouse button 2 released\r\n"); 108 | exit |= 0x10; 109 | } 110 | 111 | if (kmNet_monitor_keyboard(KEY_A) == 1) { // Keyboard A key pressed 112 | printf("Keyboard A key pressed\r\n"); 113 | do { Sleep(1); } while (kmNet_monitor_keyboard(KEY_A) == 1); // Wait for the A key to be released 114 | printf("Keyboard A key released\r\n"); 115 | exit |= 0x20; 116 | } 117 | Sleep(1); 118 | } 119 | 120 | // Simulate artificial trajectory test 121 | while (true) { 122 | // Open the drawing tool and press the left mouse button to see the movement trajectory 123 | if (kmNet_monitor_mouse_left()) { // If the left mouse button is pressed 124 | startime = GetTickCount(); 125 | ret = kmNet_mouse_move_auto(400, 300, 200); // Expected to complete within 200ms 126 | printf("\tTime taken = %ld ms ret = %d\r\n", GetTickCount() - startime, ret); // Actual time taken 127 | while (kmNet_monitor_mouse_left()) Sleep(1); // Wait for the left button to be released 128 | } 129 | Sleep(1); // Sleep to avoid high CPU usage 130 | } 131 | 132 | // Additional examples of key presses and mouse movements 133 | printf("Simulate mouse click and key press examples:\r\n"); 134 | 135 | // Simulate left mouse click 136 | printf("Simulating left mouse click...\r\n"); 137 | kmNet_mouse_left(1); // Press left mouse button 138 | Sleep(100); // Hold for 100ms 139 | kmNet_mouse_left(0); // Release left mouse button 140 | Sleep(100); 141 | 142 | // Simulate right mouse click 143 | printf("Simulating right mouse click...\r\n"); 144 | kmNet_mouse_right(1); // Press right mouse button 145 | Sleep(100); // Hold for 100ms 146 | kmNet_mouse_right(0); // Release right mouse button 147 | Sleep(100); 148 | 149 | // Simulate middle mouse click 150 | printf("Simulating middle mouse click...\r\n"); 151 | kmNet_mouse_middle(1); // Press middle mouse button 152 | Sleep(100); // Hold for 100ms 153 | kmNet_mouse_middle(0); // Release middle mouse button 154 | Sleep(100); 155 | 156 | 157 | // Simulate mouse movement 158 | printf("Simulating mouse movement...\r\n"); 159 | kmNet_mouse_move(100, 0); // Move mouse right 160 | Sleep(100); 161 | kmNet_mouse_move(-100, 0); // Move mouse left 162 | Sleep(100); 163 | kmNet_mouse_move_auto((100, 0),200)//simulate human mouse movement 164 | 165 | // Re-enable physical mouse monitoring 166 | kmNet_monitor(1); // Enable keyboard and mouse monitoring function 167 | 168 | #if 0 // Mask mouse test 169 | printf("Physical keyboard and mouse masking test:\r\n"); 170 | kmNet_monitor(1); // Enable keyboard and mouse monitoring function 171 | kmNet_mask_mouse_left(1); // Mask left mouse button 172 | kmNet_mask_mouse_middle(1); // Mask middle mouse button 173 | kmNet_mask_mouse_right(1); // Mask right mouse button 174 | kmNet_mask_mouse_side1(1); // Mask side mouse button 1 175 | kmNet_mask_mouse_side2(1); // Mask side mouse button 2 176 | kmNet_mask_mouse_x(1); // Mask mouse x direction 177 | kmNet_mask_mouse_y(1); // Mask mouse y direction -- with the above code enabled, the mouse is basically useless 178 | kmNet_mask_keyboard(KEY_A); // Mask keyboard A key 179 | int timeout = 1000; 180 | while (true) { // Exit after 10 seconds 181 | if (kmNet_monitor_mouse_left()) { // If the physical left mouse button is pressed 182 | printf("Physical left mouse button pressed\r\n"); 183 | while (kmNet_monitor_mouse_left()) Sleep(1); // Wait for the left button to be released 184 | } 185 | if (kmNet_monitor_mouse_middle()) { // If the physical middle mouse button is pressed 186 | printf("Physical middle mouse button pressed\r\n"); 187 | while (kmNet_monitor_mouse_middle()) Sleep(1); // Wait for the middle button to be released 188 | } 189 | if (kmNet_monitor_mouse_right()) { // If the physical right mouse button is pressed 190 | printf("Physical right mouse button pressed\r\n"); 191 | while (kmNet_monitor_mouse_right()) Sleep(1); // Wait for the right button to be released 192 | } 193 | if (kmNet_monitor_mouse_side1()) { // If the physical side mouse button 1 is pressed 194 | printf("Physical side mouse button 1 pressed\r\n"); 195 | while (kmNet_monitor_mouse_side1()) Sleep(1); // Wait for side button 1 to be released 196 | } 197 | 198 | if (kmNet_monitor_mouse_side2()) { // If the physical side mouse button 2 is pressed 199 | printf("Physical side mouse button 2 pressed\r\n"); 200 | while (kmNet_monitor_mouse_side2()) Sleep(1); // Wait for side button 2 to be released 201 | } 202 | 203 | if (kmNet_monitor_keyboard(KEY_A)) { 204 | printf("Keyboard A key pressed\r\n"); 205 | while (kmNet_monitor_keyboard(KEY_A)) Sleep(1); // Wait for the A key to be released 206 | printf("Keyboard A key released\r\n"); 207 | } 208 | Sleep(1); // Sleep to avoid high CPU usage 209 | if (timeout == 0) break; 210 | timeout--; 211 | } 212 | printf("Unmask all\r\n"); 213 | kmNet_unmask_all(); // Unmask all. Now the keyboard and mouse can be used normally 214 | #endif 215 | 216 | #if 0 217 | kmNet_mouse_left(0); // Release 218 | kmNet_mouse_all(1, 0, 0, 0); // Press 219 | kmNet_mouse_all(0, 0, 0, 0); // Release 220 | kmNet_mouse_right(1); // Press 221 | // Keyboard key test 222 | kmNet_keydown(4); // a key press 223 | kmNet_reboot(); // Reboot the box 224 | kmNet_mouse_right(0); // Release 225 | kmNet_mouse_all(2, 0, 0, 0); // Press 226 | kmNet_mouse_all(0, 0, 0, 0); // Release 227 | // Middle mouse button test 228 | kmNet_mouse_middle(1); // Press 229 | kmNet_mouse_middle(0); // Release 230 | kmNet_mouse_all(4, 0, 0, 0); // Press 231 | kmNet_mouse_all(0, 0, 0, 0); // Release 232 | #endif 233 | } 234 | -------------------------------------------------------------------------------- /c+++demo/doc/+²+▌▌ñ+_/WCHMcuIAP_WinAPP.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZCban/kmboxNET/1312f862a1ea7a213581d3f581e4473d35f4a103/c+++demo/doc/+²+▌▌ñ+_/WCHMcuIAP_WinAPP.exe -------------------------------------------------------------------------------- /c+++demo/doc/+²+▌▌ñ+_/WCHMcuIAP_WinAPP_DEMO.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZCban/kmboxNET/1312f862a1ea7a213581d3f581e4473d35f4a103/c+++demo/doc/+²+▌▌ñ+_/WCHMcuIAP_WinAPP_DEMO.zip -------------------------------------------------------------------------------- /c+++demo/doc/kmboxNet+++º-+▌ß.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZCban/kmboxNET/1312f862a1ea7a213581d3f581e4473d35f4a103/c+++demo/doc/kmboxNet+++º-+▌ß.docx -------------------------------------------------------------------------------- /c+++demo/doc/lcd+í-ú▌ñ+_/+-+++í-ú+f+▌(+·--)/16X16▌▌+++í-ú+F++2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZCban/kmboxNET/1312f862a1ea7a213581d3f581e4473d35f4a103/c+++demo/doc/lcd+í-ú▌ñ+_/+-+++í-ú+f+▌(+·--)/16X16▌▌+++í-ú+F++2.png -------------------------------------------------------------------------------- /c+++demo/doc/lcd+í-ú▌ñ+_/+-+++í-ú+f+▌(+·--)/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZCban/kmboxNET/1312f862a1ea7a213581d3f581e4473d35f4a103/c+++demo/doc/lcd+í-ú▌ñ+_/+-+++í-ú+f+▌(+·--)/2.png -------------------------------------------------------------------------------- /c+++demo/doc/lcd+í-ú▌ñ+_/+-+++í-ú+f+▌(+·--)/PCtoLCD2002+í-ú+F++--▌▌++.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZCban/kmboxNET/1312f862a1ea7a213581d3f581e4473d35f4a103/c+++demo/doc/lcd+í-ú▌ñ+_/+-+++í-ú+f+▌(+·--)/PCtoLCD2002+í-ú+F++--▌▌++.JPG -------------------------------------------------------------------------------- /c+++demo/doc/lcd+í-ú▌ñ+_/+-+++í-ú+f+▌(+·--)/PCtoLCD2002-O++▌µ/11.TXT: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZCban/kmboxNET/1312f862a1ea7a213581d3f581e4473d35f4a103/c+++demo/doc/lcd+í-ú▌ñ+_/+-+++í-ú+f+▌(+·--)/PCtoLCD2002-O++▌µ/11.TXT -------------------------------------------------------------------------------- /c+++demo/doc/lcd+í-ú▌ñ+_/+-+++í-ú+f+▌(+·--)/PCtoLCD2002-O++▌µ/11.TXT_index.TXT: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZCban/kmboxNET/1312f862a1ea7a213581d3f581e4473d35f4a103/c+++demo/doc/lcd+í-ú▌ñ+_/+-+++í-ú+f+▌(+·--)/PCtoLCD2002-O++▌µ/11.TXT_index.TXT -------------------------------------------------------------------------------- /c+++demo/doc/lcd+í-ú▌ñ+_/+-+++í-ú+f+▌(+·--)/PCtoLCD2002-O++▌µ/112.FON: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZCban/kmboxNET/1312f862a1ea7a213581d3f581e4473d35f4a103/c+++demo/doc/lcd+í-ú▌ñ+_/+-+++í-ú+f+▌(+·--)/PCtoLCD2002-O++▌µ/112.FON -------------------------------------------------------------------------------- /c+++demo/doc/lcd+í-ú▌ñ+_/+-+++í-ú+f+▌(+·--)/PCtoLCD2002-O++▌µ/11_index.TXT: -------------------------------------------------------------------------------- 1 | 1(0) 2(1) 3(2) 4(3) 5(4) 6(5) 7(6) 2 | 8(7) 9(8) 0(9) a(10) b(11) c(12) d(13) 3 | e(14) f(15) g(16) h(17) i(18) j(19) k(20) 4 | l(21) m(22) n(23) o(24) p(25) q(26) r(27) 5 | s(28) t(29) u(30) v(31) w(32) x(33) y(34) 6 | z(35) A(36) B(37) C(38) D(39) E(40) F(41) 7 | G(42) H(43) I(44) J(45) K(46) L(47) M(48) 8 | N(49) O(50) P(51) Q(52) R(53) S(54) T(55) 9 | U(56) V(57) W(58) X(59) Y(60) Z(61) ,(62) 10 | .(63) /(64) ;(65) '(66) [(67) ](68) \(69) 11 | `(70) !(71) #(72) $(73) %(74) ^(75) &(76) 12 | *(77) ((78) )(79) _(80) +(81) -(82) =(83) 13 | 14 | -------------------------------------------------------------------------------- /c+++demo/doc/lcd+í-ú▌ñ+_/+-+++í-ú+f+▌(+·--)/PCtoLCD2002-O++▌µ/ASC.PTL: -------------------------------------------------------------------------------- 1 |  2 |  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ -------------------------------------------------------------------------------- /c+++demo/doc/lcd+í-ú▌ñ+_/+-+++í-ú+f+▌(+·--)/PCtoLCD2002-O++▌µ/Gb2312.PTL: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZCban/kmboxNET/1312f862a1ea7a213581d3f581e4473d35f4a103/c+++demo/doc/lcd+í-ú▌ñ+_/+-+++í-ú+f+▌(+·--)/PCtoLCD2002-O++▌µ/Gb2312.PTL -------------------------------------------------------------------------------- /c+++demo/doc/lcd+í-ú▌ñ+_/+-+++í-ú+f+▌(+·--)/PCtoLCD2002-O++▌µ/PCtoLCD2002.INI: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZCban/kmboxNET/1312f862a1ea7a213581d3f581e4473d35f4a103/c+++demo/doc/lcd+í-ú▌ñ+_/+-+++í-ú+f+▌(+·--)/PCtoLCD2002-O++▌µ/PCtoLCD2002.INI -------------------------------------------------------------------------------- /c+++demo/doc/lcd+í-ú▌ñ+_/+-+++í-ú+f+▌(+·--)/PCtoLCD2002-O++▌µ/PCtoLCD2002.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZCban/kmboxNET/1312f862a1ea7a213581d3f581e4473d35f4a103/c+++demo/doc/lcd+í-ú▌ñ+_/+-+++í-ú+f+▌(+·--)/PCtoLCD2002-O++▌µ/PCtoLCD2002.exe -------------------------------------------------------------------------------- /c+++demo/doc/lcd+í-ú▌ñ+_/+-+++í-ú+f+▌(+·--)/PCtoLCD2002-O++▌µ/RTL60.BPL: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZCban/kmboxNET/1312f862a1ea7a213581d3f581e4473d35f4a103/c+++demo/doc/lcd+í-ú▌ñ+_/+-+++í-ú+f+▌(+·--)/PCtoLCD2002-O++▌µ/RTL60.BPL -------------------------------------------------------------------------------- /c+++demo/doc/lcd+í-ú▌ñ+_/+-+++í-ú+f+▌(+·--)/PCtoLCD2002-O++▌µ/VCL60.BPL: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZCban/kmboxNET/1312f862a1ea7a213581d3f581e4473d35f4a103/c+++demo/doc/lcd+í-ú▌ñ+_/+-+++í-ú+f+▌(+·--)/PCtoLCD2002-O++▌µ/VCL60.BPL -------------------------------------------------------------------------------- /c+++demo/doc/lcd+í-ú▌ñ+_/+-+++í-ú+f+▌(+·--)/PCtoLCD2002-O++▌µ/_index.TXT: -------------------------------------------------------------------------------- 1 | ~(0) 2 | -------------------------------------------------------------------------------- /c+++demo/doc/lcd+í-ú▌ñ+_/+-+++í-ú+f+▌(+·--)/PCtoLCD2002-O++▌µ/notice.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZCban/kmboxNET/1312f862a1ea7a213581d3f581e4473d35f4a103/c+++demo/doc/lcd+í-ú▌ñ+_/+-+++í-ú+f+▌(+·--)/PCtoLCD2002-O++▌µ/notice.txt -------------------------------------------------------------------------------- /c+++demo/doc/lcd+í-ú▌ñ+_/+-+++í-ú+f+▌(+·--)/PCtoLCD2002-O++▌µ/readme2002.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZCban/kmboxNET/1312f862a1ea7a213581d3f581e4473d35f4a103/c+++demo/doc/lcd+í-ú▌ñ+_/+-+++í-ú+f+▌(+·--)/PCtoLCD2002-O++▌µ/readme2002.txt -------------------------------------------------------------------------------- /c+++demo/doc/lcd+í-ú▌ñ+_/+-+++í-ú+f+▌(+·--)/▌Ñ+S▌-16X16-+-+▌»-².txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZCban/kmboxNET/1312f862a1ea7a213581d3f581e4473d35f4a103/c+++demo/doc/lcd+í-ú▌ñ+_/+-+++í-ú+f+▌(+·--)/▌Ñ+S▌-16X16-+-+▌»-².txt -------------------------------------------------------------------------------- /c+++demo/doc/lcd+í-ú▌ñ+_/-+▌¼+í-ú+f+▌(+·--)/Image2Lcd 2.9(▌▌+G▌µ)/Img2Lcd.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZCban/kmboxNET/1312f862a1ea7a213581d3f581e4473d35f4a103/c+++demo/doc/lcd+í-ú▌ñ+_/-+▌¼+í-ú+f+▌(+·--)/Image2Lcd 2.9(▌▌+G▌µ)/Img2Lcd.exe -------------------------------------------------------------------------------- /c+++demo/doc/lcd+í-ú▌ñ+_/-+▌¼+í-ú+f+▌(+·--)/Image2Lcd 2.9(▌▌+G▌µ)/Img2Lcd_chs.chm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZCban/kmboxNET/1312f862a1ea7a213581d3f581e4473d35f4a103/c+++demo/doc/lcd+í-ú▌ñ+_/-+▌¼+í-ú+f+▌(+·--)/Image2Lcd 2.9(▌▌+G▌µ)/Img2Lcd_chs.chm -------------------------------------------------------------------------------- /c+++demo/doc/lcd+í-ú▌ñ+_/-+▌¼+í-ú+f+▌(+·--)/Image2Lcd 2.9(▌▌+G▌µ)/Img2Lcd_cht.chm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZCban/kmboxNET/1312f862a1ea7a213581d3f581e4473d35f4a103/c+++demo/doc/lcd+í-ú▌ñ+_/-+▌¼+í-ú+f+▌(+·--)/Image2Lcd 2.9(▌▌+G▌µ)/Img2Lcd_cht.chm -------------------------------------------------------------------------------- /c+++demo/doc/lcd+í-ú▌ñ+_/-+▌¼+í-ú+f+▌(+·--)/Image2Lcd 2.9(▌▌+G▌µ)/emenu.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZCban/kmboxNET/1312f862a1ea7a213581d3f581e4473d35f4a103/c+++demo/doc/lcd+í-ú▌ñ+_/-+▌¼+í-ú+f+▌(+·--)/Image2Lcd 2.9(▌▌+G▌µ)/emenu.dll -------------------------------------------------------------------------------- /c+++demo/doc/lcd+í-ú▌ñ+_/-+▌¼+í-ú+f+▌(+·--)/Image2Lcd 2.9(▌▌+G▌µ)/sss.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZCban/kmboxNET/1312f862a1ea7a213581d3f581e4473d35f4a103/c+++demo/doc/lcd+í-ú▌ñ+_/-+▌¼+í-ú+f+▌(+·--)/Image2Lcd 2.9(▌▌+G▌µ)/sss.dll -------------------------------------------------------------------------------- /c+++demo/doc/lcd+í-ú▌ñ+_/-+▌¼+í-ú+f+▌(+·--)/Image2Lcd 2.9(▌▌+G▌µ)/unins000.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZCban/kmboxNET/1312f862a1ea7a213581d3f581e4473d35f4a103/c+++demo/doc/lcd+í-ú▌ñ+_/-+▌¼+í-ú+f+▌(+·--)/Image2Lcd 2.9(▌▌+G▌µ)/unins000.dat -------------------------------------------------------------------------------- /c+++demo/doc/lcd+í-ú▌ñ+_/-+▌¼+í-ú+f+▌(+·--)/Image2Lcd 2.9(▌▌+G▌µ)/unins000.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZCban/kmboxNET/1312f862a1ea7a213581d3f581e4473d35f4a103/c+++demo/doc/lcd+í-ú▌ñ+_/-+▌¼+í-ú+f+▌(+·--)/Image2Lcd 2.9(▌▌+G▌µ)/unins000.exe -------------------------------------------------------------------------------- /c+++demo/kmNetLib.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.4.33205.214 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "kmNetLib", "kmNetLib.vcxproj", "{FF64A96C-D455-4670-B4A8-BE4CDA0D746E}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|x64 = Debug|x64 11 | Debug|x86 = Debug|x86 12 | Release|x64 = Release|x64 13 | Release|x86 = Release|x86 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {FF64A96C-D455-4670-B4A8-BE4CDA0D746E}.Debug|x64.ActiveCfg = Debug|x64 17 | {FF64A96C-D455-4670-B4A8-BE4CDA0D746E}.Debug|x64.Build.0 = Debug|x64 18 | {FF64A96C-D455-4670-B4A8-BE4CDA0D746E}.Debug|x86.ActiveCfg = Debug|Win32 19 | {FF64A96C-D455-4670-B4A8-BE4CDA0D746E}.Debug|x86.Build.0 = Debug|Win32 20 | {FF64A96C-D455-4670-B4A8-BE4CDA0D746E}.Release|x64.ActiveCfg = Release|x64 21 | {FF64A96C-D455-4670-B4A8-BE4CDA0D746E}.Release|x64.Build.0 = Release|x64 22 | {FF64A96C-D455-4670-B4A8-BE4CDA0D746E}.Release|x86.ActiveCfg = Release|Win32 23 | {FF64A96C-D455-4670-B4A8-BE4CDA0D746E}.Release|x86.Build.0 = Release|Win32 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | GlobalSection(ExtensibilityGlobals) = postSolution 29 | SolutionGuid = {10067566-17BE-476F-908B-38C075AB01D7} 30 | EndGlobalSection 31 | EndGlobal 32 | -------------------------------------------------------------------------------- /c+++demo/kmNetLib.vcxproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | Win32 7 | 8 | 9 | Release 10 | Win32 11 | 12 | 13 | Debug 14 | x64 15 | 16 | 17 | Release 18 | x64 19 | 20 | 21 | 22 | 16.0 23 | Win32Proj 24 | {ff64a96c-d455-4670-b4a8-be4cda0d746e} 25 | kmNetLib 26 | 10.0 27 | 28 | 29 | 30 | Application 31 | true 32 | v143 33 | Unicode 34 | 35 | 36 | Application 37 | false 38 | v143 39 | true 40 | Unicode 41 | 42 | 43 | Application 44 | true 45 | v143 46 | Unicode 47 | 48 | 49 | Application 50 | false 51 | v143 52 | true 53 | Unicode 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | Level3 76 | true 77 | WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) 78 | true 79 | 80 | 81 | Console 82 | true 83 | 84 | 85 | 86 | 87 | Level3 88 | true 89 | true 90 | true 91 | WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) 92 | true 93 | 94 | 95 | Console 96 | true 97 | true 98 | true 99 | 100 | 101 | 102 | 103 | Level3 104 | true 105 | _DEBUG;_CONSOLE;%(PreprocessorDefinitions) 106 | true 107 | 108 | 109 | Console 110 | true 111 | ws2_32.lib;%(AdditionalDependencies) 112 | 113 | 114 | 115 | 116 | Level3 117 | true 118 | true 119 | true 120 | NDEBUG;_CONSOLE;%(PreprocessorDefinitions) 121 | true 122 | 123 | 124 | Console 125 | true 126 | true 127 | true 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | -------------------------------------------------------------------------------- /c+++demo/kmNetLib.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | 源文件 20 | 21 | 22 | 源文件 23 | 24 | 25 | 26 | 27 | 头文件 28 | 29 | 30 | 头文件 31 | 32 | 33 | 头文件 34 | 35 | 36 | -------------------------------------------------------------------------------- /c+++demo/kmNetLib.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /c+++demo/picture.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZCban/kmboxNET/1312f862a1ea7a213581d3f581e4473d35f4a103/c+++demo/picture.h -------------------------------------------------------------------------------- /c+++demo/x64/Debug/calldemo.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZCban/kmboxNET/1312f862a1ea7a213581d3f581e4473d35f4a103/c+++demo/x64/Debug/calldemo.obj -------------------------------------------------------------------------------- /c+++demo/x64/Debug/kmNetLib.Build.CppClean.log: -------------------------------------------------------------------------------- 1 | \\192.168.2.185\home\esp32\kmboxnet\x64\debug\calldemo.obj 2 | \\192.168.2.185\home\esp32\kmboxnet\x64\debug\kmboxnet.obj 3 | \\192.168.2.185\home\esp32\kmboxnet\x64\debug\vc143.pdb 4 | e:\opencv\kmboxnet\x64\debug\vc143.pdb 5 | e:\opencv\kmboxnet\x64\debug\vc143.idb 6 | e:\opencv\kmboxnet\x64\debug\calldemo.obj 7 | e:\opencv\kmboxnet\x64\debug\kmboxnet.obj 8 | \\192.168.2.185\home\esp32\kmboxnet\x64\debug\kmnetlib.exe 9 | \\192.168.2.185\home\esp32\kmboxnet\x64\debug\kmnetlib.ilk 10 | \\192.168.2.185\home\esp32\kmboxnet\x64\debug\kmnetlib.pdb 11 | e:\opencv\kmboxnet\x64\debug\kmnetlib.exe 12 | e:\opencv\kmboxnet\x64\debug\kmnetlib.ilk 13 | e:\opencv\kmboxnet\x64\debug\kmnetlib.pdb 14 | e:\opencv\kmboxnet\x64\debug\kmnetlib.tlog\cl.command.1.tlog 15 | e:\opencv\kmboxnet\x64\debug\kmnetlib.tlog\cl.items.tlog 16 | e:\opencv\kmboxnet\x64\debug\kmnetlib.tlog\cl.read.1.tlog 17 | e:\opencv\kmboxnet\x64\debug\kmnetlib.tlog\cl.write.1.tlog 18 | e:\opencv\kmboxnet\x64\debug\kmnetlib.tlog\link.command.1.tlog 19 | e:\opencv\kmboxnet\x64\debug\kmnetlib.tlog\link.read.1.tlog 20 | e:\opencv\kmboxnet\x64\debug\kmnetlib.tlog\link.write.1.tlog 21 | -------------------------------------------------------------------------------- /c+++demo/x64/Debug/kmNetLib.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZCban/kmboxNET/1312f862a1ea7a213581d3f581e4473d35f4a103/c+++demo/x64/Debug/kmNetLib.exe -------------------------------------------------------------------------------- /c+++demo/x64/Debug/kmNetLib.exe.recipe: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | E:\opencv\kmboxnet\x64\Debug\kmNetLib.exe 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /c+++demo/x64/Debug/kmNetLib.ilk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZCban/kmboxNET/1312f862a1ea7a213581d3f581e4473d35f4a103/c+++demo/x64/Debug/kmNetLib.ilk -------------------------------------------------------------------------------- /c+++demo/x64/Debug/kmNetLib.log: -------------------------------------------------------------------------------- 1 |  kmboxNet.cpp 2 | E:\opencv\kmboxnet\NetConfig\HidTable.h(119,1): warning C4005: “KEY_EXECUTE”: 宏重定义 3 | D:\Windows Kits\10\Include\10.0.22621.0\um\winnt.h(23235,1): message : 参见“KEY_EXECUTE”的前一个定义 4 | calldemo.cpp 5 | E:\opencv\kmboxnet\NetConfig\HidTable.h(119,1): warning C4005: “KEY_EXECUTE”: 宏重定义 6 | D:\Windows Kits\10\Include\10.0.22621.0\um\winnt.h(23235,1): message : 参见“KEY_EXECUTE”的前一个定义 7 | 正在生成代码... 8 | kmNetLib.vcxproj -> E:\opencv\kmboxnet\x64\Debug\kmNetLib.exe 9 | -------------------------------------------------------------------------------- /c+++demo/x64/Debug/kmNetLib.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZCban/kmboxNET/1312f862a1ea7a213581d3f581e4473d35f4a103/c+++demo/x64/Debug/kmNetLib.pdb -------------------------------------------------------------------------------- /c+++demo/x64/Debug/kmNetLib.tlog/CL.command.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZCban/kmboxNET/1312f862a1ea7a213581d3f581e4473d35f4a103/c+++demo/x64/Debug/kmNetLib.tlog/CL.command.1.tlog -------------------------------------------------------------------------------- /c+++demo/x64/Debug/kmNetLib.tlog/CL.read.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZCban/kmboxNET/1312f862a1ea7a213581d3f581e4473d35f4a103/c+++demo/x64/Debug/kmNetLib.tlog/CL.read.1.tlog -------------------------------------------------------------------------------- /c+++demo/x64/Debug/kmNetLib.tlog/CL.write.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZCban/kmboxNET/1312f862a1ea7a213581d3f581e4473d35f4a103/c+++demo/x64/Debug/kmNetLib.tlog/CL.write.1.tlog -------------------------------------------------------------------------------- /c+++demo/x64/Debug/kmNetLib.tlog/Cl.items.tlog: -------------------------------------------------------------------------------- 1 | E:\opencv\kmboxnet\calldemo.cpp;E:\opencv\kmboxnet\x64\Debug\calldemo.obj 2 | E:\opencv\kmboxnet\NetConfig\kmboxNet.cpp;E:\opencv\kmboxnet\x64\Debug\kmboxNet.obj 3 | -------------------------------------------------------------------------------- /c+++demo/x64/Debug/kmNetLib.tlog/kmNetLib.lastbuildstate: -------------------------------------------------------------------------------- 1 | PlatformToolSet=v143:VCToolArchitecture=Native64Bit:VCToolsVersion=14.37.32822:TargetPlatformVersion=10.0.22621.0: 2 | Debug|x64|E:\opencv\kmboxnet\| 3 | -------------------------------------------------------------------------------- /c+++demo/x64/Debug/kmNetLib.tlog/link.command.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZCban/kmboxNET/1312f862a1ea7a213581d3f581e4473d35f4a103/c+++demo/x64/Debug/kmNetLib.tlog/link.command.1.tlog -------------------------------------------------------------------------------- /c+++demo/x64/Debug/kmNetLib.tlog/link.read.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZCban/kmboxNET/1312f862a1ea7a213581d3f581e4473d35f4a103/c+++demo/x64/Debug/kmNetLib.tlog/link.read.1.tlog -------------------------------------------------------------------------------- /c+++demo/x64/Debug/kmNetLib.tlog/link.write.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZCban/kmboxNET/1312f862a1ea7a213581d3f581e4473d35f4a103/c+++demo/x64/Debug/kmNetLib.tlog/link.write.1.tlog -------------------------------------------------------------------------------- /c+++demo/x64/Debug/kmNetLib.vcxproj.FileListAbsolute.txt: -------------------------------------------------------------------------------- 1 | \\192.168.2.185\home\esp32\kmboxnet\x64\Debug\kmNetLib.exe 2 | E:\opencv\kmboxnet\x64\Debug\kmNetLib.exe 3 | -------------------------------------------------------------------------------- /c+++demo/x64/Debug/kmboxNet.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZCban/kmboxNET/1312f862a1ea7a213581d3f581e4473d35f4a103/c+++demo/x64/Debug/kmboxNet.obj -------------------------------------------------------------------------------- /c+++demo/x64/Debug/vc143.idb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZCban/kmboxNET/1312f862a1ea7a213581d3f581e4473d35f4a103/c+++demo/x64/Debug/vc143.idb -------------------------------------------------------------------------------- /c+++demo/x64/Debug/vc143.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZCban/kmboxNET/1312f862a1ea7a213581d3f581e4473d35f4a103/c+++demo/x64/Debug/vc143.pdb -------------------------------------------------------------------------------- /exe.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZCban/kmboxNET/1312f862a1ea7a213581d3f581e4473d35f4a103/exe.zip -------------------------------------------------------------------------------- /kmbox╙├╗º╩╓▓ßpython░µ▒╛.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZCban/kmboxNET/1312f862a1ea7a213581d3f581e4473d35f4a103/kmbox╙├╗º╩╓▓ßpython░µ▒╛.doc -------------------------------------------------------------------------------- /kmnet auto confg.py: -------------------------------------------------------------------------------- 1 | import subprocess 2 | import os 3 | import time 4 | import ctypes 5 | from ctypes import wintypes 6 | import win32com.client 7 | import random 8 | import sys 9 | import os 10 | import shutil 11 | import site 12 | 13 | 14 | class InstallationModule: 15 | def __init__(self): 16 | self.version = sys.version_info 17 | self.version_str = f"cp{self.version.major}{self.version.minor}" 18 | self.site_packages = site.getsitepackages() 19 | if not self.site_packages or len(self.site_packages) < 2: 20 | raise ValueError("Impossibile trovare la directory dei moduli di Python.") 21 | self.target_folder = self.site_packages[1] # Usa il secondo percorso (Lib/site-packages) 22 | 23 | if not os.path.exists(self.target_folder): 24 | raise ValueError("Impossibile trovare la directory dei moduli di Python.") 25 | 26 | def execute(self): 27 | print(self.get_python_version()) 28 | print(site.getsitepackages()) 29 | self.find_and_copy_pyd_file() 30 | 31 | def get_python_version(self): 32 | return f"Python {self.version.major}.{self.version.minor}" 33 | 34 | def find_and_copy_pyd_file(self): 35 | # Percorso di ricerca nella cartella 'C:\' per la cartella 'PYD' 36 | search_path = "C:" 37 | pyd_folder = None 38 | for root, dirs, files in os.walk(search_path): 39 | if 'PYD' in dirs: 40 | pyd_folder = os.path.join(root, 'PYD') 41 | break 42 | 43 | if not pyd_folder: 44 | print("Cartella 'PYD' non trovata.") 45 | return 46 | 47 | # Cerca il file .pyd per la versione corretta di Python 48 | print(f"Cercando i file .pyd nella cartella: {pyd_folder}") 49 | found_files = [] 50 | for file_name in os.listdir(pyd_folder): 51 | if file_name.endswith(".pyd"): 52 | found_files.append(file_name) 53 | if self.version_str in file_name: 54 | source_file = os.path.join(pyd_folder, file_name) 55 | destination_file = os.path.join(self.target_folder, file_name) 56 | renamed_file = os.path.join(self.target_folder, "kmNet.pyd") 57 | try: 58 | # Rimuove eventuali moduli esistenti con lo stesso nome 59 | if os.path.exists(destination_file): 60 | os.remove(destination_file) 61 | if os.path.exists(renamed_file): 62 | os.remove(renamed_file) 63 | 64 | # Copia il file e lo rinomina 65 | shutil.copy(source_file, destination_file) 66 | os.rename(destination_file, renamed_file) 67 | print(f"File '{file_name}' copiato con successo e rinominato in '{renamed_file}'.") 68 | return 69 | except Exception as e: 70 | print(f"Errore durante la copia o la rinomina del file: {e}") 71 | return 72 | 73 | print("File trovati:", found_files) 74 | print("Nessun file .pyd corrispondente alla versione di Python trovato.") 75 | 76 | 77 | 78 | class DriverInstaller: 79 | def __init__(self, driver_name, exe_name, main_window_name): 80 | self.driver_name = driver_name 81 | self.exe_name = exe_name 82 | self.main_window_name = main_window_name 83 | 84 | def is_driver_installed(self): 85 | try: 86 | result = subprocess.run(['powershell', '-Command', 'Get-WindowsDriver -Online'], capture_output=True, text=True, check=True) 87 | output = result.stdout 88 | return self.driver_name.lower() in output.lower() 89 | except subprocess.CalledProcessError as e: 90 | print(f"Errore durante l'esecuzione del comando: {e}") 91 | return False 92 | 93 | def search_and_run_exe(self): 94 | for root, dirs, files in os.walk("C:\\"): 95 | if self.exe_name in files: 96 | exe_path = os.path.join(root, self.exe_name) 97 | try: 98 | subprocess.Popen([exe_path]) 99 | return True 100 | except Exception as e: 101 | print(f"Errore durante l'avvio del file {self.exe_name}: {e}") 102 | return False 103 | return False 104 | 105 | def press_enter(self): 106 | VK_RETURN = 0x0D 107 | KEYEVENTF_KEYUP = 0x0002 108 | ctypes.windll.user32.keybd_event(VK_RETURN, 0, 0, 0) 109 | time.sleep(0.05) 110 | ctypes.windll.user32.keybd_event(VK_RETURN, 0, KEYEVENTF_KEYUP, 0) 111 | 112 | def list_open_windows(self): 113 | EnumWindows = ctypes.windll.user32.EnumWindows 114 | EnumWindowsProc = ctypes.WINFUNCTYPE(wintypes.BOOL, wintypes.HWND, wintypes.LPARAM) 115 | GetWindowText = ctypes.windll.user32.GetWindowTextW 116 | GetWindowTextLength = ctypes.windll.user32.GetWindowTextLengthW 117 | 118 | titles = [] 119 | 120 | def foreach_window(hwnd, lParam): 121 | if ctypes.windll.user32.IsWindowVisible(hwnd): 122 | length = GetWindowTextLength(hwnd) 123 | buff = ctypes.create_unicode_buffer(length + 1) 124 | GetWindowText(hwnd, buff, length + 1) 125 | if buff.value: 126 | titles.append((hwnd, buff.value)) 127 | return True 128 | 129 | EnumWindows(EnumWindowsProc(foreach_window), 0) 130 | return titles 131 | 132 | def close_windows_with_title(self, title): 133 | for hwnd, window_title in self.list_open_windows(): 134 | if title.lower() in window_title.lower(): 135 | ctypes.windll.user32.PostMessageW(hwnd, 0x0010, 0, 0) 136 | 137 | def install_driver(self): 138 | if self.is_driver_installed(): 139 | print(f"Il driver {self.driver_name} è già installato.") 140 | else: 141 | print(f"Il driver {self.driver_name} non è installato. Cerco il file {self.exe_name}...") 142 | if self.search_and_run_exe(): 143 | print(f"Avviato il file {self.exe_name}.") 144 | while True: 145 | open_windows = self.list_open_windows() 146 | if any(self.main_window_name in window for hwnd, window in open_windows): 147 | print(f"La finestra '{self.main_window_name}' è aperta. Premo Invio...") 148 | self.press_enter() 149 | break 150 | time.sleep(1) 151 | 152 | while True: 153 | open_windows = self.list_open_windows() 154 | driver_setup_windows = [window for hwnd, window in open_windows if self.main_window_name in window] 155 | if len(driver_setup_windows) >= 2: 156 | print(f"Sono aperte due finestre '{self.main_window_name}'. Le chiudo tutte...") 157 | self.close_windows_with_title(self.main_window_name) 158 | break 159 | else: 160 | print(f"In attesa che si apra la seconda finestra '{self.main_window_name}'...") 161 | time.sleep(1) 162 | 163 | if self.is_driver_installed(): 164 | print(f"Il driver {self.driver_name} è stato installato correttamente.") 165 | else: 166 | print(f"Il driver {self.driver_name} non è stato installato correttamente.") 167 | else: 168 | print(f"Il file {self.exe_name} non è stato trovato sul disco C:.") 169 | 170 | 171 | class NetworkConfigurator: 172 | def list_ethernet_devices(self): 173 | command = "netsh interface ipv4 show interfaces" 174 | try: 175 | output = subprocess.run(command, check=True, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True) 176 | #print("Elenco delle interfacce di rete disponibili:") 177 | #print(output.stdout) 178 | except subprocess.CalledProcessError as e: 179 | print(f"Errore nell'elencare le interfacce di rete: {e}") 180 | 181 | def get_interface_name(self, description): 182 | try: 183 | wmi = win32com.client.GetObject("winmgmts:") 184 | adapters = wmi.InstancesOf("Win32_NetworkAdapter") 185 | for adapter in adapters: 186 | if description in adapter.Description: 187 | return adapter.NetConnectionID 188 | print(f"Nessuna interfaccia trovata con la descrizione '{description}'") 189 | return None 190 | except Exception as e: 191 | print(f"Errore nell'interrogare WMI: {e}") 192 | return None 193 | 194 | def set_static_ip(self, interface_name, ip_address, subnet_mask): 195 | command = f"netsh interface ipv4 set address name=\"{interface_name}\" static {ip_address} {subnet_mask}" 196 | try: 197 | subprocess.run(command, check=True, shell=True) 198 | print(f"Indirizzo IP {ip_address} impostato con successo su {interface_name}.") 199 | print('Configurazione Pronta') 200 | except subprocess.CalledProcessError as e: 201 | print(f"Errore nell'impostazione dell'indirizzo IP: {e}") 202 | 203 | def ping_ip(self, ip_address): 204 | command = f"ping {ip_address}" 205 | try: 206 | output = subprocess.run(command, check=True, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True) 207 | if "TTL=" in output.stdout: 208 | print(f"Ping verso {ip_address} riuscito.") 209 | else: 210 | print(f"Ping verso {ip_address} fallito.") 211 | except subprocess.CalledProcessError as e: 212 | print(f"Errore durante il ping dell'indirizzo IP {ip_address}: {e}") 213 | 214 | # installa driver 215 | driver_installer = DriverInstaller("WCHUSBNIC.INF", "WCHUSBNIC.EXE", "DriverSetup") 216 | driver_installer.install_driver() 217 | 218 | # installa modulo 219 | try: 220 | handler = InstallationModule() 221 | handler.execute() 222 | print('Modulo kmNet installato con successo in python') 223 | except ValueError as e: 224 | print(e) 225 | 226 | # configura rete di comunicazione 227 | network_configurator = NetworkConfigurator() 228 | network_configurator.list_ethernet_devices() 229 | interface_name = network_configurator.get_interface_name("USB2.0 Ethernet Adapter") 230 | if not interface_name: 231 | interface_name = network_configurator.get_interface_name("USB 2.0 Ethernet Adapter") 232 | if interface_name: 233 | random_ip = f"192.168.2.{random.randint(200, 240)}" 234 | network_configurator.set_static_ip(interface_name, random_ip, "255.255.255.0") 235 | print('verifico connessione,attendere') 236 | network_configurator.ping_ip(random_ip) 237 | time.sleep(2) 238 | -------------------------------------------------------------------------------- /python+demo/PYD/kmNet.cp310-win_amd64.ilk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZCban/kmboxNET/1312f862a1ea7a213581d3f581e4473d35f4a103/python+demo/PYD/kmNet.cp310-win_amd64.ilk -------------------------------------------------------------------------------- /python+demo/PYD/kmNet.cp310-win_amd64.pyd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZCban/kmboxNET/1312f862a1ea7a213581d3f581e4473d35f4a103/python+demo/PYD/kmNet.cp310-win_amd64.pyd -------------------------------------------------------------------------------- /python+demo/PYD/kmNet.cp311-win_amd64.ilk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZCban/kmboxNET/1312f862a1ea7a213581d3f581e4473d35f4a103/python+demo/PYD/kmNet.cp311-win_amd64.ilk -------------------------------------------------------------------------------- /python+demo/PYD/kmNet.cp311-win_amd64.pyd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZCban/kmboxNET/1312f862a1ea7a213581d3f581e4473d35f4a103/python+demo/PYD/kmNet.cp311-win_amd64.pyd -------------------------------------------------------------------------------- /python+demo/PYD/kmNet.cp312-win_amd64.ilk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZCban/kmboxNET/1312f862a1ea7a213581d3f581e4473d35f4a103/python+demo/PYD/kmNet.cp312-win_amd64.ilk -------------------------------------------------------------------------------- /python+demo/PYD/kmNet.cp312-win_amd64.pyd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZCban/kmboxNET/1312f862a1ea7a213581d3f581e4473d35f4a103/python+demo/PYD/kmNet.cp312-win_amd64.pyd -------------------------------------------------------------------------------- /python+demo/PYD/kmNet.cp36-win_amd64.ilk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZCban/kmboxNET/1312f862a1ea7a213581d3f581e4473d35f4a103/python+demo/PYD/kmNet.cp36-win_amd64.ilk -------------------------------------------------------------------------------- /python+demo/PYD/kmNet.cp36-win_amd64.pyd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZCban/kmboxNET/1312f862a1ea7a213581d3f581e4473d35f4a103/python+demo/PYD/kmNet.cp36-win_amd64.pyd -------------------------------------------------------------------------------- /python+demo/PYD/kmNet.cp37-win_amd64.ilk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZCban/kmboxNET/1312f862a1ea7a213581d3f581e4473d35f4a103/python+demo/PYD/kmNet.cp37-win_amd64.ilk -------------------------------------------------------------------------------- /python+demo/PYD/kmNet.cp37-win_amd64.pyd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZCban/kmboxNET/1312f862a1ea7a213581d3f581e4473d35f4a103/python+demo/PYD/kmNet.cp37-win_amd64.pyd -------------------------------------------------------------------------------- /python+demo/PYD/kmNet.cp38-win_amd64.ilk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZCban/kmboxNET/1312f862a1ea7a213581d3f581e4473d35f4a103/python+demo/PYD/kmNet.cp38-win_amd64.ilk -------------------------------------------------------------------------------- /python+demo/PYD/kmNet.cp38-win_amd64.pyd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZCban/kmboxNET/1312f862a1ea7a213581d3f581e4473d35f4a103/python+demo/PYD/kmNet.cp38-win_amd64.pyd -------------------------------------------------------------------------------- /python+demo/PYD/kmNet.cp39-win_amd64.ilk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZCban/kmboxNET/1312f862a1ea7a213581d3f581e4473d35f4a103/python+demo/PYD/kmNet.cp39-win_amd64.ilk -------------------------------------------------------------------------------- /python+demo/PYD/kmNet.cp39-win_amd64.pyd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZCban/kmboxNET/1312f862a1ea7a213581d3f581e4473d35f4a103/python+demo/PYD/kmNet.cp39-win_amd64.pyd -------------------------------------------------------------------------------- /python+demo/PYD/kmNet3_9.pyd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZCban/kmboxNET/1312f862a1ea7a213581d3f581e4473d35f4a103/python+demo/PYD/kmNet3_9.pyd -------------------------------------------------------------------------------- /python+demo/demo(EN).py: -------------------------------------------------------------------------------- 1 | ''' 2 | Mouse movement call speed test ok 3 | ''' 4 | import kmNet # import kmNet module 5 | import time 6 | kmNet.init('192.168.2.188','8320','24875054') # connect to the box 7 | # Below is the time it takes for python to call the mouse movement function 10000 times 8 | t1 = time.time() 9 | cnt = 10000 10 | while cnt > 0: 11 | kmNet.move(0, 10) 12 | cnt = cnt - 1 13 | kmNet.move(0, -10) 14 | cnt = cnt - 1 15 | 16 | t2 = time.time() 17 | print('Time for 10000 calls %s ms' % ((t2 - t1) * 1000)) 18 | 19 | 20 | ''' 21 | Mouse physical monitoring ok 22 | ''' 23 | import kmNet 24 | import time 25 | kmNet.init('192.168.2.188','12545','F101383B') # connect to the box 26 | kmNet.monitor(10000) # enable keyboard and mouse monitoring function 27 | while 1: 28 | if kmNet.isdown_left(): 29 | print('left button is down') 30 | if kmNet.isdown_right(): 31 | print("right button is down") 32 | if kmNet.isdown_middle(): 33 | print("middle button is down") 34 | if kmNet.isdown_side1(): 35 | print('side1 button is down') 36 | if kmNet.isdown_side2(): 37 | print("side2 button is down") 38 | time.sleep(0.5) 39 | 40 | 41 | ''' 42 | Keyboard physical monitoring ok 43 | ''' 44 | import kmNet 45 | import time 46 | kmNet.init('192.168.2.188','12545','F101383B') # connect to the box 47 | kmNet.monitor(10000) # enable keyboard and mouse monitoring function 48 | while 1: 49 | if kmNet.isdown_keyboard(4) == 1: # 4 is the keycode for the 'A' key 50 | print('A key is down') # A key is pressed 51 | time.sleep(0.5) 52 | 53 | 54 | ''' 55 | Blocking test ok 56 | ''' 57 | import kmNet 58 | import time 59 | kmNet.init('192.168.2.188','12545','F101383B') # connect to the box 60 | kmNet.monitor(10000) # enable keyboard and mouse monitoring function 61 | kmNet.mask_keyboard(4) # block the 'A' key, pressing A will have no effect but it can be detected as pressed 62 | while 1: 63 | if kmNet.isdown_keyboard(4) == 1: # 4 is the keycode for the 'A' key 64 | print('A key is down') # A key is pressed 65 | time.sleep(0.5) 66 | 67 | 68 | ''' 69 | Image display test failed --- there's some problem. 70 | ''' 71 | import kmNet 72 | import time 73 | kmNet.init('192.168.2.188','12545','F101383B') # connect to the box 74 | pic = bytearray(gImage_128x80) # there are problems 75 | kmNet.lcd_picture(pic) 76 | -------------------------------------------------------------------------------- /python+demo/demo(IT).py: -------------------------------------------------------------------------------- 1 | ''' 2 | Test della velocità di chiamata al movimento del mouse ok 3 | ''' 4 | import kmNet # importa il modulo kmNet 5 | import time 6 | kmNet.init('192.168.2.188','8320','24875054') # connessione al dispositivo 7 | # seguente è il tempo impiegato da python per chiamare 10000 volte la funzione di movimento del mouse 8 | t1 = time.time() 9 | cnt = 10000 10 | while cnt > 0: 11 | kmNet.move(0, 10) 12 | cnt = cnt - 1 13 | kmNet.move(0, -10) 14 | cnt = cnt - 1 15 | 16 | t2 = time.time() 17 | print('10000 chiamate impiegano %s ms' % ((t2 - t1) * 1000)) 18 | 19 | 20 | ''' 21 | Monitoraggio fisico del mouse ok 22 | ''' 23 | import kmNet 24 | import time 25 | kmNet.init('192.168.2.188','12545','F101383B') # connessione al dispositivo 26 | kmNet.monitor(10000) # abilita la funzione di monitoraggio della tastiera e del mouse 27 | while 1: 28 | if kmNet.isdown_left(): 29 | print('il tasto sinistro è premuto') 30 | if kmNet.isdown_right(): 31 | print("il tasto destro è premuto") 32 | if kmNet.isdown_middle(): 33 | print("il tasto centrale è premuto") 34 | if kmNet.isdown_side1(): 35 | print('il tasto laterale 1 è premuto') 36 | if kmNet.isdown_side2(): 37 | print("il tasto laterale 2 è premuto") 38 | time.sleep(0.5) 39 | 40 | 41 | ''' 42 | Monitoraggio fisico della tastiera ok 43 | ''' 44 | import kmNet 45 | import time 46 | kmNet.init('192.168.2.188','12545','F101383B') # connessione al dispositivo 47 | kmNet.monitor(10000) # abilita la funzione di monitoraggio della tastiera e del mouse 48 | while 1: 49 | if kmNet.isdown_keyboard(4) == 1: # 4 è il codice del tasto A della tastiera 50 | print('il tasto A è premuto') # il tasto A è premuto 51 | time.sleep(0.5) 52 | 53 | 54 | ''' 55 | Test di blocco ok 56 | ''' 57 | import kmNet 58 | import time 59 | kmNet.init('192.168.2.188','12545','F101383B') # connessione al dispositivo 60 | kmNet.monitor(10000) # abilita la funzione di monitoraggio della tastiera e del mouse 61 | kmNet.mask_keyboard(4) # blocca il tasto A della tastiera, premendo A non succederà nulla, ma sarà possibile rilevarne la pressione 62 | while 1: 63 | if kmNet.isdown_keyboard(4) == 1: # 4 è il codice del tasto A della tastiera 64 | print('il tasto A è premuto') # il tasto A è premuto 65 | time.sleep(0.5) 66 | 67 | 68 | ''' 69 | Test di visualizzazione immagine fallito --- c'è qualche problema. 70 | ''' 71 | import kmNet 72 | import time 73 | kmNet.init('192.168.2.188','12545','F101383B') # connessione al dispositivo 74 | pic = bytearray(gImage_128x80) # ci sono problemi 75 | kmNet.lcd_picture(pic) 76 | -------------------------------------------------------------------------------- /python+demo/demo.py: -------------------------------------------------------------------------------- 1 | 2 | ''' 3 | 鼠标移动调用速度测试 ok 4 | ''' 5 | import kmNet #import kmNet模块 6 | import time 7 | kmNet.init('192.168.2.188','8320','24875054') #连接盒子 8 | #下面是python调用10000次鼠标移动函数的耗时 9 | t1=time.time() 10 | cnt=10000 11 | while cnt>0: 12 | kmNet.move(0,10) 13 | cnt=cnt-1 14 | kmNet.move(0,-10) 15 | cnt=cnt-1 16 | 17 | t2=time.time() 18 | print('10000次调用耗时%sms'%((t2-t1)*1000)) 19 | 20 | 21 | 22 | ''' 23 | 鼠标物理监控 ok 24 | ''' 25 | import kmNet 26 | import time 27 | kmNet.init('192.168.2.188','12545','F101383B') #连接盒子 28 | kmNet.monitor(10000)#使能键鼠监听功能 29 | while 1: 30 | if kmNet.isdown_left(): 31 | print('left is down') 32 | if kmNet.isdown_right(): 33 | print("right is down") 34 | if kmNet.isdown_middle(): 35 | print("middle is down") 36 | if kmNet.isdown_side1(): 37 | print('side1 is down') 38 | if kmNet.isdown_side2(): 39 | print("side2 is down") 40 | time.sleep(0.5)# 41 | 42 | 43 | 44 | ''' 45 | 键盘物理监控 ok 46 | ''' 47 | import kmNet 48 | import time 49 | kmNet.init('192.168.2.188','12545','F101383B') #连接盒子 50 | kmNet.monitor(10000)#使能键鼠监听功能 51 | while 1: 52 | if kmNet.isdown_keyboard(4)==1:#4是键盘A键的键值 53 | print('a is down') #a键按下 54 | time.sleep(0.5)# 55 | 56 | 57 | ''' 58 | 屏蔽测试 ok 59 | ''' 60 | import kmNet 61 | import time 62 | kmNet.init('192.168.2.188','12545','F101383B') #连接盒子 63 | kmNet.monitor(10000) #使能键鼠监听功能 64 | kmNet.mask_keyboard(4) #屏蔽键盘A建 按下a不会有任何反应。但是能检测到A按下 65 | while 1: 66 | if kmNet.isdown_keyboard(4)==1:#4是键盘A键的键值 67 | print('a is down') #a键按下 68 | time.sleep(0.5)# 69 | 70 | 71 | 72 | ''' 73 | 显示图片测试 failed ---有点问题。 74 | ''' 75 | import kmNet 76 | import time 77 | kmNet.init('192.168.2.188','12545','F101383B') #连接盒子 78 | pic=bytearray(gImage_128x80) #有问题 79 | kmNet.lcd_picture(pic) 80 | -------------------------------------------------------------------------------- /python+demo/kmNet.cp311-win_amd64.pyd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZCban/kmboxNET/1312f862a1ea7a213581d3f581e4473d35f4a103/python+demo/kmNet.cp311-win_amd64.pyd -------------------------------------------------------------------------------- /upgrade tools/01-Drive.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZCban/kmboxNET/1312f862a1ea7a213581d3f581e4473d35f4a103/upgrade tools/01-Drive.exe -------------------------------------------------------------------------------- /upgrade tools/02-Upgrade Tool.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZCban/kmboxNET/1312f862a1ea7a213581d3f581e4473d35f4a103/upgrade tools/02-Upgrade Tool.exe -------------------------------------------------------------------------------- /upgrade tools/WCHUSBNIC.EXE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZCban/kmboxNET/1312f862a1ea7a213581d3f581e4473d35f4a103/upgrade tools/WCHUSBNIC.EXE -------------------------------------------------------------------------------- /upgrade tools/firmware/kmboxNet20240921_13h39m43s.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZCban/kmboxNET/1312f862a1ea7a213581d3f581e4473d35f4a103/upgrade tools/firmware/kmboxNet20240921_13h39m43s.bin -------------------------------------------------------------------------------- /upgrade tools/firmware/kmboxNet20241001_16h36m27s.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZCban/kmboxNET/1312f862a1ea7a213581d3f581e4473d35f4a103/upgrade tools/firmware/kmboxNet20241001_16h36m27s.bin -------------------------------------------------------------------------------- /upgrade tools/firmware/kmboxNet20241016_12h25m42s.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZCban/kmboxNET/1312f862a1ea7a213581d3f581e4473d35f4a103/upgrade tools/firmware/kmboxNet20241016_12h25m42s.bin -------------------------------------------------------------------------------- /upgrade tools/firmware/kmboxNet20241114_13h57m33s.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZCban/kmboxNET/1312f862a1ea7a213581d3f581e4473d35f4a103/upgrade tools/firmware/kmboxNet20241114_13h57m33s.bin -------------------------------------------------------------------------------- /upgrade tools/firmware/kmboxNet_fw20240525_11h37m58s.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZCban/kmboxNET/1312f862a1ea7a213581d3f581e4473d35f4a103/upgrade tools/firmware/kmboxNet_fw20240525_11h37m58s.bin -------------------------------------------------------------------------------- /upgrade tools/kmboxNet TOOLS.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZCban/kmboxNET/1312f862a1ea7a213581d3f581e4473d35f4a103/upgrade tools/kmboxNet TOOLS.exe --------------------------------------------------------------------------------