Works fine if I store the checksum in the registry (say during installation)
and check it at run-time but I don't want to do this.
Question : Anyone know a method of storing the checksum validation in the
.exe. (the problem being that changing the .exe file after the checksum is
generate invalidates the checksum).
Any help appreciated.
Cheers
Paul
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.333 / Virus Database: 187 - Release Date: 08/03/2002
>Question : Anyone know a method of storing the checksum validation in the
>.exe. (the problem being that changing the .exe file after the checksum is
>generate invalidates the checksum).
Hi Paul. Probably the best thing would be to have a
dedicated address in your app where you store the
CRC32 that is excluded from the CRC calculation.
IOW, if you stored the CRC in a global you would
break your CRC calculation routine into 2 parts.
The first would calculate up to the address of
the global. The second would calculate to the
end of the exe from the address of the global
plus the 4 bytes. This way storing the result
in the global won't invalidate it. Also you could
be a bit cagey and move the address of the
global around a bit in different versions of
your program to make it a bit harder to hack
without really changing your CRC calls. This
isn't super hack proof but it's better than say,
sticking the CRC at the end of the exe. Most
people are hip that stuff stuck after the exe
image is ignored by the loader so even a
simple virus might look for that.
Also you might check out the
comp.software.shareware.authors
ng for suggestions and read their
FAQ.
calculated up to the global and then continue the
calculation after the global. So you would have
to break your CRC routine into 2 parts
Mike
--
"Only choice is an oxymoron."
--
This should be simply a matter of appending the checksum bytes to the end of
your executable ... write an application that calculates the CRC of your
executable image and append that to the image ... you can either append a
precorrected CRC that allows for the inclusion of these bytes when the
application validates itself or the application can take into account the
fact that bytes have been appended to the image. This is what we do with
our applications and it is very effective in discouraging piracy ... in our
case ... we also arrange the self deletion of the image if tampering is
detected ... simple - no warnings ... it runs once and then it's gone !
Andrew
http://www.sitecreations.nl/bas/delphi/checksum.zip
just add check to the uses, call checkcrc to find out the exe or dll has
been changed.
to add the correct crc to your program execute addCRC YourApp.exe
hth
Bas Gooijen
"PaulC" <paul.clari...@virgin.net> wrote in message
news:3c8bbf2a_1@dnews...
in article <3c8bcb11_1@dnews>, you wrote:
> in our
> case ... we also arrange the self deletion of the image if tampering is
> detected ... simple - no warnings ... it runs once and then it's gone !
>
one would hope that you warn your legitimate users up front as to this
"side-effect" of, say, playing with the resources in the app.
Followup-To: borland.public.off-topic
--
Regards
Ralph (TeamB)
==
Use Borland servers; TeamB doesn't see posts via ISPs
http://www.borland.com/newsgroups/genl_faqs.html
==
Man soll die Dinge nicht so tragisch nehmen wie sie sind
--Karl Valentin--
Paul
"Bas Gooijen" <bas_g...@yahoo.com> wrote in message
news:3c8be560$1_1@dnews...
Any help would be much appreciated.
Regards
Paul
"PaulC" <paul.clari...@virgin.net> wrote in message
news:3c8d164c$1_2@dnews...
Cheers Paul
"PaulC" <paul.clari...@virgin.net> wrote in message
news:3c8d2f0c_1@dnews...
I was wondering if you could give us a short walk through of how it works.
- Jody
"Bas Gooijen" <bas_g...@yahoo.com> wrote in message
news:3c8be560$1_1@dnews...
The file where the CRC is on:
in the unit check.pas there is a global var, which is initialised on
#0#0#0#0CRCR
this var is changed when you add a crc to the file.
the first 4 bytes become a dword value containing the position (offset ) of
the 8 bytes in the file.
the second 4 bytes contain the actual crc-code.
when you call the checkcrc function, the intire exe-file is loaded into the
memory.
then with the first 4 bytes of the global-8-byte-value you know where it
fysically is located in the file.
in the memory-copy the 8 bytes are replaced with #0#0#0#0CRCR, it now is the
file (in memory) prior to adding the crc.
then the crc is calculated of the memory-copy, this crc is the same value as
the AddCrc function calculates.
the new-crc and the crc stored in the second 4 bytes are compared, if the
same, then the file wasn't altered.
The crc add function:
the file is copied into the memory
the position of the marker (#0#0#0#0CRCR) is determined in a for-loop
the crc of the (unchanged) memory-buffer is calculated.
the first 4 bytes are updated to represent the fysical offset of the marker
in the file.
the second 4 bytes are updated to represent the computed crc.
the memory is written back to the file
btw, the unit can be easily changed to use a diferent hash algoritm (eg.
md5 ) , or use another crc32 library.
as long as it can compute the checksum of a memory-block
Hope this explains it a little
--
Bas Gooijen
"Jody Dawkins" <jo...@shift4.com> wrote in message news:3c8d5c10$1_1@dnews...
the procedure CheckCrcOrAdd thecks if the file is already patched,
if not it does so and terminates the program.
if so it checks, and if wring it terminates the program.
the unit can check exe and libraries ( dll,ocx,...)
and the check can be performed in the initialisation-section
eg.
for exe:
initialisation
if not CheckCrc then halt;
for dll:
initialisation
if not CheckCrc then ExitProcess(0);// the calling exe is terminated also
or you can do something more friendly, like showing a message.
--
Bas Gooijen
"Bas Gooijen" <bas_g...@yahoo.com> wrote in message
news:3c8dcfc6_2@dnews...
Koen
"Andrew Jameson" <con...@softspotsoftware.com> wrote in message
news:3c8bcb11_1@dnews...
<ko...@techwin.be> wrote in message news:3c8f5f24$1_1@dnews...
--
Rick Betting,
Online Software.
ri...@ATonlinegroepDOT.nl
(Remove AT and DOT )
I don't like spammers so send your spam to
ab...@iname.com
"Bas Gooijen" <bas_g...@yahoo.com> schreef in bericht
news:3c8f66a4$1_2@dnews...
> http://groups.google.com/groups?selm=3bfe3ed5_2%40dnews&rnum=2
>
> --
>
> Bas Gooijen
>
>
> <ko...@techwin.be> wrote in message news:3c8f62c4$2_2@dnews...
--
Bas Gooijen
<ko...@techwin.be> wrote in message news:3c8f62c4$2_2@dnews...
Thanks
DGJ
--
Bas Gooijen
"DGJ" <D...@No.Spam-BTINTERNET.com> wrote in message
news:pttu8ugghhr8hhpr1...@4ax.com...