Leef_me wrote:
If the program downloaded a file doesn't have the matching string, they can't run the program.
Of course, if they can de-compile your program and get the validation code, then they can run the program at will.
If they previously ran the program and the program downloaded a file _does_ have the matching string, they could copy that file and save it for future use. The snippet of code you posted does not show the file deleted if there is a match.
If the match is not based on a ever-changing validate, it would seem easy to duplicate the required file, or even to write-protect the file to prevent it being deleted.
Thanks! I forgot to include my file delete command following the ifnotinstring statement in the code above, so it does delete it regardless of outcome.
Regardless of this though, I still don't see how they could utilize a saved copy of the file since it is still deleted prior to the download.
Quote:
or even to write-protect the file to prevent it being deleted
This I can see as a potential way of getting around my above code. Perhaps I could do this then...
Code:
FileDelete %A_programfiles%\config.txt
IfExist, %A_programfiles%\config.txt
exitapp
URLDownloadToFile,http://..../config.txt, c:\Program Files\config.txt
FileRead,validate,%A_programfiles%\config.txt
ifnotinstring, validate, validationstring
{
FileDelete %A_programfiles%\config.txt
exitapp
}
FileDelete %A_programfiles%\config.txt
Or, perhaps add a random function to the file name.