KbStuffer Version 1.0 Copyright 1993, William L. Moussiaux All Rights Reserved Published by: William L. Moussiaux 1839 LawnView Drive Frederick, Maryland 21702 Fax (301) 662-3909 CompuServe Id 72623,3533 Table of Contents Table of Contents....................................................2 Introduction.........................................................3 License Agreement and Warranty Disclaimer............................4 Definition of Shareware..............................................6 Registration Information.............................................7 Full Registration...............................................7 Lite Registration...............................................7 Site Registration...............................................7 Parameters for KbStuffer.............................................8 Summary of Parameters...........................................8 /?- Display Help................................................8 /D# - Change Monitor Read/Write Delay...........................8 /L - Log Messages...............................................8 /M# - Change Shared Memory Size.................................8 /NC - Turn Colors Off...........................................9 /P# - Change Printer Port.......................................9 /S# - Change Scan Code Set......................................9 /X - Display Extra Messages.....................................9 Main Screen.........................................................10 Help Menu...........................................................11 [B]ug Report...................................................11 [C]ontrol Key List.............................................11 [M]emory Information...........................................11 [P]arameters...................................................12 [R]egister.....................................................12 [S]yntax Help..................................................12 [T]urn Options On/Off..........................................13 [C]olors..................................................13 [E]xtra Information Displayed.............................13 [L]og All Messages To Disk................................13 [P]rinter Port............................................14 [Q]uit On/Off Menu........................................14 [Q]uit Help Menu...............................................14 Sending Data to KbStuffer...........................................15 Using Stuffer.exe..............................................15 Stuffing data to another OS/2 Session.....................15 Control Codes.......................................................16 Multiple Keys..................................................16 Special Case Control Codes.....................................17 Summary...................................................17 WT# - Wait for # Milliseconds.............................17 WK# - Wait Between all Keystrokes.........................17 QU - Quit KbStuffer Program...............................17 QE - Quit KbStuffer Program and EXIT......................17 AE - ALT and ESC Key Sequence.............................18 CE - CTRL and ESC Key Sequence............................18 CM - Close Monitors.......................................18 Page 1 Scan Codes..........................................................19 Using Shared Memory and System Semaphores...........................20 To send keystroke data to KbStuffer............................20 To attach to shared memory.....................................20 To place data into KbStuffer's shared memory...................20 Appendix A - Control Key Codes......................................21 Appendix B - Scan Code Numbers......................................22 Appendix C - Known Problems With KbStuffer..........................23 Appendix D - Shared Memory and Semaphores...........................24 Appendix E - Future Releases........................................25 Page 2 Introduction KbStuffer is an OS/2 Full Screen Keyboard Buffer Stuffer. Keystroke data can be stuffed into the current OS/2 Session's keyboard buffer, or any other currently running OS/2 Full Screen Session. Keystroke data can be placed into the keyboard buffer: * By using the supplied program, Stuffer.exe. * By tapping into KbStuffer through shared memory and system semaphores. To start KbStuffer, type KbStuff [ENTER] at an OS/2 Full Screen or OS/2 Windowed Prompt. KbStuffer will not stuff data to an OS/2 Windowed Session, DOS Session or a PM application. The registered version of KbStuffer may be detached. If running KbStuffer in detached mode, using the /L option is recommended to create a log file of any messages generated by KbStuffer. Page 3 License Agreement and Warranty Disclaimer Please read the following terms and conditions. Use of this software constitutes your acceptance of these terms and conditions, and your agreement to abide by them. If you do not agree with them, do not use the software. You are hereby licensed to use the Shareware Version of KbStuffer for a 30 day evaluation period. Please make as many copies of the Shareware Version of this software and documentation as you wish. Give exact copies of the original Shareware Version to anyone and distribute the Shareware Version of KbStuffer and documentation in its unmodified form via electronic means. There is no charge of any of the above. You are specifically prohibited from charging, or requesting donations, for any copies, however made, and from distributing the software and/or documentation with other products (commercial or otherwise) without prior written permission, with one exception: Disk Vendors approved by the Association of Shareware professionals (ASP) are permitted to redistribute KbStuffer, subject to the conditions in this license, without specific written permission. This software is covered by United Stated Copyright law and international treaty conventions. For the Registration price you are granted a license to use the product subject to the following terms and conditions: 1. The registered version of KbStuffer will only be used by a single person who uses the software on one or more computers or to a single workstation used by multiple people. 2. A separate "site license" and fee is required if the registered version of KbStuffer is to be run on more then one machine by more than one person. Accessing the registered version of KbStuffer through a Local Area Network (or similar artifact) by multiple people on multiple machines, also requires a "site license". 3. The programs and other files contained with the registered version of KbStuffer may not be duplicated or copied except for archival purposes, installation on the operational machines as outlined above, or to replace defective media. 4. Any copies must bear the copyright notices contained in the original product. 5. No copies of the registered version of KbStuffer may be produced for sale to third parties or for any purpose other than given above. The registered version of KbStuffer software may not be placed on any bulletin board or other electronic systems where others can download the software program. Page 4 6. This license may be transferred to a third party, provided the third party agrees to all the terms of this licensing agreement, and all copies are transferred to the new licensee or destroyed by the original licensee. We reserve the right to assess a small charge to process the change in registration. 7. Registering of KbStuffer does not transfer any right, title, or interest in KbStuffer or the associated programs, except as specifically set forth in this agreement. 8. This Agreement shall be construed and enforced in accordance with the laws of the state of Maryland. Any action taken by either party relating to this agreement shall be brought only in a State or Federal Court in Frederick, Maryland. 9. If any provision of this Agreement is found to be invalid, or unenforceable, it will not affect the validity of the balance of the Agreement. 10. This software is provided "as is" without any warranty of any kind. The entire risk is assumed by the purchaser. Under no circumstances shall the licenser be held liable for more than the purchase price of the product. If the media proves defective it will be replaced. Page 5 Definition of Shareware Shareware distribution gives users a chance to try software before buying it. If you try a Shareware program and continue using it, you are expected to register. Individual programs differ on details -- some request registration while others require it, some specify a maximum trial period. With registration, you get anything from the simple right to continue using the software to an updated program with printed manual. Copyright laws apply to both Shareware and Commercial Software, and the copyright holder retains all rights, with a few specific exceptions as stated below. Shareware authors are accomplished programmers, just like commercial authors, and the programs are of comparable quality. (In both cases, there are good programs and bad ones.) The main difference is in the method of distribution. The author specifically grants the right to copy and distribute the software, either to all and sundry or to a specific group. For example, some authors require written permission before a commercial disk vendor may copy their Shareware. Shareware is a distribution method, not a type of software. You should find software that suits your needs and pocketbook, whether it's Commercial or Shareware. The Shareware system makes fitting your needs easier, because you can try before you buy. And because the overhead is low, prices are low also. Shareware has the ultimate money-back guarantee -- if you don't use the product, you don't pay for it. You are encouraged to pass a copy of the unregistered version of KbStuffer along to your friends for evaluation. Please encourage them to register their copy if they find that they can use it. Page 6 Registration Information KbStuffer is Shareware. You are allowed to try KbStuffer for a period not to exceed 30 days. After such time if you decided you like KbStuffer, you must register your copy. KbStuffer registration comes in three different forms. Please see the file Register.frm for a complete list of registration prices. Full Registration A full registration of KbStuffer is available for fifty dollars ($50) in U.S.A. Funds. For the registration price you will receive: 1. A disk containing the latest registered version of KbStuffer. This registered version does not contain any Shareware Registration information. Therefore the registered version of KbStuffer will be somewhat smaller and faster. 2. A printed users manual for KbStuffer. 3. Free updates of KbStuffer for one year from date of registration. 4. Free technical support by phone, fax, mail and CompuServe. Lite Registration A lite registration of KbStuffer is also available for thirty dollars ($30) in U.S.A. Funds. For the registration price you will receive: 1. A registration code to register your copy of KbStuffer using Register.exe. 2. Update notifications of KbStuffer for one year from date of registration. The update notification will inform you that a new version of KbStuffer is available and where it may be found. Along with the update notification, you will receive a new registration code for the new version of KbStuffer. 3. Free technical support by phone, fax, mail and CompuServe. Site Registration If KbStuffer is to be utilized on more than one machine by more than one person or accessed on a Local Area Network (or similar artifact) by multiple people on multiple machines, a "site license" is required. Please see the file Register.frm for pricing on "site licensing" for KbStuffer. For a site registration of KbStuffer you will receive: 1. A disk containing the latest version of KbStuffer. 2. A printed users manual for KbStuffer (Extra program disks and manuals are available). 3. Free updates of KbStuffer for one year from date of registration. 4. Free technical support by phone, fax, mail and CompuServe. Page 7 Parameters for KbStuffer All command line parameters for KbStuffer are case insensitive. Either a forward slash '/' or a minus sign '-' can be used for all parameters (Ex. /? or -?) Summary of Parameters /? - Display Help /D# - Change Monitor Read/Write Delay /L - Log All Message To Disk /M# - Change Shared Memory Size /NC - Turn Colors Off /P# - Change Printer Port (LPT1 thru LPT3 or disk) /S# - Change Scan Code Set (1 thru 3) /X - Display Extra Messages /? - Display Help Syntax - KbStuff /? Default - N/A Activates KbStuffer's on-line help system. /D# - Change Monitor Read/Write Delay Syntax - KbStuff /D20 Default - 10 Milliseconds If keystroke data placements are too slow, decrease this setting. To fine tune system performance, increase this setting to free more processing time. /L - Log Messages Syntax - KbStuff /L Default - Off To keep a log of all messages (Warning, Error and Debugging), turn this option on. All messages are saved to the file KbStuff.log in the current working directory. All messages are still displayed on the screen. This is a useful option for debugging or when KbStuffer has been run in the detached mode. /M# - Change Shared Memory Size Syntax - KbStuff /M1024 Default - 4096 Bytes KbStuffer receives keystrokes data in shared memory. The size of this shared memory can be changed to a larger, or smaller size to suit various needs. It is recommend to change the shared memory in 16 byte increments. Page 8 /NC - Turn Colors Off Syntax - KbStuff /NC Default - On Messages are displayed using various colors to highlight Error and Warning messages. Setting the No Color Option will force all messages to be displayed in the standard white on black display. /P# - Change Printer Port Syntax - KbStuff /P2 Default - LPT1 Temporarily changes the printer port KbStuffer uses. Valid entries are: /P1 - LPT1 /P2 - LPT2 /P3 - LPT3 /P4 - Redirects all information to the ASCII text file KbStuff.ptr /S# - Change Scan Code Set Syntax - KbStuff /S3 Default - Scan Code Set 1 If passed keystrokes are displayed as different characters or not at all, try selecting one of the other Scan Code Sets. Note: KbStuffer only supports the English Keyboard Character Set. If requests are made for other languages, they will be incorporated into future releases of KbStuffer. Valid entries are: /S1 - Use Scan Code Set 1 (Default) /S2 - Use Scan Code Set 2 /S3 - Use Scan Code Set 3 /X - Display Extra Messages Syntax - KbStuff /X Default - Off When this option is set, extra information is displayed on the screen about the current execution of KbStuffer. These messages contain information such as which data was received from Shared Memory and the keystroke currently being stuffed into a Keyboard Buffer. These messages are quite useful when debugging passed keystroke information. Page 9 Main Screen Upon running the unregistered version of KbStuffer, the Main Screen will be displayed along with one or several registration messages. To continue, press the dollar sign '$' key. The registered version of KbStuffer does not display these registration messages. \----------------------------------------------------------------------------/ | KbStuffer - Version 1.0 August 1993 | | Copyright 1993, William L. Moussiaux All Rights Reserved | | Press [?] For Help, [Q] to Quit KbStuffer | | | | | | The theoretical foundation of how Shareware works is twofold: | | | | First, the assumption is made that most people prefer to be honest, and | | that if they are trusted, they will honor that trust. | | | | The second part of the foundation is that, as copyright holder, the | | author may voluntarily suspend some of his rights for a limited period | | of time. After the specified time period, someone who continues to use | | the software is in violation of domestic and international copyright laws. | | | | | | Press [$] To Continue | /----------------------------------------------------------------------------\ KbStuffer's Main Screen displays various messages (Error, Warning and Informative). These messages are displayed in different colors depending on the message type and are scrolled within the Main Screen. \----------------------------------------------------------------------------/ | KbStuffer - Version 1.0 August 1993 | | Copyright 1993, William L. Moussiaux All Rights Reserved | | Press [?] For Help, [Q] to Quit KbStuffer | | | | Using Option - Display Extra Information | | Using Option - Log All Messages To KbStuff.log | | Shared Memory Size 4096 Bytes | | Got [6] [3] [[XX]] From Shared Memory | | Thread[0] Doing Control Character [XX] | | Warning - Thread[0] Passed Invalid Control Code [XX] | | | | | | | | | | | | | | | /----------------------------------------------------------------------------\ Page 10 Help Menu KbStuffer's Help System may be activated by pressing '?' from the Main Screen. Options available from the Help Menu are: \----------------------------------------------------------------------------/ | KbStuffer - Version 1.0 August 1993 | | Copyright 1993, William L. Moussiaux All Rights Reserved | | Press [?] For Help, [Q] to Quit KbStuffer | | | | Select Help Option | | | | [B]ug/Comments Form | | [C]ontrol Key List | | [M]emory Information | | [P]arameters | | [R]egister | | [S]yntax Help | | [T]urn Options On/Off | | [Q]uit Help Menu | | | | | | | /----------------------------------------------------------------------------\ [B]ug/Comments Form To simplify correspondence regarding comments or bugs with KbStuffer, a pre-generated form is supplied. This form may be viewed and/or printed at this Help Option. [C]ontrol Key List Displays a list of valid Control Codes for use with KbStuffer. The list may be viewed and/or printed at this Help Option. [M]emory Information This option displays and optionally prints the system semaphores and shared memory used by KbStuffer. Page 11 [P]arameters Displays and optionally prints a list of valid command line parameters for KbStuffer. [R]egister Displays information on registering KbStuffer. This form may be viewed and/or printed. [S]yntax Help Lists and/or prints examples of passing keystroke data to KbStuffer. Page 12 [T]urn Options On/Off This option displays a menu listing several options that may be turn on or off at anytime along with there current state. \----------------------------------------------------------------------------/ | KbStuffer - Version 1.0 August 1993 | | Copyright 1993, William L. Moussiaux All Rights Reserved | | Press [?] For Help, [Q] to Quit KbStuffer | | | | Run Time Options | | | | [C]olors On | | [E]xtra Information Displayed Off | | [L]og All Messages To Disk Off | | [P]rinter Port LPT1 | | [Q]uit On/Off Menu | | | | | | | | | | | | | /----------------------------------------------------------------------------\ [C]olors Default - On Turn color messages on or off. [E]xtra Information Displayed Default - Off Turn on or off the displaying of extra information about the current operation of KbStuffer. [L]og All Messages To Disk Default - Off Toggle on or off the logging of messages produced by KbStuffer to disk. Note: Message are save in the current directory in the file KbStuffer.log. Page 13 [P]rinter Port Default - LPT1 Temporarily changes the printer port KbStuffer uses. Valid entries are: /P1 - LPT1 /P2 - LPT2 /P3 - LPT3 /P4 - Redirects all information to the ASCII text file KbStuff.ptr. [Q]uit On/Off Menu Return to KbStuffer's Help Menu [Q]uit Help Menu Exits the Help Menu and returns to KbStuffer's Main Screen. Page 14 Sending Data to KbStuffer Using Stuffer.exe To stuff alpha-numerical keys into a keyboard buffer, enter the desired keys on the command line. Example: Stuffer dir <--- Output dir Stuffer abcd1234 <--- Output abcd1234 None alpha-numerical keys such as ENTER, ALT, CTRL and SHIFT are considered Control Keys (See Appendix A). To stuff a Control Key into the keyboard buffer, enter the Control Key Code surrounded by square brackets '[ ]'. Example: Stuffer [ET] <--- Output ENTER Key Stuffer [SB] <--- Output SPACE BAR Examples of Alpha-Numerical keys and Control Keys: Stuffer dir[ET] <--- Output dir ENTER Stuffer This[SB]Is[SB]A[SB]Test <--- Output This Is A Test Multiple key strokes must include a plus sign '+' between keys and all keys must be surrounded by square brackets '[ ]'. Example: Stuffer [AL+a] <--- Output Left ALT & a Stuffer [CL+SL+F1] <--- Output Left CTRL, Left SHIFT & F1 Keys To stuff a capital letter, either pass the capitalized letter or the letter and a SHIFT key. Example: Stuffer ABC <--- Output ABC Stuffer [SL+a][SL+b][SL+c] <--- Output ABC Stuffer !@# <--- Output !@# Stuffer [SL+1][SL+2][SL+3] <--- Output !@# Stuffing data to another OS/2 Session To stuff keystroke data to an OS/2 Full Screen Session other than the current one, pass the session Id on the command line of Stuffer.exe. The session Id can be optioned by using GetId.exe supplied with KbStuffer. Example: GetId returned 8. Stuffer /8 dir[ET] <--- Output dir ENTER (In the selected session) Page 15 Control Codes KbStuffer categorizes keystroke data into two categories. 1. Alpha-numeric and punctuation (Ex. a - z, 0 - 9, + - : ' etc.) 2. Control Codes (Ex. SHIFT, ALT, ENTER, TAB, F1 etc.) A Control Code is a two character abbreviation for a key. A Control Code must be surrounded by square brackets '[ ]'. Example: [AL] <--- Output Left ALT Key [SR] <--- Output Right SHIFT Key [TA] <--- Output TAB Key [WU] <--- Output Up Arrow Key [N7] <--- Output Number Pad 7 Key Multiple Keys To stuff multiple keystrokes (one or more of which is/are Control Code(s)), separate the keystrokes with a plus sign '+' and surround all the keystrokes with a set of square brackets '[ ]'. Example: [CL+FA] <--- Output Left CTRL and F10 Keys [AR+x] <--- Output Right ALT & x Keys [CL+AL+DE] <--- Output Left CTRL, Left ALT & DELETE Keys Page 16 Special Case Control Codes KbStuffer incorporates special Control Codes that alter keystroke data placement. Summary WT# - Wait for # Milliseconds WK# - Wait for # Milliseconds between all keystrokes. QU - Exit the KbStuffer Program. QE - Exit the KbStuffer Program and EXIT the session. AE - ALT and ESC Key Sequence. CE - CTRL and ESC Key Sequence. CM - Close Monitors WT# - Wait for # Milliseconds Syntax - [WT30] Wait for 30 Milliseconds The WT# Control Code forces KbStuffer to pause for the specified time (in milliseconds) before processing the next keystroke. An example of using this pause action would be to give the user time to read screen output. WK# - Wait Between all Keystrokes Syntax - [WT10] Wait for 10 Milliseconds WK# pauses for the specified time (in milliseconds) between every keystroke before processing the next keystroke. The WK# Control Code may be invoked multiple time to vary the delay between keystrokes. Passing [WK0] will reset KbStuffer to no delay between keystrokes. When running KbStuffer on a fast machine, the WK# option may have to be used to avoid losing keystroke data. QU - Quit KbStuffer Program Syntax [QU] Passing QU will cause KbStuffer to clean-up and exit. Any keystroke data following QU will not be processed. QE - Quit KbStuffer Program and EXIT Syntax [QE] QE is similar to QU except an EXIT is run in the OS/2 Session KbStuffer was executing in, there by ending the session. Page 17 AE - ALT and ESC Key Sequence Syntax [AE] Executes the ALT+ESC key sequence. The action takes place in the current foreground session. CE - CTRL and ESC Key Sequence Syntax [CE] Executes the CTRL+ESC key sequence. The action takes place in the current foreground session. CM - Close Monitors Syntax [CM] KbStuffer creates a new Keyboard Monitor for each new OS/2 Session it works with. Use this Control Code to close all Keyboard Monitors current being used by KbStuffer. Page 18 Scan Codes Alpha-numeral keystrokes may also be passed to KbStuffer by sending the key's Scan Code instead of the key's character (see Appendix B). This option was added for passing of sensitive data like passwords. Note: Information about Scan Codes only appears in this document. Scan Code Information is not mentioned in KbStuffer's on-line help for security reasons. To pass a key's Scan Code, surround the 3 digit Scan Code Number with square brackets '[ ]'. Example: Stuffer [031][050][048] <--- Output abc Stuffer [046][003][004] <--- Output 123 Page 19 Using Shared Memory and System Semaphores The sub-directory STUFFER contains the source code for Stuffer.exe. Stuffer.c is a detailed example of using shared memory and system semaphores to send keystroke data to KbStuffer. See Appendix E for a list of Shared Memory and System Semaphore Names. To send keystroke data to KbStuffer 1. Attach to the shared memory and system semaphores. 2. Place keystroke data into shared memory. To attach to shared memory 1. Open the shared memory InUse semaphore. 2. Open the shared memory DataWaiting semaphore. 3. Wait for the InUse semaphore to clear, signaling the shared memory has been created by KbStuffer. 4. Get the address of KbStuffer's shared memory. 5. Turn the shared memory address into a pointer. To place data into KbStuffer's shared memory 1. Get the Id of the OS/2 Session the data will be stuffed into. 2. Wait for the shared memory to be cleared using the InUse semaphore 3. Place keystroke data into shared memory. 4. Clear the InUse semaphore. 5. Clear the DataWaiting semaphore, signaling that there is data waiting in shared memory. Page 20 Appendix A - Control Key Codes All Control Key Codes For KbStuffer are case insensitive. BS - BACKSPACE Key N/ - Number Pad / ET - ENTER Key N* - Number Pad * ES - ESC Key N- - Number Pad - SB - SPACE BAR N+ - Number Pad + TB - TAB Key NE - Number Pad ENTER N. - Number Pad . AL - Left ALT Key N0 - Number Pad 0 AR - Right ALT Key N1 - Number Pad 1 CL - Left CTRL Key N2 - Number Pad 2 CR - Right CTRL Key N3 - Number Pad 3 SL - Left SHIFT Key N4 - Number Pad 4 SR - Right SHIFT Key N5 - Number Pad 5 N6 - Number Pad 6 F1 - F1 Function Key N7 - Number Pad 7 F2 - F2 Function Key N8 - Number Pad 8 F3 - F3 Function Key N9 - Number Pad 9 F4 - F4 Function Key F5 - F5 Function Key WT - Wait For # milliseconds F6 - F6 Function Key WK - Every Key Wait # ms F7 - F7 Function Key F8 - F8 Function Key AC - ALT+ESC Key Sequence F9 - F9 Function Key CE - CTRL+ESC Key Sequence FA - F10 Function Key FB - F11 Function Key QU - Quit KbStuffer FC - F12 Function Key QE - Quit KbStuffer and EXIT CM - Close Monitors Page 21 Appendix B - Scan Code Numbers Scan Codes by Key Key Code Key Code Code Key Code Key ------------------------- -------------------------- A 031 | S 032 002 1 | 025 O B 050 | T 021 003 2 | 026 P C 048 | U 023 004 3 | 031 A D 033 | V 049 005 4 | 032 S E 019 | W 018 006 5 | 033 D F 034 | X 047 007 6 | 034 F G 035 | W 022 008 7 | 035 G H 036 | Z 046 009 8 | 036 H I 024 | 1 002 010 9 | 037 J J 037 | 2 003 011 0 | 038 K K 038 | 3 004 017 Q | 039 L L 039 | 4 005 018 W | 046 Z M 052 | 5 006 019 E | 047 X N 051 | 6 007 020 R | 048 C O 025 | 7 008 021 T | 049 V P 026 | 8 009 022 Y | 050 B Q 017 | 9 010 023 U | 051 N R 020 | 0 011 024 I | 052 M Page 22 Appendix C - Known Problems With KbStuffer Stuffing dir/p[ET] to the keyboard buffer will lock up the computer. This will also happen if the environment variable DIRCMD is set with the /p option. To stuff a quote " using Stuffer.exe, use the following syntax Stuffer \" Stuffer \"Hello\" The Print Screen and Pause/Break keys will not work with this version of KbStuffer to avoid system crashes and unexpected occurrences. Passing Control S to a command line prompt is not recommended. This could cause the session to lock out any further keystroke input. Page 23 Appendix D - Shared Memory and Semaphores Note: Shared Memory and System Semaphores are case sensitive. Shared Memory InUse Semaphore "/Sem/WLM/KbStuff/InUseSem." Shared Memory DataWaiting Semaphore "/Sem/WLM/KbStuff/DataWaitSem." Shared Memory Name "/ShareMem/WLM/KbStuff/Buffer." Page 31 Appendix E - Future Releases Future releases of KbStuffer will include: * The ability to stuff to PM applications. * 32-bit code. * Multiple Keyboard language support. * Your comments and suggestions. Page 32