============================================== Project #01 - Decoding a Binary File with DUMP ============================================== - Ian! D. Allen - idallen@idallen.ca - www.idallen.com Updated submission format: Thu Oct 15 11AM EDT 2009 Available online: Wednesday October 7, 2009 Due date in the Blackboard "Assignments" DAT2343_Project_1 upload area: due at 11:45 AM on Tuesday October 20, 2009 Do *not* use the DigitalDropbox to submit your answers. Answers will be posted shortly after the due date/time. Submission method: Via the "Assignments" DAT2343_Project_1 upload. Do *not* use the DigitalDropbox to submit your answers. Due to bugs in Blackboard, you can only submit your Assignment to me *once*. After that, you cannot submit any more times. If you need to re-submit it, you have to ask me to clear your previous submission. Upload "Assignments" file name template: abcd0001_project01.txt Use your own userid, not abcd0001. The rest of the name must be exactly as given. Typing mistakes in the name mean no credit. Be precise. Note: The date of your first midterm test, based largely on the homework questions and this project, is given on the course home page: http://teaching.idallen.com/dat2343/09f/ http://teaching.idallen.org/dat2343/09f/ You can do this project on any machine that has a hexadecimal DUMP utility, similar to those found in Unix/Linux and DOS. The data file to dump will come from your Digital Dropbox. The answers must be submitted via the "Assignments" DAT2343_Project_1 upload. Do *not* use the DigitalDropbox to submit your answers. Note: The project data file is an unprintable, binary format file. It is not printable or viewable on your screen. It will look like garbage in any text editor you might use. Don't print it. Instructions 1. You will be given a data file named abcd0001_project01.bin where abcd0001 is your userid. Each person will have a different file. Save the data file onto your local computer. Make sure that the file is of the correct size on your computer. (See #2, below.) 1b. Rename the file on your computer to have a short MS-DOS 8.3 file name, e.g. MY.BIN - DEBUG will not open long file names. 2. Use a file dump utility (e.g. DOS DEBUG or the Linux "od" command) to display the hexadecimal byte contents of your personal data file. Using your knowledge of data encoding, decode the four 22-byte records in this file into plain ASCII and decimal numbers, following the record format described below. 3. Enter your sixteen answers into a text file in the format described below. Use the format described below for this plain text file. 4. Submit your plain text file for marking, using the correct file name, before the due date using the Blackboard "Assignment" DAT2343_Project_1 upload method. Do *not* use the DigitalDropbox to submit your answers. Use the Assignment area for Project 1. Input File Record Format Each record in your personal data file has the same structure. There are four fixed-length fields in each of the four records: 1. one field of 6 EBCDIC-encoded characters 2. one 32-bit 2's complement field 3. one 32-bit IEEE 754 normalized floating point field 4. one 8 byte field of ASCII characters Adding up the above sizes, you see that each record is 22 bytes long. There are four records in your data file, giving a total file size of 88 bytes. (Make sure your downloaded data file is exactly this big, before you begin!) As implied by the EBCDIC fields, this is an IBM mainframe simulated file in big-endian byte order; as a result, the 2's complement and the floating point fields are not in the reverse byte order you would expect for Intel hardware. The byte order you see in the dump is the byte order you decode. Decode the file into four records with four fields each. Decode the first field of each record into characters; decode the next two numeric fields into ordinary decimal numbers, e.g. -123, 123.456, etc. Decode the last field into plain ASCII text. You will have a total of sixteen fields decoded, which is four records of four fields each. If you can't decode any field(s), use a zero as a place-holder. Output File Format: Record your decoded Answers After you have decoded all sixteen fields in the data file, enter your sixteen answers into a plain text answer file (e.g. using Windows Notepad or Unix/Linux VI). The answer file should contain nothing except your answers. (Do not include an assignment label.) It must be four lines long. Each line should contain four non-blank fields separated by one or more spaces. If you didn't decode some fields, put zeroes into your answer file as place-holders for those undecoded fields. See the example below. Make sure that you don't put spaces in negative numbers between the negative sign and the number. Make sure that all floating-point numbers have no spaces in them. None of the sixteen fields should contain any spaces. For full marks, you must have no extra spaces in your answers. Your file will have this sample format: ABCDEF -2199 -353.042605 ABCDEFGH KHJYbz 1699 499.872105 XBL32rjC MCOUhw 899 -999.185200 WXM31suK 0 -3199 0 UAH22hrI The zeroes are place-holders indicating fields that were not decoded. Submission Method Upload "Assignments" file name template: abcd0001_project01.txt Use your own userid, not abcd0001. The rest of the name must be exactly as given. Typing mistakes in the name mean no credit. Be precise. Upload your answer file, using the correct file name, to the "Assignments" DAT2343_Project_1 upload area. Do *not* use the DigitalDropbox to submit your answers. -- | Ian! D. Allen - idallen@idallen.ca - Ottawa, Ontario, Canada | Home Page: http://idallen.com/ Contact Improv: http://contactimprov.ca/ | College professor (Free/Libre GNU+Linux) at: http://teaching.idallen.com/ | Defend digital freedom: http://eff.org/ and have fun: http://fools.ca/