;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
;
;	Check for and Remove the Xeno Virus
;
;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

	xref	_DOSBase

	xdef	_CheckRAMForXeno


_CheckRAMForXeno

	move.l	_DOSBase,a0		; Get addr of Open() Vector
	sub.w	#$1c,a0
	move.l	(a0),a0

	move.l	a0,d0			;: If Bit 0 of the Address is set,
	btst	#0,d0			;: then it's not really an address
	bne.s	.NoVirus		
	
	cmp.l	#$B47C03EE,(a0)
	bne.s	.NoVirus
	cmp.l	#$67000224,4(a0)
	bne.s	.NoVirus

	;:: If we're here, we're fairly sure A0 is pointing to the
	;:: base of the Xeno virus (well, not it's base, but the address
	;:: of the first vector it stole, the Open() one.
	;:: So we'll nuke it.  8-)

	move.w	#$6000,$4(a0)
	move.w	#$603E,$240(a0)
	move.w	#$601E,$29C(a0)
	
	moveq	#1,d0			;:: Return TRUE
	rts

.NoVirus				;:: Nothing here, return FALSE
	moveq	#0,d0
	rts
