-
*.dat file creation
How can I convert a *.bat file in dos into a *.dat file and then get it to activate from my c program.
As it is the *.bat is being ativated by the system() command but I want to encrypt the bat file to a dat file so the user is unable to read it.
Can this be done and how?
-
-
Because the Bat file in question took 2 weeks to write and contains stuff that is secret that I dont want someone else playing with or ripping off.
Can it be done???????????????
-
And the C program should run the code in the dat-file? Why not rewrite the code in C?
-
u could use some sort of file encription in c to encode a .bat file to a .dat then when they run the program it decodes the file runs it then delets it. but depending on how long it takes to exicute or if it gets user input they might be able to read the .bat file still
-
decrypt the file and store it in memory, then run it using the system() command.
-
Eh, just either re-write the thing in C (as was stated), OR...
just whip up a quick program to read in a file, go through the buffer, and add 1 to each slot in the array (excluding newlines, I should think). Then have the program write it back out as a dat file...In your main program, ship the .dat file with it, and have some code to read in the .dat file, decrypt (subtracting 1 to everything), and use a system() call using the decrypted buffer. Don't know if that'd work though, if it doesn't then have it write a temporary decrypted file and run it.