-
Delete block from file
Hi to all,
I have a simple problem (question) about C++. I use Windows API functions ReadFile and Write file to "hide" one file in another and then to extract this file. My question is how can I delete the "hidden" file which is exactly a block in the other file? I'm using WindowsXP and Borland C++ Builder 6.0 if this can help.
P.S. If somebody want I can post the source if the program.
-
Read block.. If block == your inserted data skip next step.. Write block.. repeat until end-of-file.
-
Hi,
I didn't understand your solution. Could you explain ...
10x
-
Hellooo,
anybody there ... anybody can help me ?
-
Read up until the block you want to delete, then skip that block, then read and write till EOF, then truncate the file to the new size. Not sure how to do that in windows, so I hope you are.
-
How is the one file 'hidden' in the other? You could, for example, maybe like
Read up until the hidden file. Remember where that point in the file is. Read the hidden file into a buffer. Then read the rest of the file into another buffer. Then seek back to the point where the hidden file was, write the rest of the file buffer to that place, and set the EOF after it.
Edit: If you just don't know the API's and didn't need conceptual stuff I can list those
-
Tonto, Just a heads up but if you notice the date on this thread is flashing which prolly means the user got his/her answer by now. Please take a look at the AO FAQ and enjoy your stay here! :)
-
:eek: Sorry about that. Didn't realize that a lot of these threads are pretty old.
-
Its no prob I was just giving you the heads up so you dont start your time off here in the red by getting negged when you dont have too.