; Virus Removal code for Slayer
; Slayer - a desktop anti-virus for RISC OS
; Copyright (C) 1996 - 2000 Kiwi Software (UK)
;
; This program is free software; you can redistribute it and/or modify
; it under the terms of the GNU General Public License as published by
; the Free Software Foundation; either version 2 of the License, or
; any later version.
;
; This program is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
; GNU General Public License for more details.
;
; You should have received a copy of the GNU General Public License
; along with this program; if not, write to the Free Software
; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
;
; info@kiwisoft.co.uk
; -------------------------------------------------------------------------


;R0 = virusnumber
;R1 = filename

			stmfd	r13!,{r14}

;set write access to the file
			mov	r10,r0		;preserve virus id
			mov	r0,#17
			; r1 already contains pointer to filename
			swi	XOS_File
			orr	r5,r5,#%11	;set read & write
			bic	r5,r5,#%1000	;clear locked bit
			mov	r0,#4		;set attributes
			; r1 already contains pointer to filename
			swi	XOS_File

			mov	r0,r10		;restore virus id

;look at the virus number and send to appropriate code...
			teq	r0,#module
			beq	kill_module

			teq	r0,#bbceconet
			beq	kill_bbceconet

			teq	r0,#jester
			beq	kill_jester

			teq 	r0,#link
			beq	kill_link

			teq	r0,#millenium
			beq	kill_module	;it's just a variant

			teq	r0,#sysutils
			beq	kill_sysutils


.deletefile		mov	r0,#6
			swi	XOS_File
			bvs	exit_from_error
			movs	r0,#1
			ldmfd	r13!,{pc}	;unstack and return to caller

.exit_from_error	movs	r0,#2
 			ldmfd	r13!,{pc}	;unstack and return to caller

#include "VREng:VRemove.s.bbceconet"
#include "VREng:VRemove.s.jester"
#include "VREng:VRemove.s.link"
#include "VREng:VRemove.s.module"
#include "VREng:VRemove.s.sysutils"

.scrap_block		dbb	250
			align

.scrap2_block		dbb	24
			align

.vrCopyright_string	dcb	" Kiwi Software (UK), 2000",0
			align

.vrC_string_pointer	dcd	vrCopyright_string

.vrInfoblocks_version	dcd	(0.08 * 100)

.vrInfoblocks_date	dcd	0	;will be filled in when certified
			dcd	0	; with 5 byte UTC time

.vrInfoblocks_v_known	dcd	21

.vrPlugin_reserved	dcd	0
			dcd	0

.vrPlugin_crc		dcd	0

.vrPlugin_header	dcb	"SLAY"

