PureVALID library : check an EXE integrity at runtime

All PureFORM, JaPBe, Libs and useful code maintained by gnozal

Moderator: gnozal

gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

PureVALID library : check an EXE integrity at runtime

Post by gnozal »

PureVALID library

What for ?

PureValid is a library with one function : PureValid_CheckFile(Key.s)

It is intended to check an EXE integrity at runtime, by calculating a fingerprint and comparing it to a validation info located at the end of the EXE.
This validation info is generated by PureValid.exe (included) or PureUPX.

How ?

1. In your application YourApp.pb, only add one line :

  PureValid_CheckFile("YourEncryptionKey")
   or
   Valid = PureValid_CheckFile("YourEncryptionKey")
   ; Valid = 1 if EXE is valid,
   ; 0 if EXE is corrupt (program stops)

2. Compile your application as usual

3. Validate your application with PureValid.exe :

   PureValid YourApp.exe "YourEncryptionKey"

4. It's done. Now if something / someone changes your application, it does not run anymore. Try to change it's name or patch it, and see the result.

Note (1): you can also use PureUPX to validate your application after compressing (+/- scrambling). If the PureValid library is installed, you will see an extra PureValid section when you start PureUPX.

Note (2): it's only an integrity check, without any anti-debugging tricks, so it's a very lame protection against hackers...


Download library:
Only available for Purebasic Windows x86
PB3.94 : http://gnozal.ucoz.com/PureValid.zip
PB4.00-4.10 : http://gnozal.ucoz.com/PureValid_.zip
PB4.20 : http://gnozal.ucoz.com/PureValid___.zip
PB4.3x : http://gnozal.ucoz.com/PureValid_430.zip
PB4.4x : http://gnozal.ucoz.com/PureValid_440.zip
PB4.5x : http://gnozal.ucoz.com/PureValid_450.zip
PB4.6x : http://gnozal.ucoz.com/PureValid_460.zip
PB5.0x : http://gnozal.ucoz.com/PureValid_500.zip

PureUPX :
http://gnozal.ucoz.com/PureUPX.zip
(see viewtopic.php?t=9030)

Other libs and tools at http://gnozal.ucoz.com/
Last edited by gnozal on Tue Aug 18, 2009 11:54 am, edited 11 times in total.
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

Update

What's new : works with PB3.90

(see first post of thread)
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

Update

Changed dynamic array to static array to work with PB3.92
User avatar
GeoTrail
Addict
Addict
Posts: 2794
Joined: Fri Feb 13, 2004 12:45 am
Location: Bergen, Norway
Contact:

Post by GeoTrail »

Cool, great addition to my lib arsenal ;)
I Stepped On A Cornflake!!! Now I'm A Cereal Killer!
User avatar
griz
Enthusiast
Enthusiast
Posts: 167
Joined: Sun Jun 29, 2003 7:32 pm
Location: Canada

Post by griz »

Thanks gnozal!

It would be nice if the help file was a .chm so that Pure Basic would link to it in the IDE... :)
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

griz wrote:It would be nice if the help file was a .chm so that Pure Basic would link to it in the IDE... :)
Well, yes, but the HTML help files work great with jaPBe !
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

Update

Changes :
- added threadsafe version [PB4]
- updated help file
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
jpd
Enthusiast
Enthusiast
Posts: 167
Joined: Fri May 21, 2004 3:31 pm

Post by jpd »

Hi Gnozal,

if I'm use purevalid_check on me program is possible to check the integrity of the file (on the disk) or is possible to create a thread that check all "x second" if the loaded-file in memory integer?

sorry for me english, I hope you understand what I mean.

Thanks
jpd
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

jpd wrote:Hi Gnozal,
if I'm use purevalid_check on me program is possible to check the integrity of the file (on the disk) or is possible to create a thread that check all "x second" if the loaded-file in memory integer?
sorry for me english, I hope you understand what I mean.
PureVALID checks the EXE integrity (on the disk) by calculating a fingerprint and comparing it to a validation info located at the end of the EXE. It does not check the memory.
You can call the function PureValid_CheckFile() whenever you want.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
jpd
Enthusiast
Enthusiast
Posts: 167
Joined: Fri May 21, 2004 3:31 pm

Post by jpd »

Ok,

Thanks Gnozal,


and Thanks for all your nice libraries!

Best
jpd
Brice Manuel

Post by Brice Manuel »

I appreciate the 3.94 support, as I am still using it for most stuff :wink:
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

Update

(PB 4.2x version only)

Changes :
- recompiled with PB 4.20 final and latest tailbite

< EDIT JUN 6 2008 >
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
Gansta93
Enthusiast
Enthusiast
Posts: 238
Joined: Wed Oct 20, 2004 7:16 pm
Location: The Village
Contact:

Post by Gansta93 »

Hello,

It doesn't work on PB 4.30... missing string-extention. :?

Thank you for this lib.
Be seeing you! :-)

Gansta93
If you speak french, you can visite Le Monde de Gansta93 (Gansta93's World)
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

Gansta93 wrote:It doesn't work on PB 4.30... missing string-extention. :?
http://www.purebasic.fr/english/viewtopic.php?t=34534
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
akee
Enthusiast
Enthusiast
Posts: 475
Joined: Wed Aug 18, 2004 9:52 am
Location: Penang, Malaysia

PureValid_500.zip missing...

Post by akee »

Post Reply