Solved

Disable Ctrl-Break in DOS application

Posted on 1998-06-23
15
680 Views
Last Modified: 2008-02-01
I want to disable users from breaking my macros in Accpac Plus SW. I remember long time ago there was such a trick for it, Any Ideas
0
Comment
Question by:nedhal
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 2
  • +5
15 Comments
 
LVL 1

Expert Comment

by:the_q58
ID: 1019373
with a different command interprter called 4dos i know u can do it using the ON BREAK

command but without that i dont know
0
 
LVL 7

Expert Comment

by:spiridonov
ID: 1019374
put BREAK OFF line in your config.sys
0
 
LVL 2

Expert Comment

by:ViperOne
ID: 1019375
BREAK=OFF ,I thought?
Simon
0
Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

 

Author Comment

by:nedhal
ID: 1019376
I tried it but it did not work, CTRL-Break nor CTRL-C


0
 

Expert Comment

by:Morten from Eliten
ID: 1019377
Well, why not try putting the command "Break Off" in you AUTOEXEC.BAT ?

(Note that this will only work, if you're running a clean DOS, and not a Dos box, inside Windoze 95 or Windoze NT.
0
 

Expert Comment

by:Subzero
ID: 1019378
Set iret on int 23h !!!
0
 

Author Comment

by:nedhal
ID: 1019379
Subzero, I could not understand You, Could You PLease Explain.


0
 

Expert Comment

by:Subzero
ID: 1019380
iret - asm command
use int 25h for set new resident prog on int 23h which consist only iret and pusha, popa !!!
If you don't know asm - that this method not for you...that is only coders method !!!
0
 

Author Comment

by:nedhal
ID: 1019381
Adjusted points to 50
0
 
LVL 7

Expert Comment

by:rin1010
ID: 1019382

  Nedhal,

  You could use a tsr designed to do what you want, but DOS doesn't give you a way to disable CTRL+C or CTRL+BREAK checking. Is it possible to write instructions into your macro to ignore these keystrokes?

  For what it's worth, the BREAK command only controls how frequently (not whether) DOS checks for CTRL+C or CTRL+BREAK. The default setting is OFF, in which case DOS only checks during I/O to a character device- like the screen, keyboard, com port or printer. When BREAK is on, DOS also checks when reading or writing to a disk.

  The syntax for turning BREAK on in CONFIG.SYS is :

  BREAK=ON

  You can also turn BREAK on and off from a batch file, or at a command prompt by typing :

  BREAK ON  or  BREAK OFF

  And btw, CTRL+C and CTRL+BREAK aren't the same thing; CTRL+C is processed through the keyboard buffer like any other key combo, but CTRL+BREAK uses a special interrupt mechanism, and is usually more reliable. (That may relate to what subzero was trying to say in his cute but cryptic lingo.)

  I know this doesn't solve your problem, but it explains why the BREAK suggestions didn't work. I don't know what Accpac Plus SW is, so perhaps you can post back with more info... e.g., will it run in a Windows DOS session? or only in MS-DOS mode? and are these macros specific to your program? etc...

0
 

Author Comment

by:nedhal
ID: 1019383
Ren 1010,
Accpac Plus Is an Accounting Package from CA Computer Associates. It runs under Win 95, NT and Offcourse MS-Dos.

In the Macros that is built in Accpac, there is no way to disable any keys.
How to build TSR to solve my problem
Regards
0
 
LVL 7

Expert Comment

by:rin1010
ID: 1019384

  Nedhal,

  You say what Accpac will run under, but not how you are running it... i.e., in DOS mode or in a DOS box, 95 or NT, etc... Also, is this program networked?

  You probably don't want to "build" a tsr, or anything else, unless you are well versed in some language and have a compiler, but here are some addresses of apps that might do what you want:

  For Windows, this Keyboard Remap tool, which is a control panel applet and one of the Windows 95 Kernel Toys, might do it:

http://www.microsoft.com/windows/downloads/bin/W95keyremap.exe

  Another Windows app is at:

http://www.phord.com/keyblock.html

  If you want to load a tsr or device driver for DOS mode sessions, here are some that might work for you:

http://www.uni-paderborn.de/~tomtom/simtel/msdos_keyboard_.html

  or

http://ftp.urz.uni-heidelberg.de/inline/index/ftp/pub/msdos/simtel/keyboard/kystp110.zip/

  (Description from page:)
Once either the TSR or the device driver are installed, by default pressing CTRL-C, CTRL-BREAK or CTRL-ALT-DEL will have no effect - the keystrokes are essentially discarded.  This makes DOS, many programs and batch files virtually unstoppable from the keyboard.  KEYSTOP also disables the CTRL-2 and ALT-3 (Keypad) methods of flagging CTRL-C. Any or all of these keystrokes can be re-enabled at any time using KSCONFIG.EXE.

  or

http://ftp.unicamp.br/pub/simtelnet/msdos/keyboard/

Index page:
http://ftp.unicamp.br/pub/simtelnet/msdos/keyboard/00_index.txt

(Scroll down the index for this one:)
kystp110.zip    : Disables CTRL-C, CTRL-BREAK or CTRL-ALT-DEL

  or

http://www.bsoftware.com/cgi-bin/fetch.cgi?ProductID=11869,Version=2

  Description:
TSR eliminates CTRL-ALT-DEL/CTRL-C/CTRL-BREAK

  And, if you really want to "build" something, this code shows how to disable CTRL-BREAK and CTRL-C using C++ :


  #include <conio.h>
  #include <dos.h>
  #include <stdlib.h>

  char far *modifiers = MK_FP(0,0x417); /* address of modifier
  flags     */
  void interrupt (*oldint9) (void);     /* storage for old INT 9
  handler */

  void interrupt myint9(void)
  {
  /* ((*modifiers)&4)==4 indicates the CTRL key is being pressed

         inportb(0x60)==46 indicates the C key is being pressed
         inportb(0x60)==70 indicates the SCROLL LOCK/BREAK key "

         The emit code is required to clean the keypress up from

         the BIOS.
  */

      if( (((*modifiers)&4)==4) &&
          ((inportb(0x60)==46) || (inportb(0x60)==70)) )
          __emit__(0xe4,0x61,   /* asm    IN   AL,61 */
                   0x8a,0xe0,   /* asm    MOV  AH,AL */
                   0x0c,0x80,   /* asm    OR   AL,80 */
                   0xe6,0x61,   /* asm    OUT  61,AL */
                   0x86,0xe0,   /* asm    XCHG      AL,AH */
                   0xe6,0x61,   /* asm    OUT  61,AL */
                   0xb0,0x20,   /* asm    MOV  AL,20 */
                   0xe6,0x20);  /* asm    OUT  20,AL */
      else
  /* If the key is not CTRL-C or CTRL-BREAK, call the old INT 9
     handler */
     oldint9();
  }
  void exitfunc(void)
  {
  /* Restore the old INT 9 handler */
      setvect(9,oldint9);
  }

  main()
  {
     int i;

     oldint9=getvect(9);  /* store old interrupt vector */
     setvect(9,myint9);   /* set up new interrupt handler */
     atexit(exitfunc);    /* set up exit handler to restore INT 9*/

      /* ... */    /* code that will not CTRL-BREAK or CTRL-C */

      return 0;
  }
 
 

0
 

Accepted Solution

by:
patedm earned 50 total points
ID: 1019385
People will always find a new way to bugger anything so what's to stop them from hitting reset or attempting any other malicious or ill-conceived course of action?

Tell users simply NOT to press CTRL-BREAK or else you will charge them for a service call to repair what they mess up.  Simple..and makes you money!
0
 
LVL 7

Expert Comment

by:rin1010
ID: 1019386

 That ranks right up there with the one where the patient says to the doctor, "It hurts when I raise my arm," and the doctor replies, "Well, don't raise you arm."

 

0
 

Expert Comment

by:patedm
ID: 1019387
I don't think that's a fair comparison.  What if his question was, "My users keep hitting the power button..." or "My users keep driving their cars off a cliff...".  At what point do you call it stupidity?
0

Featured Post

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I use more than 1 computer in my office for various reasons. Multiple keyboards and mice take up more than just extra space, they make working a little more complicated. Using one mouse and keyboard for all of my computers makes life easier. This co…
This paper addresses the security of Sennheiser DECT Contact Center and Office (CC&O) headsets. It describes the DECT security chain comprised of “Pairing”, “Per Call Authentication” and “Encryption”, which are all part of the standard DECT protocol.
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question