02-07-2010 05:31 AM
I may need to check the exe file everytime it runs up, in case it has been changed.
May I know how should I start to do it. Thanks.
02-07-2010 11:20 AM - edited 02-07-2010 11:20 AM
Did you try a search?
Review the material posted. If these do not meet your requirements, then post back indicating what your specific needs are.
02-07-2010 12:30 PM
Look in vi.lib\Utility\MD5Checksum.llb
02-07-2010 08:47 PM
The library is great.
I tried to make it in 2 ways, but both seems not work.
1. For example, I have A.exe. Then I check the MD5 value of A.exe. And write another program B.exe to check it. Everytime B.exe will runup first to decide if to runup A.exe.
The problem is the A.exe and B.exe are seperate program. B.exe can be easily ignored.
2. For example, I have A.exe. Then I check the MD5 value of A.exe. And I add some code in A.exe to check the MD5 value and hardcode it. But after I insert the code into A.exe or hardcode the correct value of MD5, the value of MD5 changed. What should I do.
Also, the time of checking a 20M file is a bit long, is there any setting to make it shorter.
Thanks.
02-08-2010 09:16 AM
You will not be able to embed the MD5 checksum of your EXE inside your EXE.
You can dynamically call a LabVIEW VI at runtime from A.EXE using VI Server. This dynamically called VI could contain the MD5 checksum value and perform the comparison to A.EXE, then return the results to A.EXE.
If your EXE is really large, then you could use .NET to perform the MD5 calculation, but your client computer with your compiled A.EXE will need to have .NET installed as well.
I've attached an updated version of an example .NET MD5 vi I wrote some years ago. (LV 8.6)
02-08-2010 09:46 AM
LabVIEW 2009 allows you to add a digital signature to your application, I have never explored this, but I assume this might deal with the issues you are concerned about.
And I doubt it it's easy to adjust a LabVIEW exe and still have the same functionality.
Ton
02-08-2010 08:54 PM
Hi Phillip Brooks,
I have not understand your words 100%. I can make a dynamic call of the code inside A.exe. If put outside, where to save it, in vi or exe format. If put inside, difficult to hardcode the checksum number.
Hi Ton,
May I know where I can find the reference of digital signature.
Thanks.
02-09-2010 03:19 PM
I've attached an example project. You use VI server to dynamically call a VI that performs the MD5 checksum of your EXE.
The checksum VI resides in an LLB in the folder with the EXE, but is not compiled in as part of your EXE. The checksum VI returns a true if the MD5 digest of the EXE matches the value in your checksum VI.
Attached project and files are in LV 8.6.1
02-09-2010 08:32 PM
Thanks for your example.
Finally, all the vi may be compiled into exe for customer usage.
If I cannot compile the checking part and real exe into one, then the checking part can be easily bypassed and they just run the real exe directly. That is what I am worried about.