Click here to Skip to main content
15,886,864 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi All,
Im using MFC DLL for saparation of my big project into small small DLL. But problem found when i given set up to a person who has visual studio on his machine.Things goes all right accept one thing ,DLL RESOURCES CAN MODIFIED IN SETUP.
A User that used a set up can open DLL and modified resources as per his reqiurement.and can copy my whole dialog interface into his own project . Its litle bit part of hacking.So i just want to restrict user fom updation and copy of my DLL Resources.Is there is any way or any method that allows me restriction on DLL RESOURNCE UPDATION(SPECIALLY DIALOG).





Thanks and Regard
santosh maruti dhanawade
MFC Programmer
Posted
Updated 15-May-12 19:27pm
v2

1 solution

I would probably approach this in a similar way to the one employed by MS Windows.

That is, I would calculate a hash (lets say MD5 or SHA1) of each file. I would then check the (pre-calculated) valid against one calculated on-the-fly for each file. If the hash doesn't match, don't continue.

The problem with this is two-fold:

1) It removes the functionality of DLLs - i.e you can't update them
2) Someone can still reverse-engineer your code to make sure that the hash comparison is always successful.

One way around this would be to avoid storing the dialog in the resources of a DLL. You could simply load the dialog into ResEdit. This will let you preview the C code required to create that dialog. You can then copy this C code and create the dialog dynamically. This will make it considerably harder for nefarious characters to modify your dialog.

Another way would be use static libs, building all code into your EXE. You could then calculate the MD5 of the whole exe and, if it doesn't match with the pre-calculated md5 you would just exit. - This is tricky, since each modification to your code results in a wildly different md5.

For the second option, there's an article here on CP that talks about "Tamper aware and Self-healing executables" I seem to recall that this solves the problem of calculating the initial md5 of the program. You can read the article here[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900