home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / sys / mac / programm / 12910 < prev    next >
Encoding:
Text File  |  1992-07-22  |  2.6 KB  |  59 lines

  1. Newsgroups: comp.sys.mac.programmer
  2. Path: sparky!uunet!mcsun!sunic!kth.se!dront.nada.kth.se!d88-jwa
  3. From: d88-jwa@dront.nada.kth.se (Jon W{tte)
  4. Subject: Re: how to put indelible serial# in resource fork of app?
  5. In-Reply-To: peter@cujo.curtin.edu.au's message of Thu, 23 Jul 1992 02:51:21 GMT
  6. Message-ID: <D88-JWA.92Jul23100813@dront.nada.kth.se>
  7. Followup-To: comp.sys.mac.programmer
  8. Originator: d88-jwa@dront.nada.kth.se
  9. Sender: usenet@kth.se (Usenet)
  10. Nntp-Posting-Host: dront.nada.kth.se
  11. Organization: Royal Institute of Technology, Stockholm, Sweden
  12. References: <Jul.20.17.18.21.1992.16265@gandalf.rutgers.edu>
  13.     <1992Jul20.232738.21376@hobbes.kzoo.edu>
  14.     <peter-230792103333@134.7.50.3>
  15. Date: Thu, 23 Jul 1992 09:08:13 GMT
  16. Lines: 41
  17.  
  18. .50.3> peter@cujo.curtin.edu.au (Peter N Lewis) writes:
  19.  
  20.    ObProgramming: One way to make life difficult for crackers is to use the
  21.    serial number to encryp a code resource - store the user's name, and the
  22.    users serial number in the data fork, display it in the startup dialog, and
  23.    use it to decrypt vital code resources.  Then, checksum the code and if its
  24.    not right, put up an alert - that way, even if the branch is removed the
  25.    program will just crash (serves those nasty crackers right :-).  Of course,
  26.  
  27. Yes. However, BE SURE TO FLUSH THE CACHE after you've decrypted
  28. the CODE resource. something like
  29.     if ( TrapAvailable ( _HwPriv ) ) {
  30.  
  31.         FlushDataCache ( ) ;
  32.         FlushInstructionCache ( ) ;
  33.     }
  34.  
  35.    the virus detectors will probably blow their tops if you go around hacking
  36.    with Code Resources.  Aside from which people will quite probably want to
  37.    run a single copy of the app off a locked file server...  And for heavens
  38.  
  39. No ! the cool thing is, you do this as a patch to GetResource and
  40. LoadResource, so it's only changed when loaded into memory, not
  41. on disk. Or you could load, move high, and lock the CODE resource
  42. and never let go of it; still only affects memory, not disk.
  43.  
  44.    sake turn macsbug name generation off before you compile it!  I have seen
  45.    several commercial apps with names turned on in their code checking code,
  46.    pretty impressive guys :-)
  47.  
  48. I see MacsBug symbols as a user service ! More than once have I had
  49. spontaneous crashes, and only the debugger names helped me figure
  50. out what was going on. Not to mention a dedicated user can provide
  51. excellent feedback for Tech Support if the names still are in there,
  52. like, fixing their bugs :-)
  53.  
  54. -- 
  55.          Jon W{tte, Svartmangatan 18, S-111 29 Stockholm, Sweden
  56.  
  57. ### You have the Easy Access virus. This virus may cause strange sounds.
  58. ### You have the 24-bit virus. This virus eats system memory like CRAZY.
  59.