2
Simple program that produces a hex list of a binary object file
4
@author Bradford W. Mott
5
@version $Id: romtohex.cxx 1908 2009-11-22 02:32:20Z stephena $
13
int main(int ac, char* av[])
19
in.seekg(0, ios::end);
20
int len = (int)in.tellg();
21
in.seekg(0, ios::beg);
23
unsigned char* data = new unsigned char[len];
24
in.read((char*)data, len);
27
cout << "SIZE = " << (len - 2) << endl << " ";
29
// Skip first two bytes; they shouldn't be used
30
for(int t = 2; t < len; ++t)
32
cout << "0x" << setw(2) << setfill('0') << hex << (int)data[t];