Guarda copia del fichero original
This commit is contained in:
@@ -74,6 +74,8 @@ void printBuffer()
|
||||
|
||||
int calcChecksum()
|
||||
{
|
||||
saveFile(filePath + ".bak");
|
||||
|
||||
int sum = 0;
|
||||
for (int i = firstByte; i <= lastByte; i++)
|
||||
{
|
||||
@@ -93,10 +95,10 @@ int main(int argc, char *argv[])
|
||||
int sum = calcChecksum();
|
||||
saveFile(filePath);
|
||||
|
||||
cout << hex;
|
||||
cout << "0x" << checksum1 << ": 0x" << static_cast<unsigned>(buffer.at(checksum1)) << endl;
|
||||
cout << "0x" << checksum2 << ": 0x" << static_cast<unsigned>(buffer.at(checksum2)) << endl;
|
||||
cout << "checksum (0x" << firstByte << " .. 0x" << lastByte << "): 0x" << sum << endl;
|
||||
//cout << hex;
|
||||
//cout << "0x" << checksum1 << ": 0x" << static_cast<unsigned>(buffer.at(checksum1)) << endl;
|
||||
//cout << "0x" << checksum2 << ": 0x" << static_cast<unsigned>(buffer.at(checksum2)) << endl;
|
||||
//cout << "checksum (0x" << firstByte << " .. 0x" << lastByte << "): 0x" << sum << endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user