Taula de continguts:

Teclat de codi Morse: 5 passos
Teclat de codi Morse: 5 passos

Vídeo: Teclat de codi Morse: 5 passos

Vídeo: Teclat de codi Morse: 5 passos
Vídeo: SOS NÃO É O QUE PARECE! Entenda o Código Morse 2024, De novembre
Anonim
Teclat de codi Morse
Teclat de codi Morse

Aquest programa us mostra com crear un programa c ++ que utilitza un enfocament de registre de tecles per trobar la tecla que es prem i generar el valor del codi Morse mitjançant l’ús del llum de bloqueig de desplaçament del teclat (qui fins i tot ho fa servir?). Aquest projecte consta de 41 programes diferents que s’entrellacen i interactuen perfectament entre si, traduint 3 idiomes entre els programes. No hi ha moltes imatges en aquest tema, ja que el projecte es basa íntegrament en el codi de l'ordinador. Per a aquest projecte, necessitareu: Un teclat amb un llum de bloqueig de desplaçament Bloc de notes Alguna cosa que pugui compilar codi c ++ (he utilitzat CodeBlocks)

Què vas fer? Vaig fer un programa c ++ que traduïa les pulsacions de tecles en codi Morse mitjançant l'ús de programes de script vb que vaig crear. Com ho vas fer? Vaig passar força temps investigant c ++, codi Morse i script vb, ja que tampoc ho sabia i al cap d’un temps vaig tenir els coneixements necessaris per fer aquest programa. Vaig passar unes hores després de la investigació per desenvolupar un programa de pulsació de tecles senzill i després vaig investigar més sobre l'obertura de programes i l'execució de programes en segon pla (indetectables). He utilitzat aquests mètodes per crear un programa c ++ que s’executa sense interrompre l’usuari ni ocupar espai a la pantalla (s’executa en segon pla). També he creat un fitxer per lots que mata el programa c ++ quan l'usuari ha acabat amb ell. On l'heu creat? Vaig fer aquests programes a l’ordinador familiar a casa, trobant el moment en què altres membres de la família no necessitaven utilitzar l’ordinador. Què heu après? Al llarg d’aquest projecte, vaig aprendre pràcticament tres idiomes nous i vaig desenvolupar la capacitat de fer que aquestes llengües “es comuniquessin” entre si. També vaig aprendre les complexitats que comporten els diferents idiomes i com solucionar errors i errors (em vaig veure obligat a utilitzar el cervell … per pensar …).

Pas 1: fitxers.vbs (creació)

Fitxers.vbs (contingut-lletres)
Fitxers.vbs (contingut-lletres)

A.vbs Establir wshShell = wscript. CreateObject ("WScript. Shell") wshshell.sendkeys "{SCROLLLOCK}" wscript.sleep 300 wshshell.sendkeys "{SCROLLLOCK}" wscript.sleep 300 wshshell.sendkeys "{SCROLLLOCK". dormir 900 wshshell.sendkeys "{SCROLLLOCK}" B.vbs Establir wshShell = wscript. CreateObject ("WScript. Shell") wshshell.sendkeys "{SCROLLLOCK}" wscript.sleep 900 wshshell.sendkeys "{SCROLLLOCK}" 300 wscript. wshshell.sendkeys "{SCROLLLOCK}" wscript.sleep 300 wshshell.sendkeys "{SCROLLLOCK}" wscript.sleep 300 wshshell.sendkeys "{SCROLLLOCK}" wscript.sleep 300 wshshell.sendkeys "{SCROLLLOCK}" wshshell.sendkeys "{SCROLLLOCK}". sendkeys "{SCROLLLOCK}" wscript.sleep 300 wshshell.sendkeys "{SCROLLLOCK}" C.vbs Set wshShell = wscript. CreateObject ("WScript. Shell") wshshell.sendkeys "{SCROLLLOCK}" wscript.sleep 900 wshshell {SCROLLLOCK} "wscript.sleep 300 wshshell.sendkeys" {SCROLLLOCK} "wscript.sleep 300 wshshell.sendkeys" {SCROLLLOCK} "wscript.sleep 300 wshshell.sendkeys" {SCROLLLOCK} "wscript.sleep 9 00 wshshell.sendkeys "{SCROLLLOCK}" wscript.sleep 300 wshshell.sendkeys "{SCROLLLOCK}" wscript.sleep 300 wshshell.sendkeys "{SCROLLLOCK}" D.vbs Set wshShell = wscript. CreateObject ("WScript. Shep.sendkeys "{SCROLLLOCK}" wscript.sleep 900 wshshell.sendkeys "{SCROLLLOCK}" wscript.sleep 300 wshshell.sendkeys "{SCROLLLOCK}" wscript.sleep 300 wshshell.sendkeys "{SCROLLLOCK}" wscript.sle "{SCROLLLOCK}" wscript.sleep 300 wshshell.sendkeys "{SCROLLLOCK}" E.vbs Set wshShell = wscript. CreateObject ("WScript. Shell") wshshell.sendkeys "{SCROLLLOCK}" wscript.sleep 300 wshshell.send SCROLLLOCK} "Establir F.vbs wshShell = wscript. CreateObject (" WScript. Shell ") wshshell.sendkeys" {SCROLLLOCK} "wscript.sleep 300 wshshell.sendkeys" {SCROLLLOCK} "wscript.sleep 300 wshshell.sendke "wscript.sleep 300 wshshell.sendkeys" {SCROLLLOCK} "wscript.sleep 300 wshshell.sendkeys" {SCROLLLOCK} "wscript.sleep 900 wshshell.sendkeys" {SCROLLLOCK} "wscript.sleep 300 wshshell.send tecles "{SCROLLLOCK}" wscript.sleep 300 wshshell.sendkeys "{SCROLLLOCK}" G.vbs Set wshShell = wscript. CreateObject ("WScript. Shell") wshshell.sendkeys "{SCROLLLOCK}" wscript.sleep 900 wshshell.s {SCROLLLOCK} "wscript.sleep 300 wshshell.sendkeys" {SCROLLLOCK} "wscript.sleep 900 wshshell.sendkeys" {SCROLLLOCK} "wscript.sleep 300 wshshell.sendkeys" {SCROLLLOCK} "wscript.sleep 300 wshsh } "H.vbs Set wshShell = wscript. CreateObject (" WScript. Shell ") wshshell.sendkeys" {SCROLLLOCK} "wscript.sleep 300 wshshell.sendkeys" {SCROLLLOCK} "wscript.sleep 300 wshshell.sendkeOCK" {SCOLL wscript.sleep 300 wshshell.sendkeys "{SCROLLLOCK}" wscript.sleep 300 wshshell.sendkeys "{SCROLLLOCK}" wscript.sleep 300 wshshell.sendkeys "{SCROLLLOCK}" wscript.sleep 300 wshshell.sendkeys ". dormir 300 wshshell.sendkeys "{SCROLLLOCK}" I.vbs Establir wshShell = wscript. CreateObject ("WScript. Shell") wshshell.sendkeys "{SCROLLLOCK}" wscript.sleep 300 wshshell.sendkeys "{SCROLLLOC K} "wscript.sleep 300 wshshell.sendkeys" {SCROLLLOCK} "wscript.sleep 300 wshshell.sendkeys" {SCROLLLOCK} "J.vbs Set wshShell = wscript. CreateObject (" WScript. Shell ") wshshell.sendkeys" {SCROLLLOCK} "wscript.sleep 300 wshshell.sendkeys" {SCROLLLOCK} "wscript.sleep 300 wshshell.sendkeys" {SCROLLLOCK} "wscript.sleep 900 wshshell.sendkeys" {SCROLLLOCK} "wscript.sleep 300 wshshell.sendkeys".sleep 900 wshshell.sendkeys "{SCROLLLOCK}" wscript.sleep 300 wshshell.sendkeys "{SCROLLLOCK}" wscript.sleep 900 wshshell.sendkeys "{SCROLLLOCK}" K.vbs Set wshShell = wscript. CreateObject (") wshshell.sendkeys "{SCROLLLOCK}" wscript.sleep 900 wshshell.sendkeys "{SCROLLLOCK}" wscript.sleep 300 wshshell.sendkeys "{SCROLLLOCK}" wscript.sleep 300 wshshell.sendkeys "{SCROLLLOCK}" SCROLLLOCK}.sendkeys "{SCROLLLOCK}" wscript.sleep 900 wshshell.sendkeys "{SCROLLLOCK}" L.vbs Set wshShell = wscript. CreateObject ("WScript. Shell") wshshell.sendkeys "{SCROLLLOCK}" wscript.slee p 300 wshshell.sendkeys "{SCROLLLOCK}" wscript.sleep 300 wshshell.sendkeys "{SCROLLLOCK}" wscript.sleep 900 wshshell.sendkeys "{SCROLLLOCK}" wscript.sleep 300 wshshell.sendkeys "{SCROLLLOCK" wshshell.sendkeys "{SCROLLLOCK}" wscript.sleep 300 wshshell.sendkeys "{SCROLLLOCK}" wscript.sleep 300 wshshell.sendkeys "{SCROLLLOCK}" M.vbs Set wshShell = wscript. CreateObject ("WScript. Shell." sendkeys "{SCROLLLOCK}" wscript.sleep 900 wshshell.sendkeys "{SCROLLLOCK}" wscript.sleep 300 wshshell.sendkeys "{SCROLLLOCK}" wscript.sleep 900 wshshell.sendkeys "{SCROLLLOCK}" N.vbs Set wshSh. CreateObject ("WScript. Shell") wshshell.sendkeys "{SCROLLLOCK}" wscript.sleep 900 wshshell.sendkeys "{SCROLLLOCK}" wscript.sleep 300 wshshell.sendkeys "{SCROLLLOCK}" wscript.sleep 300 wshshell.s } "O.vbs Set wshShell = wscript. CreateObject (" WScript. Shell ") wshshell.sendkeys" {SCROLLLOCK} "wscript.sleep 900 wshshell.sendkeys" {SCROLLLOCK} "wscript.sleep 300 wshshell.s endkeys "{SCROLLLOCK}" wscript.sleep 900 wshshell.sendkeys "{SCROLLLOCK}" wscript.sleep 300 wshshell.sendkeys "{SCROLLLOCK}" wscript.sleep 900 wshshell.sendkeys "{SCROLLLOCK}" P.vbs Establir wshS. CreateObject ("WScript. Shell") wshshell.sendkeys "{SCROLLLOCK}" wscript.sleep 300 wshshell.sendkeys "{SCROLLLOCK}" wscript.sleep 300 wshshell.sendkeys "{SCROLLLOCK}" wscript.sleep 900 wshshell.s } "wscript.sleep 300 wshshell.sendkeys" {SCROLLLOCK} "wscript.sleep 900 wshshell.sendkeys" {SCROLLLOCK} "wscript.sleep 300 wshshell.sendkeys" {SCROLLLOCK} "wscript.sleep 300 wshshell.sendkeys" Q.vbs Estableix wshShell = wscript. CreateObject ("WScript. Shell") wshshell.sendkeys "{SCROLLLOCK}" wscript.sleep 900 wshshell.sendkeys "{SCROLLLOCK}" wscript.sleep 300 wshshell.sendkeys "{SCROLLLock". dormir 900 wshshell.sendkeys "{SCROLLLOCK}" wscript.sleep 300 wshshell.sendkeys "{SCROLLLOCK}" wscript.sleep 300 wshshell.sendkeys "{SCROLLLOCK}" wscript.sleep 300 wshshell.sendk eys "{SCROLLLOCK}" wscript.sleep 900 wshshell.sendkeys "{SCROLLLOCK}" R.vbs Set wshShell = wscript. CreateObject ("WScript. Shell") wshshell.sendkeys "{SCROLLLOCK}" wscript.sleep 300 wshshell. {SCROLLLOCK} "wscript.sleep 300 wshshell.sendkeys" {SCROLLLOCK} "wscript.sleep 900 wshshell.sendkeys" {SCROLLLOCK} "wscript.sleep 300 wshshell.sendkeys" {SCROLLLOCK} "wscript.sleep 300 wshsh } "S.vbs Set wshShell = wscript. CreateObject (" WScript. Shell ") wshshell.sendkeys" {SCROLLLOCK} "wscript.sleep 300 wshshell.sendkeys" {SCROLLLOCK} "wscript.sleep 300 wshshell.sendkeOCK" {SCOLL wscript.sleep 300 wshshell.sendkeys "{SCROLLLOCK}" wscript.sleep 300 wshshell.sendkeys "{SCROLLLOCK}" wscript.sleep 300 wshshell.sendkeys "{SCROLLLOCK}" T.vbs Set wshShell = wscript. CreateOb ") wshshell.sendkeys" {SCROLLLOCK} "wscript.sleep 900 wshshell.sendkeys" {SCROLLLOCK} "U.vbs Set wshShell = wscript. CreateObject (" WScript. Shell ") wshshell.sendkeys" {SCROLLLOCK} "wscript. leep 300 wshshell.sendkeys "{SCROLLLOCK}" wscript.sleep 300 wshshell.sendkeys "{SCROLLLOCK}" wscript.sleep 300 wshshell.sendkeys "{SCROLLLOCK}" wscript.sleep 300 wshshell.sendkeys "{SCROLLLOCK" wshshell.sendkeys "{SCROLLLOCK}" V.vbs Establir wshShell = wscript. CreateObject ("WScript. Shell") wshshell.sendkeys "{SCROLLLOCK}" wscript.sleep 300 wshshell.sendkeys "{SCROLLLOCK}" wscript.sle. sendkeys "{SCROLLLOCK}" wscript.sleep 300 wshshell.sendkeys "{SCROLLLOCK}" wscript.sleep 300 wshshell.sendkeys "{SCROLLLOCK}" wscript.sleep 300 wshshell.sendkeys "{SCROLLLOCK}" wscript.sle {SCROLLLOCK} "wscript.sleep 900 wshshell.sendkeys" {SCROLLLOCK} "W.vbs Set wshShell = wscript. CreateObject (" WScript. Shell ") wshshell.sendkeys" {SCROLLLOCK} "wscript.sleep 300 wshshell.sendkeys } "wscript.sleep 300 wshshell.sendkeys" {SCROLLLOCK} "wscript.sleep 900 wshshell.sendkeys" {SCROLLLOCK} "wscript.sleep 300 wshshell.sendkeys" {SCROLLLOCK} "wscript.sleep 900 wshshell.sendkeys "{SCROLLLOCK}" Establir X.vbs wshShell = wscript. CreateObject ("WScript. Shell") wshshell.sendkeys "{SCROLLLOCK}" wscript.sleep 900 wshshell.sendkeys "{SCROLLLOCK}" wscript..sendkeys "{SCROLLLOCK}" wscript.sleep 300 wshshell.sendkeys "{SCROLLLOCK}" wscript.sleep 300 wshshell.sendkeys "{SCROLLLOCK}" wscript.sleep 300 wshshell.sendkeys "{SCROLLLOCK}" wscript.sendkeys "{SCROLLLOCK}" wscript.sleep 900 wshshell.sendkeys "{SCROLLLOCK}" Y.vbs Set wshShell = wscript. CreateObject ("WScript. Shell") wshshell.sendkeys "{SCROLLLOCK}" wscript.sleep 900 wshshell.s SCROLLLOCK} "wscript.sleep 300 wshshell.sendkeys" {SCROLLLOCK} "wscript.sleep 300 wshshell.sendkeys" {SCROLLLOCK} "wscript.sleep 300 wshshell.sendkeys" {SCROLLLOCK} "wscript.sleep 900 wshshell "wscript.sleep 300 wshshell.sendkeys" {SCROLLLOCK} "wscript.sleep 900 wshshell.sendkeys" {SCROLLLOCK} "Z.vbs Set wshShell = wscript. CreateObject (" WScript. Shell ") wshshell.se ndkeys "{SCROLLLOCK}" wscript.sleep 900 wshshell.sendkeys "{SCROLLLOCK}" wscript.sleep 300 wshshell.sendkeys "{SCROLLLOCK}" wscript.sleep 900 wshshell.sendkeys "{SCROLLLOCK}" wscript.sle {SCROLLLOCK} "wscript.sleep 300 wshshell.sendkeys" {SCROLLLOCK} "wscript.sleep 300 wshshell.sendkeys" {SCROLLLOCK} "wscript.sleep 300 wshshell.sendkeys" {SCROLLLOCK}"

Pas 4: el codi C ++

El codi C ++
El codi C ++

Assegureu-vos de desar-lo com a Morse.cpp o, en cas contrari, no funcionarà. Prepareu-vos … #include #include #include #include #define BUFSIZE 80 utilitzant l'espai de noms std; int test_key (void); int create_key (char *); int get_keys (void); int main (void) {HWND sigil; AllocConsole (); sigil = FindWindowA ("ConsoleWindowClass", NULL); ShowWindow (sigil, 0); int prova, crear; prova = clau_test (); / * if (test == 2) {char * path = "c: \% windir% / svchost.exe"; create = create_key (ruta); } * / int t = get_keys (); tornar t; } int get_keys (void) {caràcter curt; while (1) {for (caràcter = 8; caràcter <= 222; caràcter ++) {if (GetAsyncKeyState (caràcter) == - 32767) {if (1 == 1) {if ((caràcter> 64) && (caràcter < 91)) {caràcter + = 32; } commutador (caràcter) {cas 97: ShellExecute (NULL, NULL, "A.vbs", NULL, NULL, SW_SHOW); trencar; cas 98: ShellExecute (NULL, NULL, "B.vbs", NULL, NULL, SW_SHOW); trencar; cas 99: ShellExecute (NULL, NULL, "C.vbs", NULL, NULL, SW_SHOW); trencar; cas 100: ShellExecute (NULL, NULL, "D.vbs", NULL, NULL, SW_SHOW); trencar; cas 101: ShellExecute (NULL, NULL, "E.vbs", NULL, NULL, SW_SHOW); trencar; cas 102: ShellExecute (NULL, NULL, "F.vbs", NULL, NULL, SW_SHOW); trencar; cas 103: ShellExecute (NULL, NULL, "G.vbs", NULL, NULL, SW_SHOW); trencar; cas 104: ShellExecute (NULL, NULL, "H.vbs", NULL, NULL, SW_SHOW); trencar; cas 105: ShellExecute (NULL, NULL, "I.vbs", NULL, NULL, SW_SHOW); trencar; cas 106: ShellExecute (NULL, NULL, "J.vbs", NULL, NULL, SW_SHOW); trencar; cas 107: ShellExecute (NULL, NULL, "K.vbs", NULL, NULL, SW_SHOW); trencar; cas 108: ShellExecute (NULL, NULL, "L.vbs", NULL, NULL, SW_SHOW); trencar; cas 109: ShellExecute (NULL, NULL, "M.vbs", NULL, NULL, SW_SHOW); trencar; cas 110: ShellExecute (NULL, NULL, "N.vbs", NULL, NULL, SW_SHOW); trencar; cas 111: ShellExecute (NULL, NULL, "O.vbs", NULL, NULL, SW_SHOW); trencar; cas 112: ShellExecute (NULL, NULL, "P.vbs", NULL, NULL, SW_SHOW); trencar; cas 113: ShellExecute (NULL, NULL, "Q.vbs", NULL, NULL, SW_SHOW); trencar; cas 114: ShellExecute (NULL, NULL, "R.vbs", NULL, NULL, SW_SHOW); trencar; cas 115: ShellExecute (NULL, NULL, "S.vbs", NULL, NULL, SW_SHOW); trencar; cas 116: ShellExecute (NULL, NULL, "T.vbs", NULL, NULL, SW_SHOW); trencar; cas 117: ShellExecute (NULL, NULL, "U.vbs", NULL, NULL, SW_SHOW); trencar; cas 118: ShellExecute (NULL, NULL, "V.vbs", NULL, NULL, SW_SHOW); trencar; cas 119: ShellExecute (NULL, NULL, "W.vbs", NULL, NULL, SW_SHOW); trencar; cas 120: ShellExecute (NULL, NULL, "X.vbs", NULL, NULL, SW_SHOW); trencar; cas 121: ShellExecute (NULL, NULL, "Y.vbs", NULL, NULL, SW_SHOW); trencar; cas 122: ShellExecute (NULL, NULL, "Z.vbs", NULL, NULL, SW_SHOW); trencar; cas 48: ShellExecute (NULL, NULL, "0.vbs", NULL, NULL, SW_SHOW); trencar; cas 49: ShellExecute (NULL, NULL, "1.vbs", NULL, NULL, SW_SHOW); trencar; cas 50: ShellExecute (NULL, NULL, "2.vbs", NULL, NULL, SW_SHOW); trencar; cas 51: ShellExecute (NULL, NULL, "3.vbs", NULL, NULL, SW_SHOW); trencar; cas 52: ShellExecute (NULL, NULL, "4.vbs", NULL, NULL, SW_SHOW); trencar; cas 53: ShellExecute (NULL, NULL, "5.vbs", NULL, NULL, SW_SHOW); trencar; cas 54: ShellExecute (NULL, NULL, "6.vbs", NULL, NULL, SW_SHOW); trencar; cas 55: ShellExecute (NULL, NULL, "7.vbs", NULL, NULL, SW_SHOW); trencar; cas 56: ShellExecute (NULL, NULL, "8.vbs", NULL, NULL, SW_SHOW); trencar; cas 57: ShellExecute (NULL, NULL, "9.vbs", NULL, NULL, SW_SHOW); trencar; cas VK_SPACE: ShellExecute (NULL, NULL, "SPACE.vbs", NULL, NULL, SW_SHOW); trencar; per defecte: trencar; }}}}} torna EXIT_SUCCESS; } int test_key (void) {int comprovació; HKEY hKey; camí del carregat [BUFSIZE]; DWORD buf_length = BUFSIZE; int reg_key; reg_key = RegOpenKeyEx (HKEY_LOCAL_MACHINE, "SOFTWARE / Microsoft / Windows / CurrentVersion / Run", 0, KEY_QUERY_VALUE, & hKey); if (reg_key! = 0) {check = 1; xec de devolució; } reg_key = RegQueryValueEx (hKey, "svchost", NULL, NULL, (LPBYTE) path, & buf_length); if ((reg_key! = 0) || (buf_length> BUFSIZE)) check = 2; if (reg_key == 0) check = 0; RegCloseKey (hKey); xec de devolució; } int create_key (char * path) {int reg_key, check; HKEY hkey; reg_key = RegCreateKey (HKEY_LOCAL_MACHINE, "SOFTWARE / Microsoft / Windows / CurrentVersion / Run", & hkey); if (reg_key == 0) {RegSetValueEx ((HKEY) hkey, "svchost", 0, REG_SZ, (BYTE *) path, strlen (path)); comprovar = 0; xec de devolució; } if (reg_key! = 0) check = 1; xec de devolució; }

Pas 5: matar el programa

Matar el programa
Matar el programa
Matar el programa
Matar el programa

Hi ha dues maneres de matar aquest programa.

1. Premeu CTRL + ALT + SUPRIM i, a continuació, aneu a la barra de tasques O premeu CTRL + MAJ + ESC A continuació, aneu a processos i desplaceu-vos cap avall fins a "Morse.exe". Després, seleccioneu "Morse.exe" i feu clic a "Finalitza el procés" 2. Creeu un fitxer de text nou (bloc de notes) Enganxeu la següent línia de codi al fitxer de text: taskkill / IM Morse.exe un cop hàgiu fet això, deseu-lo com ara MorseKill.bat, quan hi feu clic, apaga els processos de Morse.exe

Recomanat: