Reading in hex values from a specific segment and offset.
Hi all,
If I wanted to read in the hex values found at a specific point in a binary file, how would i go about doing this? Would it need to be converted to decimal or binary? This is what ive got so far
Code:
char beh[11];
ifstream updatedat("c:/sol.exe", ios::hex | ios::in);
updatedat.seekg(10,ios::end);
updatedat.read(beh,10);
MessageBox(NULL,beh,"here it is", MB_OK);
updatedat.close();
Im trying to read in 10 hex values and store them in the char array beh. I set seekg to 10 as this is the position that i want to start reading from.
When the MessageBox pops up it shows strange characters where as my hex editor shows it in hex (obviously).
Is the code correct but the problem being the hex stored in the char array? If so then how should i store it to show the actual hex values rather than symbols?
Thanks
Thanks