I recently wrote a small management software, joined the video in the initial page logo, just because the company made a graphic, then this is involved in the confidentiality of this video file, but there is nothing, but this small file is simple, But you can't let them take out to advertise, because it is free to provide them. Discuss the confidentiality of the document, and hope that friends who are interested will come to discuss.
Let's take a look at the interface of the software:
Although this software is not big, it is a person who is completed, tired!
For the beginning of the Log, I am going to add directly to the software resources, then read, but helpless, video files read and play don't know much, write, I hope to write this, friends, I hope to introduce the friends who have written this. Personally, write the file to the resource, then read directly in the resource, it may be a good way to confidential. Of course, you need to compress and encrypt using UPX, so that resources will not be read and rewritten by others. .
Abandoning this absolute method, I have to use another aspect, read files on the disk, but if the file is stored directly on the disk, then others are easy to take away, then there is no effect.
Therefore, open the video file, such as Hedit, UltraEdit and other software, add some bits, which is added to the file header, so that the video file header is Destroyed, it will be played directly to open the file directly.
When opening a program, the file will be processed, then remove the number of bits added, then write into a new file, so you can play.
Such as the following code:
Cfile file, nfile; if (file.open ("Data / Tou.PFW", CFile :: ModeReadwrite | cfile :: typebinary == null) // Open the destroyed file {MessageBox ("Did not find video file! "," Wrong ", mb_ok | mb_iconerror); return;} nfile.open (path, cfile :: modecreate | cfile :: modereadwrite | cfile :: typebinary); file.seek (8, cfile :: begin); // Suppose is to add 8 bytes of damage, here is to let come, it is not reading Char t [1024] = {0} before 8 bits; // Due to the size of the birth, it affects computer performance, here Read 1K int N = 0 each time; WHILE (1) // Recycled write {file.seek (8 1024 * n, cfile :: begin); Nfile.seek (1024 * n, cfile :: begin); File.read (T, 1024); Nfile.Write (T, 1024); N ; IF (((N * 1024 1)> 3197441) Break;} file.close (); nfile.close ();
In this way, a new file that has no destruction is formed.
There is also a way to share this Datong, just read the file to the resource, of course, it is also destroyed, then written to disk while running, read playback.
Here, it is also desirable to read and write the resource to show the way to read resources directly and play.