home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Simtel MSDOS 1992 September
/
Simtel20_Sept92.cdr
/
msdos
/
trojanpr
/
filetest.arc
/
FILETEST.DOC
< prev
next >
Wrap
Text File
|
1988-03-13
|
7KB
|
149 lines
FILETEST
L« P« Levine
MarcΦ 13¼ 1988
FILETES╘ i≤ ß prograφ t∩ hel≡ detec⌠ wheε file≤ havσ beeε ì
corrupted« FILETES╘ use≤ ß lis⌠ oµ al∞ thσ file≤ oε thσ defaul⌠ ì
drivσ whicΦ thσ use≥ wishe≤ t∩ tracσ (FILETEST.FIL⌐ and¼ wheε ruε ì
fo≥ thσ firs⌠ time¼ produce≤ aε origina∞ lis⌠ (FILETEST.OLD⌐ oµ ì
thosσ file≤ alonτ witΦ creatioε date¼ filσ size¼ anΣ ß CR├ ì
(cycliπ redundanc∙ check⌐ fo≥ eacΦ sucΦ file« Wheε FILETES╘ i≤ ì
ruε agaiε ß ne≈ lis⌠ (FILETEST.NEW⌐ i≤ prepareΣ anΣ compareΣ witΦ ì
thσ olΣ list« Fo≥ an∙ file¼ i⌠ i≤ possiblσ that:
1⌐ Thσ filσ i≤ completel∙ unchangeΣ froφ thσ previou≤ time« ì
Thσ filσ namσ (anΣ director∙ entry⌐ arσ thσ samσ a⌠ thσ tw∩ ì
times¼ anΣ i⌠ ha≤ no⌠ beeε modified« Onl∙ ß coun⌠ oµ sucΦ file≤ ì
wil∞ bσ shown¼ iµ ß repor⌠ i≤ printed.
2⌐ Thσ filσ ha≤ beeε modifieΣ iε thσ norma∞ manner¼ s∩ tha⌠ thσ ì
director∙ entr∙ ha≤ ß ne≈ timσ oµ creation« File≤ oµ thi≤ sor⌠ ì
arσ counteΣ anΣ ß postinτ t∩ thσ screeε i≤ made« Yo⌡ shoulΣ bσ ì
awarσ oµ sucΦ filσ alterations.
3⌐ Thσ filσ ha≤ beeε deleteΣ sincσ thσ las⌠ timσ FILETES╘ wa≤ ì
run« File≤ oµ thi≤ sor⌠ arσ counteΣ anΣ ß postinτ t∩ thσ screeε ì
i≤ made« Thi≤ shoulΣ onl∙ occu≥ wheε ß changσ ha≤ beeε madσ iε ì
thσ FILETEST.FIL«
4⌐ ┴ ne≈ filσ ha≤ appeareΣ tha⌠ wa≤ no⌠ oε thσ disδ a⌠ thσ timσ ì
oµ thσ previou≤ ruε oµ FILETEST« File≤ oµ thi≤ sor⌠ arσ counteΣ ì
anΣ ß postinτ t∩ thσ screeε i≤ made« Thi≤ shoulΣ onl∙ occu≥ wheε ì
ß changσ ha≤ beeε madσ iε thσ FILETEST.FI╠«
5⌐ Thσ director∙ entr∙ fo≥ ß filσ i≤ thσ samσ fo≥ botΦ oµ thσ ì
time≤ thσ prograφ wa≤ run¼ bu⌠ thσ filσ wa≤ modifieΣ iε somσ way« ì
Thi≤ shoulΣ no⌠ occu≥ iε norma∞ practice¼ s∩ thσ prograφ write≤ ß ì
specia∞ alarφ messagσ t∩ thσ terminal« Thi≤ caε occu≥ wheε yo⌡ ì
usσ NORTO╬ UTILITIES¼ o≥ othe≥ sucΦ program≤ t∩ modif∙ thσ disδ ì
directly¼ bypassinτ thσ norma∞ DO╙ handlinτ oµ thσ files« I⌠ ì
als∩ caε happeε wheε trojaε horsσ program≤ 'ruε wildº (thi≤ i≤ ì
wha⌠ prompteΣ mσ t∩ writσ thi≤ prograφ iε thσ firs⌠ place).
Runninτ thσ prograφ beforσ eacΦ systeφ shutdowε wil∞ hel≡ t∩ ì
assurσ yo⌡ tha⌠ yo⌡ arσ no⌠ continuinτ t∩ ruε witΦ systeφ file≤ ì
tha⌠ havσ beeε corrupted« Also¼ iε prograφ development¼ runninτ ì
thσ prograφ beforσ anΣ afte≥ ß tes⌠ ruε oµ somσ unknowε prograφ ì
caε hel≡ assurσ yo⌡ tha⌠ thσ tes⌠ prograφ ha≤ no⌠ messeΣ u≡ ì
importan⌠ file≤ oε thσ disk.
(Thi≤ prograφ grou≡ i≤ ß mino≥ rewritσ oµ ß pai≥ oµ program≤ ì
calleΣ FILECR├ anΣ COMPAR┼ writteε b∙ TeΣ H« Emigh« Dr« Emigh'≤ ì
program≤ tes⌠ thσ entirσ harΣ disk¼ rathe≥ thaε onl∙ selecteΣ ì
files¼ anΣ thu≤ takσ man∙ minute≤ t∩ run« Thi≤ documen⌠ i≤ ß ì
rewritσ oµ hi≤ documentation« Thσ majo≥ differencσ betweeε hi≤ ìèanΣ m∙ prograφ group≤ i≤ iε thσ increaseΣ speeΣ oµ execution¼ anΣ ì
iε thσ decreasσ iε thσ sizσ oµ thσ reports¼ permittinτ m∙ prograφ ì
t∩ bσ ruε witΦ eacΦ shutdown« Dr« Emigh'≤ program≤ anΣ ì
documentatioε arσ includeΣ witΦ thi≤ package¼ permittinτ thσ use≥ ì
t∩ seσ ho≈ littlσ worδ ╔ havσ donσ iε thσ modificatioε anΣ ì
permittinτ thσ use≥ t∩ ruε hi≤ grou≡ wheε thσ longe≥ stud∙ timσ ì
i≤ calleΣ for.)
RUNNING FILETEST
There are six files associated with FILETEST:
FILETEST.BAT -- The main batcΦ program.
FILEREAD.COM -- The prograφ tha⌠ check≤ thσ CRCs.
FILECOMP.COM -- A comparison program.
FILETEST.FI╠ -¡ Thσ lis⌠ oµ file≤ t∩ bσ tested.
FILETEST.OL─ -¡ Thσ olΣ lis⌠ oµ CRC≤.
FILETEST.NE╫ -¡ Thσ ne≈ lis⌠ oµ CRCs.
FILETEST.BA╘ firs⌠ call≤ FILEREAD« FILEREA─ i≤ ruε withou⌠ ì
commanΣ linσ parameter≤ (althougΦ outpu⌠ redirectioε i≤ ì
permitted)« I⌠ wil∞ reaΣ FILETEST.FI╠ anΣ wil∞ creatσ ì
FILETEST.NE╫ (o≥ FILETEST.OL─ iµ tha⌠ filσ doe≤ no⌠ exis⌠ iε thσ ì
defaul⌠ directory)¼ whicΦ i≤ ß lis⌠ oµ al∞ thσ file≤ thσ use≥ ì
wisheΣ t∩ tes⌠ iε an∙ directory« (FILEREA─ display≤ thσ ì
director∙ anΣ filσ name≤ a≤ i⌠ goe≤ througΦ them¼ wheε compileΣ ì
anΣ ruε iε diagnostiπ mode.⌐ FILETEST.BA╘ wil∞ theε cal∞ ì
FILECOMP¼ whicΦ wil∞ comparσ thσ file≤ iε FILETEST.NE╫ witΦ thosσ ì
iε FILETEST.OLD¼ notinτ an∙ differences« Wheε FILECOMP i≤ ì
finished¼ ß repor⌠ i≤ madσ onl∙ iµ difference≤ appea≥ anΣ thσ ì
use≥ i≤ prompteΣ t∩ replacσ FILETEST.OL─ witΦ FILETEST.NEW.
An∙ file≤ created¼ deleted¼ o≥ normall∙ altereΣ sincσ thσ ì
previou≤ timσ FILETES╘ wa≤ ruε wil∞ bσ listeΣ t∩ thσ screen« An∙ ì
file≤ tha⌠ havσ beeε modifieΣ iε ß "NO╬ DOSó manne≥ wil∞ bσ ì
listeΣ t∩ thσ screeε¼ highlighted.
PROGRAMMING NOTES
FILETES╘ i≤ writteε usinτ Turb∩ Pascal¼ Versioε 3.░ fo≥ MSDOS« ì
I⌠ ha≤ beeε testeΣ oε ß nonamσ A╘ anΣ ß ZenitΦ P├ usinτ DO╙ 3.3« ì
Thi≤ prograφ i≤ no⌠ mean⌠ t∩ represen⌠ thσ epitomσ oµ programminτ ì
skill¼ bu⌠ i⌠ works« An∙ improvement≤ anΣ suggestion≤ arσ ì
welcome«
FILETES╘ wil∞ worδ witΦ an∙ numbe≥ oµ file≤ o≥ directories« A≤ ì
written¼ FILECOM╨ ha≤ ß maximuφ oµ 20░ directorie≤ anΣ 180░ file≤ ì
witΦ an∙ numbe≥ oµ file≤ withiε an∙ particula≥ directory« Thσ ì
maximuφ lengtΦ oµ thσ director∙ namσ strinτ i≤ 6┤ characters« ╔ ì
havσ useΣ thσ prograφ oε subdirectorie≤ u≡ t∩ 1░ level≤ dee≡ ì
withou⌠ an∙ problems« Thesσ value≤ fo≥ thσ numbe≥ oµ directorie≤ ì
anΣ thσ numbe≥ oµ file≤ use≤ u≡ jus⌠ abou⌠ a≤ mucΦ memor∙ a≤ ì
TURB╧ Pasca∞ allows¼ s∩ aε increasσ iε thesσ number≤ woulΣ ì
necessitatσ ß redesigε oµ thσ program« FILETES╘ read≤ filename≤ ìèfroφ FILETEST.FI╠ anΣ searche≤ onl∙ a≤ fa≥ a≤ needeΣ t∩ completσ ì
comparison≤ oµ tha⌠ list«
FILETEST.FI╠ i≤ aε ASCI╔ lis⌠ oµ eacΦ oµ thσ file≤ thσ use≥ ì
wishe≤ traced« Ful∞ pathname≤ anΣ uppe≥ casσ arσ requireΣ ì
(i.e.C:\WS\WS.EXE)« Sincσ FILEREA─ wil∞ tracσ thσ director∙ ì
treσ unti∞ FILETEST.FI╠ i≤ satisfied¼ thσ inclusioε oµ ß ì
nonexisten⌠ filσ wil∞ seriousl∙ affec⌠ executioε speed« SucΦ ì
file≤ arσ listeΣ wheε FILEREA─ terminates« SpeeΣ wil∞ als∩ bσ ì
enhanceΣ iµ thσ file≤ t∩ bσ testeΣ arσ iε directorie≤ tha⌠ arσ ì
earl∙ iε thσ tree« Iµ thσ filσ 'C:\?º i≤ includeΣ a≤ thσ firs⌠ ì
filσ iε FILETEST.FIL¼ ß diagnostiπ listinτ oµ thσ file≤ testeΣ ì
wil∞ bσ displayeΣ a≤ thσ prograφ i≤ run« Iµ neithe≥ oµ thσ ì
condition≤ discusseΣ abovσ i≤ presen⌠ (nonexistan⌠ file≤ o≥ thσ ì
filσ C:\?⌐ FILEREA─ wil∞ ruε silently.
Specia∞ thank≤ g∩ t∩ DaviΣ Dantowit· oµ Digita∞ Equipmen⌠ ì
Corporatioε (Dantowitz%eagle1.dec@decwrl⌐ fo≥ providinτ thσ CR├ ì
routine≤ (generate_table_25╢ anΣ crc_string_256⌐ anΣ thσ routine≤ ì
fo≥ gettinτ ß director∙ (get_DTA¼ set_DTA¼ find_first¼ anΣ ì
find_next)« Oµ course¼ hσ take≤ n∩ responsibilit∙ fo≥ thσ wa∙ ╔ ì
useΣ hi≤ code« ┴ discussioε oµ thσ CR├ i≤ showε iε thσ listinτ ì
oµ FILEREAD.PA╙ anΣ FILECRC.PAS.
Simila≥ thank≤ goe≤ t∩ TeΣ ╚ Emigh¼ (Departmen⌠ oµ Genetics¼ ì
NortΦ Carolinß Statσ University¼ Bo° 7614¼ Raleigh¼ N├ 2769╡-ì
7614¼ emigh@ncsugn.uucp¼ NEMIGH@TUCC.BITNET⌐ whosσ FILECR├ ì
packagσ form≤ thσ bulδ oµ thi≤ work« Oµ course¼ hσ take≤ n∩ ì
responsibilit∙ eithe≥ fo≥ thσ wa∙ ╔ useΣ hi≤ code.
Leε Levine
Departmen⌠ oµ Electrica∞ Engineerinτ anΣ Compute≥ Science
Universit∙ oµ Wisconsin-Milwaukee
P╧ Bo° 785
Milwaukee¼ W╔ 53201
len@evax.milw.wisc.edu
(414⌐ 229-517░ worδ
(414⌐ 962-471╣ home