|
This smells of a linked list. See here for pseudo code.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Does anyone have an idea how I can detect if a file has been copied?
I'm trying to develop a simple (hopefully) protection scheme that'll allow me to distribute a license file to a customer, and our application will read the file to update their license.
What I don't want is for the client to be able to copy the license file and 'give' it to another of our customers and avoiding our licensing scheme.
Right now, our application reads the license file and then modifies it so that it's no good any more, so copying it after the fact wouldn't work...I'd like to prevent someone from copying the original un-altered file before it's used.
I've tried to use the GetFileTime() function to get the Creation, LastAccessed, and LastWrite times of the file, but these don't appear to change for a copy of the file.
Any suggestions/ideas?
Steve
|
|
|
|
|
What criteria is used to generate the license in the file (e.g., HDD serial number, MAC address of NIC, license/registration key of Windows)? When the file is copied from one machine to another, check that criteria, compare it to what is in the file. If they do not match, don't allow usage of your software.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
The license file is a simple text file (scrambled so it's not obvious what information is what).
What I want to do is to create the file on my computer and distribute it to customers (on a floppy/CD/Flash Drive). When they run our app (which is not copy protected), it will look for and read the new license file and extract the information from it. It then re-writes the file so it can't be used again.
We do not record any hardware specifics of the installation, so I can't 'key' the license file to a specific machine.
What I'd hoped to do was to record (in the file) the date of it's creation...then, when our app reads the file, it checks the date stamp on the file and if it didn't match, it wouldn't apply the license. Alas, when I make a copy of the license file, all the dates I can find (Creation, Last Accessed, and Last Written) appear to copy too.
Are there any attributes of a copied file that are different from the original that I can use to detect an unauthorized copy?
|
|
|
|
|
I have seen lots of protection schemes, all free ones are (almost) worthless.
The best solutions are:
1. no protection at all (no hassle for the user, no waste of time for the developer; yes you loose some customers who would not have paid for your product anyway);
2. hardware-dependent protection
2a. encode some characteristic (baseboard number, MAC address, disk number) in a license file; disadvantage: lots of hassle; customers don't like their software to stop functioning when they change some hardware, possibly for good reasons.
2b. idem, with server access instead of license file; disadvantage: same plus needs internet every time.
2c. deliver special hardware device (dongle). Costs ca 30$
2d. link to the serial number of a USB stick (best of all these). Still the hassle.
steve76063 wrote: Are there any attributes of a copied file that are different from the original that I can use to detect an unauthorized copy?
There is one: the physical sector number on disk. That is how some programs used to get protected on a floppy or CD. But then you could make binary copies of those disks (before first use).
And good luck if you want your app, run by a non-admin, find out its sector number on modern Windows versions (Vista, 7).
|
|
|
|
|
Well, I may have found what I've been looking for...
Keep in mind, I'm not looking for a foolproof copy protection scheme--there's no such thing. We've used dongles before, but it gets cumbersome--especially when the client's computer already has 4 or 5 other dongles already attached!
I was just looking for a quick simple way to prevent unauthorized copying of my file.
I've found out that when I CreateFile() I can use the FILE_ATTRIBUTE_OFFLINE for the file and it's file icon is a light blue X, and it's Attribute is listed as O. If I copy the file to another location, it loses it's 'O' attribute! I'm can test for the attribute using the GetFileInformationByHandle() and it works just fine.
I'm just trying to deter casual copiers, not dedicated 'crackers', so this should be 'good enough'.
One caveat that I've just discovered is that the Offline attribute is only for NTFS drives, so that leaves out distributing my file via Floppy or CD...it'll have to be an NTFS formatted Flash Drive.
modified on Monday, April 13, 2009 6:21 PM
|
|
|
|
|
|
Hi All
When file is deleted from drive then some where present in hard disk.i want to know where is present in hard disk.Can any one tell me where is present file in hard disk.There is any API or document.
plz help me
|
|
|
|
|
At the file system level, a file does not get moved when it is deleted. The file system simply marks its space as available.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Thanks for reply
How can i get it from Hard disk?Can you give me API?
|
|
|
|
|
No API is available you have to do it to understand File System.
|
|
|
|
|
Here[^] you find some open source project related to File recovery.
Do not trust a computer...
Always check what computer is doing
regards,
Divyang Mithaiwala
Software Engineer
|
|
|
|
|
I have written CDocument derived class's Serialize method to check the version on the archive and throw an exception if it doesn't match. After throwing the exception, the Window title still shows the file name that had an error.
How do I cancel serialization completely and go back to the previous file that was open?
Thank you masters!
|
|
|
|
|
I used the following method to cancel the serializing process:
void CMyAppDoc::Serilize(CArchive &ar)
{
if (
{
ar.abort();
return;
}
}
But it always cause an exception. Any idea?
Thank you masters!
|
|
|
|
|
Hi guz ..
in my project im reading input file from .txt
the file contains has two rows
first row contains A,B,C ans so on, in UPPER mode
second row contains a,b,c ,,, bla bal bla
for exmaple the user input A the program will out put a as well
how i can math this toghther ??
im using two for loops one to hold 1st row
and the other for loop to hold the 2nd row
i tried to output the output was same as format of .txt file
and my question how to input for example A the output will be a?
|
|
|
|
|
As of now, I know that you have a file and a program. If you can rephrase your query to something that we can understand, well, we will reply.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
dr.nokia wrote: in my project im reading input file from .txt
the file contains has two rows
first row contains A,B,C ans so on, in UPPER mode
Do you have something like:
std::ifstream fin;
fin.open("Letters.txt");
std::string strLine;
std::getline(fin, strLine);
std::replace(strLine.begin(), strLine.end(), ',', ' ');
std::stringstream ss(strLine);
std::vector<char> vecUpper;
std::copy(std::istream_iterator<char>(ss), std::istream_iterator<char>(), std::back_inserter(vecUpper));
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Hi,
Is it possible to call a visual studio 2008 dll from VS6.0 dll? I am using VC++.
If you guys have some information regarding this, please let me know.
regards,
Rana
|
|
|
|
|
Yes.
It shouldn't be a problem unless you are mixing Managed and Native terminologies.
You need to google first, if you have "It's urgent please" mentioned in your question.
_AnShUmAn_
|
|
|
|
|
_AnsHUMAN_ wrote: It shouldn't be a problem unless you are mixing Managed and Native terminologies.
What is the problem in mixing managed and native terminologies? Especially given the context of this thread, what else other than using a DLL (COM Interoperability) can be a sensible way to consume something written in managed code, if I am on the native code side?
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
INTEROPERABILITY, nothing else. My guess was that the OP was developing the dll in the managed environment.
You need to google first, if you have "It's urgent please" mentioned in your question.
_AnShUmAn_
|
|
|
|
|
|
Well yes and no. If the VS 2008 DLL used dynamically linked MFC, you will likely have problems. If the VS 2008 DLL dynamically linked to the CRT, I'm not sure what the behavior is if you allocate memory in one and free it in the other.
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
It has nothing to do with the 'DLL' terminology. If I link dynamically to a third party library from a DLL written with VS6 environment, that would depend on the third party library. This does not mean that a DLL written in VS6 will ALWAYS depend on that third party library.
In other words, you are kinda marrying a DLL with what it is linking to. I was pointing out that a DLL is just well, a DLL.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
There are a lot of articles in this website explain the technical of P/Invoke and inter operation between VC and .NET.
|
|
|
|