home *** CD-ROM | disk | FTP | other *** search
/ Turbo Toolbox / Turbo_Toolbox.iso / 1989 / 05 / praxis / secure.asm < prev    next >
Encoding:
Assembly Source File  |  1989-01-08  |  2.2 KB  |  86 lines

  1. ;READ ONLY ATTRIBUT RÜCKSETZEN VERHINDERN
  2. ;Übersetzen mit : MASM secure
  3. ;          LINK secure
  4. ;          EXE2BIN secure.exe secure.com
  5. ; ! Nur als .COM - File ausführen !
  6. ; (C) Copyright 1989 by RUZICKA KLAUS & Toolbox
  7. ; Alle Rechte vorbehalten.
  8. ;
  9. code    segment
  10. assume    cs:code
  11.     org    0fbh
  12. origvector    dd     ?
  13. ;
  14. ;init entry
  15.     org    100h
  16. start:     jmp    short    init
  17. ;
  18. int21    proc    far
  19.     pushf            ;Register & Flags retten
  20.     push    ax
  21.     push    bx
  22.     push    cx
  23.     mov    bx,cx        ;Register CX nach BX retten
  24.     cmp    ax,4301h    ;Attribut ändern?
  25.     jnz    short    int21_2    ;nein -> weiter
  26.     mov    ax,4300h    ;Attribut lesen
  27.     int    21h
  28.     and    cx,01h        ;RO-Attr gar nicht gesetzt?
  29.     jz    short    int21_2 ;nicht gesetzt ->weiter
  30.     and    bx,01h        ;RO-Attr rücksetzen?
  31.     jnz    short    int21_2 ;nein ->weiter
  32.     mov    al,0B6h        ;Timerkanal 2 f. Modus 3 programmieren
  33.     out    43h,al        ;für Warnton
  34.     mov    ax,2712h    ;Teiler für Ton 440Hz
  35.     out    42h,al        ;Low-Byte ausgeben
  36.     mov     al,ah
  37.     out    42h,al        ;High-Byte ausgeben
  38.     in    al,61h        ;Ton einschalten
  39.     or    al,3h
  40.     out    61h,al
  41.     xor    cx,cx        ;warten
  42. warte:    loop    warte
  43.     xor    cx,cx        ;warten
  44. warte1:    loop    warte1    
  45.     in    al,61h        ;Ton abschalten
  46.     and    al,0FCh
  47.     out    61h,al
  48.     pop      cx        ;benutzte Register wiederherstellen
  49.     pop    bx
  50.     pop    ax
  51.     popf
  52.     stc            ;CF=1 --> Fehlermeldung ausgeben
  53.     mov    ax,5        ;access denied
  54.     iret            ;->zurück
  55. int21_2:pop    cx        ;Register & Flags wiederherstellen
  56.     pop    bx
  57.     pop    ax
  58.     popf
  59.     jmp    cs:[origvector]
  60. int21    endp
  61. ;init-code
  62. assume ds:code
  63. init    proc    near
  64.     mov    dx,offset message    ;Nachricht ausgeben
  65.     mov    ah,9
  66.     int    21h
  67.     mov    ax,3521h        ;Get Int.vec 21h
  68.     int    21h
  69.     mov    word ptr [origvector],bx
  70.     mov    word ptr [origvector+2],es
  71.     mov    ax,2521h        ;Set Int.vec 21h
  72.     mov    dx,offset int21
  73.     int    21h
  74.     mov    ax,3100h        ;Resident machen
  75.     mov    dx,((offset init-offset start)+10fh) shr 4
  76.     int    21h
  77. init    endp
  78. message: db'Virus-Schutzimpfung    V2.00          (C)1988 by Ruzicka Klaus',13,10,10
  79.     db'Die zu schützenden Programme (.COM,.EXE) müssen mit dem ReadOnly-Attribut ',13,10
  80.     db'versehen sein! (Attrib,Chmod,Pctools)',13,10
  81.     db'Wird versucht das Read-Only Attribut einer Datei rückzusetzen, so wird das',13,10
  82.     db'verhindert und durch einen Summton angezeigt',13,10,10,'$'
  83. code    ends
  84. end    start
  85. ;End of File: Line Nr.:85    
  86.