User Tools

Site Tools


notes:discrete:fall2022:projects:bdb0

This is an old revision of the document!


BACKGROUND

In the previous week, we encountered a diversity of errors while developing our codes for the RLE0 encoder and decoder. One of the most frequent errors we found ourselves struggling with was a mismatch between the bytes contained within the files processed by our programs and the sample files. As a way to debug those issues, some of us resorted to comparing the MD5SUMS hashes or the binaries with a hex editor of both files. In other words, we were dependent on other already existing tools to patch our bugs. However, these tools have one flaw they are not specified RLE debugging tools. If only we could find the perfect tool that meets our needs, or better yet, if only we could develop our own debugging tools for an improved RLE algorithm development experience. (I feel like I managed to channel my inner Matt there :P)

Therefore, this week, for bdb0 we are tasked to write a debug tool that will be used in future rleX projects. This debug tool will compare two binary files, one being the output of our encoder/decoder, and the other being some reference file.

SPECIFICATIONS

BDB0 will take two arguments, two different files that will be compared to each other:

./bdb0   FILE1.txt  sample1.txt
Argv[0]  Arg[1]     Arg[2]

These files are not necessarily RLE-specific, you could use bdb0 to compare any files together.

The main focus of this program is to help us compare binaries, displayed in hexadecimal values, similar to a hex editor, only displaying the mismatched data. Hence, the output should be the line byte of discrepancy, along with the previous and following 16 bytes and the address of those bytes

*Our task is to ask questions on Discord or in class and document our findings on this wiki page collaboratively, regarding the functionality of this project.

*For anybody interested in editing the wiki page, here is the dokuwiki user guide: https://www.dokuwiki.org/wiki:syntax#basic_text_formatting -Ash

PROGRAM

OUTPUT SPECIFICATIONS

This is an example of the output of the program:

This is the structure:

The middle line, called mismatch, is the focus of the program, and it should be displayed in a different color with the use of ANSI escape codes.

The group has to come to a consensus on what colors we will use. So far it is required that three parts of the output are displayed in different colors, the addresses (on both sides), the data (both sides), and the mismatched bytes line.

VERIFICATION

notes/discrete/fall2022/projects/bdb0.1662660104.txt.gz · Last modified: 2022/09/08 18:01 by abarbcal