addle_brains
New Member
There's no programming forum, so I'll post here. I'm currently looking into steganography and I wrote a small program in C++, just to see if I could. The program reads in a text file and a BMP file, converts the decimal values of the characters to binary arrays and applies the appropriate operations on them to hide the text data in the bitmap. This part works fine (as far as I can tell with the use of debugging text.) My problem occurs when trying to save the new BMP data to file.
The program makes use of a class called Steg which provides all the necessary functions to do the program. There is a public member function called Run() which handles the whole process. Currently, Run looks like this
void Run() {
std::cout << "Processing...";
FixBMP(); //hides the text data in the BMP
std::cout << "Done!" << std::endl;
std::cout << "Saving...";
SaveToFile(); //saves the new BMP to file.
std::cout << "Done!";
}
When running the program, I get this output
---------------------------
Processing...Done!
---------------------------
Then it stops. No error message or stack overflow or nothing. It just stops there. Now, if I go to the SaveToFile() function and remove the fstream operations and simply fill it with trivial arithmetic or something, the program runs properly. I cannot figure out why the function won't work if I try to open a filestream for output.
Sorry for all the detail, but I want to make sure I cover everything. Any Ideas? Anyone come across this before? I'm using the MinGW compiler with msys.
The program makes use of a class called Steg which provides all the necessary functions to do the program. There is a public member function called Run() which handles the whole process. Currently, Run looks like this
void Run() {
std::cout << "Processing...";
FixBMP(); //hides the text data in the BMP
std::cout << "Done!" << std::endl;
std::cout << "Saving...";
SaveToFile(); //saves the new BMP to file.
std::cout << "Done!";
}
When running the program, I get this output
---------------------------
Processing...Done!
---------------------------
Then it stops. No error message or stack overflow or nothing. It just stops there. Now, if I go to the SaveToFile() function and remove the fstream operations and simply fill it with trivial arithmetic or something, the program runs properly. I cannot figure out why the function won't work if I try to open a filestream for output.
Sorry for all the detail, but I want to make sure I cover everything. Any Ideas? Anyone come across this before? I'm using the MinGW compiler with msys.