home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS 1992 September / Simtel20_Sept92.cdr / msdos / sysutl / passwrd5.arc / LOCK13.ASM next >
Assembly Source File  |  1988-09-20  |  4KB  |  123 lines

  1. PAGE   60,132
  2. TITLE  LOCK V1.3 - RECALLS PASSWORD DEVICE DRIVER CODE
  3.  
  4. ;-----------------------------------------------------------------------
  5. ;  LOCK V1.3
  6. ;
  7. ;| LOCK is designed to work in conjunction with PASSWRD5.SYS.
  8. ;  Its purpose is to call a portion of code internal to the
  9. ;  device driver PASSWRD5.SYS. This will enable a user to "lock"
  10. ;  the PC until a user replies with the correct password.
  11. ;  ** CAUTION  Beware of upper case vs lower case when responding **
  12. ;
  13. ;  This code will check the interupt vector 66H for a non zero segment
  14. ;  reference before calling the password routine. PASSWRD5.SYS will
  15. ;  initialize this interrupt at boot time. since the PASSWRD5.SYS
  16. ;  device driver (like any device driver) remains resident, the user
  17. ;  is assured that he only need change PASSWRD5.SYS in order to
  18. ;  change the system password.
  19. ;
  20. ;                    JOHN R. PETROCELLI
  21. ;                    02/25/85
  22. ;v1.3, 19 Sep 88
  23. ; - Simplifying ANSI/non-ANSI switch.  Change ANSI to 0 for non-ANSI display.
  24. ; - Insuring compatible with PASSWRD5.ASM/.SYS
  25. ; - Code works now (no public complaints), so removing all the
  26. ;   v1.1 stuff I commented out.
  27. ; - Considered putting in a '?' help parameter processor (to give a REALLY
  28. ;   ignorant, unbriefed, or curious user an explanation about PASSWRD.SYS).
  29. ;   However, that might point a semi-ignorant threat at our PASSWRD.SYS driver
  30. ;   where he might snoop around and find out the password.
  31. ;   This whole mess is assuming a lot of ignorance on the part of users and
  32. ;   snoops .. but then I'm constantly amazed at the standard level of
  33. ;   expertise (or lack thereof) out there ..
  34. ; David Kirschbaum
  35. ;
  36. ;v1.2 Toad Hall Tweak, 7 Aug 88
  37. ; - minor tightening
  38. ; - minor editing to keep MASM 5.0 happy.
  39. ; - now using Service 4CH, Int 21H to terminate (returning errorlevels)
  40. ; - Remember -- remove the Escape sequences in the error message
  41. ;   if you don't have an ANSI driver installed.
  42. ;
  43. ;Note:  This system is fairly weak security-wise.
  44. ;If a "threat" ever gets a chance to look at the actual PASSWRD5.SYS file,
  45. ;he'll easily spot the "hardcoded" text password lying therein!
  46. ;Too much trouble to work out an inline encrypt/decrypt function tho.
  47. ;Also .. this assumes Int 66H is not being used by anything else in
  48. ;the system .. hope that's a safe assumption!
  49.  
  50. ;David Kirschbaum
  51. ;Toad Hall
  52. ;kirsch@braggvax.ARPA
  53. ;
  54. ;----------------------------------------------------------------------
  55. ;
  56.  
  57. ANSI    EQU    1            ;v1.3 make 0 for non-ANSI
  58.  
  59.  
  60. INT_VECTORS  SEGMENT AT 0H        ; POINT TO INTERUPT VECTOR TABLE
  61.     ORG    66H*4            ; INT 66H
  62. ASK_OFF DW    ?            ; OFFSET OF PASSWORD RECALL
  63. ASK_SEG DW    ?            ; SEGMENT OF PASSWORD RECALL
  64. INT_VECTORS ENDS
  65.  
  66. CODE_SEG  SEGMENT PARA 'CODE'
  67.  
  68.     ASSUME  CS:CODE_SEG, DS:CODE_SEG, ES:INT_VECTORS, SS:NOTHING
  69.  
  70.     ORG    100H            ; NEEDED FOR A .COM PROGRAM
  71.  
  72. BEGIN:
  73.     xor    ax,ax    ;TH        ;  SET ES TO REFERENCE
  74.     MOV    ES,AX            ;  INT_VECTORS
  75.  
  76.     ASSUME  DS:CODE_SEG, ES:INT_VECTORS    ;TH a reminder
  77.  
  78.     mov    bx,offset Ask_Off    ;TH Set ES:BX to point to
  79.                     ;  location in the int vector
  80.                     ;  table containing seg & offset
  81.                     ;  of password recall routine
  82.  
  83.     MOV    AX,ES:[BX+2]        ; load AX with segment of call
  84.     or    ax,ax    ;TH        ; and if the segment is 0 ..
  85.     JZ    Error_Exit        ; .. then exit - not initialized
  86.  
  87.     CALL    DWORD PTR ES:[BX]    ; call Pword if installed
  88.                     ; ES:BX will point to the address
  89.                     ; of the routine to be called
  90.  
  91.     mov    ax,4C00H        ;TH terminate process,ERRORLEVEL 0
  92.     int    21H
  93.  
  94. Error_Exit:                ; SEGMENT AND/OR OFFSET
  95.                     ; WERE 0000 SO WE DON'T CALL
  96.                     ; JUST PRINT ERROR MESSAGE
  97.  
  98.     MOV    DX,OFFSET no_Init    ; DS:DX POINTS TO ERROR MSG
  99.     MOV    AX,9            ; display msg
  100.     INT    21H
  101.  
  102.     mov    ax,4C01H        ;TH terminate process, ERRORLEVEL 1
  103.     int    21H
  104.  
  105.     IF    ANSI            ;v1.3
  106.  
  107. no_Init DB 1BH,'[5m'            ; MAKE "PASSWORD" BLINK
  108.     DB ' PASSWORD '
  109.     DB 1BH,'[0m'            ; ATTRIBUTES TO NORMAL
  110.     DB ' Device Driver Does Not'
  111.     DB ' Appear To Be Installed'
  112.     DB 07H,0DH,0AH,'$'        ; BEEP+CR+LF
  113.  
  114.     ELSE                ;v1.3
  115.  
  116. no_Init DB ' PASSWORD Device Driver Does Not Appear To Be Installed'
  117.     DB 07H,0DH,0AH,'$'        ; BEEP+CR+LF
  118.  
  119.     ENDIF                ;v1.3
  120.  
  121. CODE_SEG    ENDS
  122.     END    BEGIN
  123.