-
Nov 8th, 2018, 03:53 AM
#1
Thread Starter
Fanatic Member
any way for create afile and check it for lock without can duplicate?
hi,i want create a vb exe program like as 1.exe to always check 1.txt in same path and 1.txt is any data.
but important for me to nobody can create like as 1.txt with any way.
if any body deleted 1.txt or created or replace another 1.txt with my 1.txt or with same data so my program can check is same orginal file or not.
i checked md5 algorythms or crc or date modified or created or like these ways but i can not find way yet for this.
how can do that?
-
Nov 12th, 2018, 12:01 PM
#2
Re: any way for create afile and check it for lock without can duplicate?
Hi,
can you describe the end goal more clearly?
What is that file for? Why do you need to lock?
any way for create afile and check it for lock without can duplicate?
Check is another program lock the file? Or make own lock?
The simpliest way:
Code:
Open "c:\temp\1.txt" For Binary Access Read Write Lock Write As #1
https://docs.microsoft.com/en-us/off...open-statement
-
Nov 19th, 2018, 11:59 AM
#3
Thread Starter
Fanatic Member
Re: any way for create afile and check it for lock without can duplicate?
Originally Posted by Dragokas
Hi,
can you describe the end goal more clearly?
What is that file for? Why do you need to lock?
Check is another program lock the file? Or make own lock?
The simpliest way:
Code:
Open "c:\temp\1.txt" For Binary Access Read Write Lock Write As #1
https://docs.microsoft.com/en-us/off...open-statement
me means is a exe file and a file in same path for example 1.txt or 1.dat or any file,but any body can not delete it or edit it or created new with same name or ....
maybe any body can view data in it but i want just use this file like as lock file.
for example contain of 1.txt or 1.dat is :
11111 or 222 or any data (no matter any data)
but important for me is any body can not edit delete or create a file like as 1.txt or 1.dat
for example i want put 1.txt and 1.dat on the my flashdisk and always 1.exe worked or runed on my flash dick only and not work on any other place.(on pc drives or other flash disks)
or i want write 1.exe and 1.dat on cd or dvd and no body can not copy 1.exe and 1.dat on pc (i know i can use illegal size but i dont want use this ways)or on flash disk and if any body did copy on other place so my application not work.(i want test checksum or other way just for lock)
Last edited by Black_Storm; Nov 19th, 2018 at 12:02 PM.
-
Nov 12th, 2018, 02:39 PM
#4
Re: any way for create afile and check it for lock without can duplicate?
Originally Posted by Black_Storm
hi,i want create a vb exe program like as 1.exe to always check 1.txt in same path and 1.txt is any data.
but important for me to nobody can create like as 1.txt with any way.
if any body deleted 1.txt or created or replace another 1.txt with my 1.txt or with same data so my program can check is same orginal file or not.
i checked md5 algorythms or crc or date modified or created or like these ways but i can not find way yet for this.
how can do that?
If you're using the RC5 within your App, you can calculate a current CheckSum of your companion-file at App-Startup like that:
Code:
CheckSumHex = New_c.FSO.GetFileHash(App.Path & "\1.txt", CALG_SHA1)
That would require you, to compile each instance of your Exe specifically though:
- after determining the checksum of your companion-file "as originally delivered"
- to be able to compare that internal checksum-literal later, against the current checksum of that file
In case this is thought as a kind of "simple licensing-scheme", you will have to be aware,
that "skipping that final If-Then-comparison" - is an easy task - even for non-experienced crackers...
Olaf
-
Nov 19th, 2018, 11:53 AM
#5
Thread Starter
Fanatic Member
Re: any way for create afile and check it for lock without can duplicate?
Originally Posted by Schmidt
If you're using the RC5 within your App, you can calculate a current CheckSum of your companion-file at App-Startup like that:
Code:
CheckSumHex = New_c.FSO.GetFileHash(App.Path & "\1.txt", CALG_SHA1)
That would require you, to compile each instance of your Exe specifically though:
- after determining the checksum of your companion-file "as originally delivered"
- to be able to compare that internal checksum-literal later, against the current checksum of that file
In case this is thought as a kind of "simple licensing-scheme", you will have to be aware,
that "skipping that final If-Then-comparison" - is an easy task - even for non-experienced crackers...
Olaf
any way without rc5? i need compatible on xp 7 8 or 10 32 bit or 64bit easy.
can u send a sample source code with 1.txt too?
-
Nov 19th, 2018, 02:54 PM
#6
Re: any way for create afile and check it for lock without can duplicate?
Who will forbid to copy 1.exe from flash-drive when 1.exe is not yet launched?
What is a goal? Software illegal copy protection?
--
actually, against kiddies you could do something like:
Code:
icacls file.exe /grant:r %username%:(GE)
icacls file.exe /deny %username%:(GR,GW)
to block generic read/write
and allow generic execute only.
But in my tests, the system deny object from executing with such DACL.
Last edited by Dragokas; Nov 19th, 2018 at 03:06 PM.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|