home *** CD-ROM | disk | FTP | other *** search
- ; SSSSSS
- ; SSSSSS fff t
- ; SSS ooo f ttt
- ; SSS o o ff t
- ; SSSSSS ooo f tt
- ; SSSSSS
- ; SSSSSS t fff fff
- ; SSS ttt u u f f
- ; SSS t u u ff ff
- ; SSSSSS tt uuu f f
- ; SSSSSS
-
- ; © SoftStuff 1994
- ; Written by Peter Jones
-
- ; Written using Zap
-
- ; version 1.02 (23-Oct-1994)-corrected help on Shred so that it will includue; syntax, and amended punctuation.
-
- ; This is the module source using the utterly brilliant extASM, byEvind Hagen
-
- #type &FFA ; make it a module
- #base 0 ; code offset
- #name FileShred ; module name
- #smile ON ; make life better :-)
- #set newline = 13
- .module_header
-
- dcd &00000000 ; no start-up code
- dcd &00000000 ; no initialisation code
- dcd &00000000 ; no finialisation code
- dcd &00000000 ; no service call code
- dcd module_title ; the module's title
- dcd module_help ; help for the module
- dcd command_table ; the command table
- dcd &00000000 ; no swis
- dcd &00000000 ; no swis
- dcd &00000000 ; no swis
- dcd &00000000 ; no swis
-
- .shred_code
-
- ; © SoftStuff 1994
- ; Written by Peter Jones
- ; do not copy this out and pretend its your code. I WILL NOT BE PLEASED.
-
- #set filename = 6 ; the names to be used
- #set filehandle = 7
- #set position = 8
- #set filesize = 9
-
- stmfd r13!,{r14} ; remember the return address
-
- mov filename,r0 ; remember the filename
-
- mov r0,#&C2 ; &C2=open file for output
- mov r1,filename ; get reddy to rumble
- swi OS_Find ; perform OS_Find
- mov filehandle,r0 ; remember the filehandle
-
- mov r0,#&05 ; 5=read file info
- swi XOS_File ; perform OS_File
- bvs muckup ; in case anything goes wrong
- mov filesize,r4 ; remember filesize
-
- mov position,#0 ; intialise position counter
-
- mov r1,filehandle ; get ready to overwrite file
- mov r0,#"0" ; with 0's
-
- .putit
-
- swi OS_BPut ; put a 0 onto the file
-
- add position,position,#1 ; increament the positon
- cmp position,filesize ; are we at end of file?
- bne putit ; if not write another byte
-
- mov r0,#&00 ; &80=close file
- swi XOS_Find ; perform OS_File
- bvs muckup ; just in case
-
- mov r0,#&06 ; &06=delete file
- mov r1,filename ; the condemned
- swi OS_File ; kill it!!!!!!!!!!!!!!!
-
- ldmfd r13!,{pc} ; go back to OS
-
- .muckup ; in case of something nasty
-
- mov r1,filehandle
- swi OS_Find ; close the lucky file
-
- mov pc,r14 ; go back to OS
-
-
- .shred_help ; help on the command
-
- dcb "*Shred will shred a file by overwrittng it and then deleting"
- dcb "it. The file will be unrecoverable, so no prying eyes may see"
- dcb " it."
- dcb newline
- dcb "ONLY USE WITH FILES YOU HAVE FINISHED WITH OR LATIN COURSEWORK."
- dcb newline
- dcb "Sorry, this module can only cope with files, no directories. If"
- dcb " you want to shred a directory, please use the desktop frontend."
- dcb newline
-
- .shred_syntax ; syntax for the command
-
- dcb "Syntax: *Shred <filename>"
- dcb 0
- align
-
- .module_title
-
- dcb "FileShred" ; the module's name
- dcb 0
- align
-
- .module_help ; help on the module
-
- dcb "FileShred ",9,"1.02 (23 Oct 1994) © SoftStuff & Peter Jones",0
- align
-
- .command_table ; the command table
-
- dcb "Shred",0 ; the command
- align
-
- dcd shred_code ; the code for the command
- dcd &00010001 ; the flags for 'Shred'
- dcd shred_syntax ; the syntax for 'Shred'
- dcd shred_help ; the help for 'Shred'
-
- dcb 0 ; finish the table off
-
-
-
-
-
-