They are binary files that contains nothing readable to a user.
I'll try the first one out.
I would really like to pass several files to a CRC function. I don't know if this one is suitable for use in a DLL. I can modify it to print the output to the correct place later.
Code:
void main(int argc, char *argv[])
{
fstream input;
{
for (argv++; *argv; argv++)
{
input.clear();
input.open(*argv, ios::in | ios::nocreate | ios::binary);
if (!input)
{
cerr << "Could not open " << *argv << "!\n";
}
else
{
cout.setf(ios::hex, ios::basefield);
cout << "File: " << *argv
<< ", CRC-32 : " << getCrc(input) << "\n";
}
input.close();
}
}
}
Code:
unsigned long getCrc(fstream &in)
{
unsigned long crc = 0xffffffff;
unsigned char ch;
int index;
while (in.get(ch))
{
index = ((crc ^ ch) & 0xff);
crc = ((crc >> 8) & 0x00ffffff) ^ crcTable[index];
}
return (crc ^ 0xffffffff);
}
There is also the lookup table but I don't need to post that.