
Originally Posted by
lester
In the interests of helping you to develop your own code.
This is an example of how such a device works:
When the “DATA LOGGER” is powered up it searches the EEPROM for the first empty memory cell. This will be the new write position and older recording sessions will not be deleted. If this position is found, the “DATA LOGGER” will write '***RESET***' to the memory. That means a user can later see when the PC (and the “DATA LOGGER”) was powered up.
In normal operation the “DATA LOGGER” will only listen to the DATA and CLK line of your PS/2 keyboard. The scancodes that come across these lines (e.g. a certain key is pressed or is released) are filtered, because not all keystrokes can be stored (will be explained later). If a scancode passes the filter, it is written into the external EEPROM (e.g. 24C64). The value 0xFF will never be written to the EEPROM as a recorded keystroke, beacuse this is the mark for an emty memory cell. If the EEPROM is cleared ba the “DATA LOGGER”, the value 0xFF is written to all memory cells.
In the normal operation, the “DATA LOGGER” will listen to the scancodes and will recognize if the supervisor password is entered. With this password entered one has the possibility to get access to the “DATA LOGGER” menu that will appear on the screen. If the password is entered, the “DATA LOGGER” will leave its listen-state, will disconnect the keyboard from the PC and will speak to the PC itself like a 'real' keyboard. Before that, a n editor (like NOTEPAD.EXE) has to be opened. The following menu will appear on the screen:
***”DATA LOGGER” V2.0
-o-utput EEPROM
-e-rase EEPROM
-c-hange password
-u-sed memory
By pressing 'o' the supervisor can display all the recorded keystrokes on the screen. The PIC will go into output mode and send all recorded key scancodes to the PC and return to receive mode. The recorded keystrokes remain in memory and the next recording session can begin. Now you will understand that not all the keystrokes that someone has entered before can be played back to the PC. Think, if the “DATA LOGGER” would send Alt-Tab to the PC... the focus would jump out of your editor window and all the recorded keystrokes could do anythink to your machine, that you don't really want...!
If 'e' is pressed, the “Data Logger” will start clearing the EEPROM completely by writing 0xFF to all memory locations. As soon as finished (it will take only a few seconds) the screen displays:
Wait...done.
By pressing 'c' in the menu, the supervisor will be prompted to enter an new password that will be the new supervisor password. This password will be stored in the internal EEPROM of the PIC16C84. If you don't remeber that password, you don't have to reprogram the PIC, but you can reset the password to the default password by connecting the RB4 pin to ground in the power up state.
The option 'used memory' will display the used size and the total size of the connected external EEPROM in hexadecimal.
Limitations:
The “DATA LOGGER” Software will record all keys on the alphanumeric keypad except the TAB-key, the '^'-key, caps-lock, delete, Ctrl, Alt, and Alt-Gr. The left and the right shift key and the return key will be recorded. These limitations are necessary, because otherwise the “DATA LOGGER” output may let the focus 'jump' out of the editor window while playing back recorded keystrokes.
The “DATA LOGGER” can only record one scancode set. There are a few keyboards that use a different scancode set. If a PS/2 keyboard is used in combination with a PS/2 mouse, the mouse must not be moved during “DATA LOGGER” playback, because the mouse will affect the CLOCK line of the keyboard.
The "DATA LOGGER" consists of the following devices:
* Microcontroller PIC16C84
* CMOS analog switch 4053
* serial I˛C EEPROM 24C32, 24C64, 24C128, 24C256 or 24C512
In normal operation mode the CMOS analog switch connects the data and clock line from PC to keyboard. The keyboard is always powered with the 5V from the PC. If any key is pressed the PIC receives the keystrokes on the clock and data line, decodes them and stores them in the EEPROM. If the user enters a specific password, the PIC will disconnect the keyboard from the PC and talks to the PC itself.
Bookmarks