home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!stanford.edu!rutgers!psuvax1!psuvm!jdg111
- From: JDG111@psuvm.psu.edu
- Newsgroups: comp.lang.pascal
- Subject: Re: CRC values in Turbo PASCAL
- Message-ID: <93011.140320JDG111@psuvm.psu.edu>
- Date: 11 Jan 93 19:03:20 GMT
- References: <1993Jan6.202931.6292@cs.unca.edu>
- <1993Jan8.120512.15614dave@tygra.Michigan.COM>
- Organization: Penn State University
- Lines: 14
-
- > Does anyone know how to calculate CRC values in pascal?
-
- If you're attempting to "protect" your program from being hex edited, there
- is a pretty simple way to do it. I recently sat down and wrote a program, call
- ed CRC, which simply reads in a file of type byte, and adds the values of all t
- he bytes into a LONGINT variable. THis longint variable is converted to a 10 d
- igit string, excrypted, and appened to the end of the EXE program that is to be
- protected. The EXE contains code to read all the bytes of itself, and add the
- m up, just like the CRC program. However, it subtracts the last 10 bytes, beca
- use that is the CRC number. It converts the excrypted crc number back into a l
- ongint, and compares it's total with the correct total. If they are off, you'l
- l know. Of course, this method certainly isn't bulletproof, but it helps prote
- ct your code from hacking or cracking. On the other hand, if you were refering
- to actual CRC checks of data over communications lines, sorry, can't help ya.
-