Solved

Disable Ctrl-Break in DOS application

Posted on 1998-06-23
15
672 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
  • 4
  • 3
  • 2
  • +5
15 Comments
 
LVL 1

Expert Comment

by:the_q58
Comment Utility
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
Comment Utility
put BREAK OFF line in your config.sys
0
 
LVL 2

Expert Comment

by:ViperOne
Comment Utility
BREAK=OFF ,I thought?
Simon
0
 

Author Comment

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


0
 

Expert Comment

by:Morten from Eliten
Comment Utility
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
Comment Utility
Set iret on int 23h !!!
0
 

Author Comment

by:nedhal
Comment Utility
Subzero, I could not understand You, Could You PLease Explain.


0
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 

Expert Comment

by:Subzero
Comment Utility
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
Comment Utility
Adjusted points to 50
0
 
LVL 7

Expert Comment

by:rin1010
Comment Utility

  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
Comment Utility
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
Comment Utility

  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
Comment Utility
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
Comment Utility

 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
Comment Utility
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

Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

Join & Write a Comment

In this article we have discussed the manual scenarios to recover data from Windows 10 through some backup and recovery tools which are offered by it.
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.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

743 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now