Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!mips!pacbell.com!iggy.GW.Vitalink.COM!widener!netnews.upenn.edu!vax1.cc.lehigh.edu!cert.sei.cmu.edu!krvw From: bcarter@claven.idbsu.edu Newsgroups: comp.virus Subject: Re: HyperCard anti-virus script bad (Mac) Message-ID: <0003.9104221346.AA13954@ubu.cert.sei.cmu.edu> Date: 19 Apr 91 02:01:34 GMT Sender: Virus Discussion List Lines: 61 Approved: krvw@sei.cmu.edu Greetings, >You know, I've been doubting my own infallibility for the past few >days since Bruce posted the "sorry, but it won't work", so I tried to >send set and the params directly to HC, only it isn't happening, guys. >Now I really would like to put this whole thing to rest, so try it: >Try to send the set command directly to HC and change the script of a >stack. I have yet to be able to do it. In other words, the theory >is, of course correct, but it ain't working in practice, and I'm out >of ideas, so please, all ye doubters, try it and then send me your >scripts because all I'm getting are error messages with no results. >Don't send me your ideas, I want working, syntactically correct >scripts. If they work for me I'll withdraw my previous comments. >Until then, please prove me wrong. > >Mikey. >Mac Admin >WSOM CSG >CWRU >mike@pyrite.som.cwru.edu Ah, here is your problem, using the params with set doesn't work. In fact, if you check "the paramCount" for set you'll find out that it is 0. This has never worked in a way that I consider correct in any version of HyperCard. What you're proving is that using set with the params doesn't work, not that the set handler in the Home stack is catching things. You have to send an explicit message (which is what a virus would be doing anyway). Do the following in a button: on mouseUp send "set the script of this stack to Virus!" to HyperCard end mouseUp This will bypass your set handler and zero the script of the current stack (make sure it is one you don't care about, or copy the stack script somewhere first) and put the single word "Virus!" in its place. You could just as easily set it to the contents of a variable or field which actually contained a virus. To show how set doesn't work right with the params, try the following to intercept set commands: on set answer the paramCount answer "Set params are:" && the params end set The paramCount will be 0 and the params will contain only the set command itself. Apple explains all this with some comments about the difference between commands and keywords. Personally, I think it is a bug, or at least an anomoly. Bruce Carter, Courseware Development Coordinator Lab: (208) 385-1859 Faculty Development Lab - Room 213 Office: (208) 385-1250 Simplot/Micron Technology Center CompuServe ID: 76666,511 Boise State University CREN (BITNET): duscarte@idbsu 1910 University Drive Internet: duscarte@idbsu.idbsu.edu Boise, ID 83725 --> Preferred: bcarter@claven.idbsu.edu ===============================================================================