I have a database dump program that writes out flat files of a table in a very specific format. I now need to test this against our old program and confirm the produced files are identical. Doing this manually is painful, so I need to write some unit tests.

I need to compare two file contents byte by byte, and see the first difference. The issue is they have all manner of crazy bytes with CF/LF/null's etc littered throughout.

Here is a screenshot of the two files fro Scite to give you an idea:

<http://imageshack.us/photo/my-images/840/screenshot1xvt.png/>

What is the best strategy for confirming each byte corresponds?