Sorry about the 101 questions, thanks for sticking with me :)
I've got a couple of questions
so first off, the program worked as intended it padded my bin file :) and also good news the VBoxManage utility accepted and converted it but... I must be still doing something wrong, maybe I have the wrong settings, I set the hardisk to the output.vdi file from my bin file,
and I get the following error -
https://ibb.co/Sd54XSq
and the more detailed error which is probably more important ( says wrong permissions ? )-
https://ibb.co/DzKGLS3
here are my settings -
https://ibb.co/6t5LczN
I was expecting a constant black screen to be displayed, but instead get an error as the image shows, failed to open a virtual machine session for boot
********* edit I ran VirtualBox as admin and it seems to work !! :) ( I think ), I'm guessing that the vdi file is read only when not running as admin?
anyway so what happens is indeed a black screen is just constantly showing, with a cursor,
does this look right to you? -
https://www.youtube.com/watch?v=332I_fELo3o
sorry about getting so nuanced but what is with the blinking cursor? I thought a black screen would just appear
__________________________________________________________________________________________
the final questions relate to the actual program itself,
first off why does the bin file need to be padded before it can be converted? why isn't 512 bytes sufficient?
now onto the program I understand most of it but a few things I'm not concrete on
so file will take the arguments of the file was passed in, file will be in binary mode, we then resize the vector to the size of file,
I'm guessing
file.read((char *)&data[0], data.size());
will read in and place the data from inside the file into the data vector?
the next line kind of confuses me, we again resize the vector with
data.resize(32 << 20);
why do we left bit shift 32 by 20??
and how does this pad the file with zeros? we didn't explicitly say we want to fill the rest of data with zeros, so all values from data.at(file.tellg()) and upwards to data.resize(32 << 20) will be 0?
1 2 3
|
std::ofstream file(argv[1], std::ios::binary);
file.write((const char *)&data[0], data.size());
| |
this will just write the data from the vector to the file right?
* also that's a pretty neat little program :)