CSE 466: Project 3
(File formats on Linux)
Due: Oct 31 2017 (in class, hardcopy).
Projects to be done in groups of two.
File needed in this project are in this ZIP file
A program (compiles under any version of Linux) is in program1.c. It reads from keyboard and prints.
A] Run this program and type in numbers, or strings (include spaces) and observe its output. Vary the length of the string from 1 character to 15 characters.
B] Change the 1 in the 3rd parameter of read() to 4 and observe behavior.
Submit: Write a short explanation on observations and explanations (that is, what can you infer from this program behavior and why does it behave the way it does, which can be sometimes “strange”).
Experiment: Replace read() with gets() and scanf(“%s”…) and see what changes. Do not submit this part.
You are provided with three files, f1, f2 and f3
Do the following:
Write a program to: Read the contents of f1 into an array of integers. Write these integers into a file f4 that contains the integers in binary format. Then read the contents of f4 into another array of integers and compare the two. (Compare manually or via program).
Submit: Provide one/two line printouts of the input and output routines you used for each program. Also state what you observed.
There is a program (psuedocode somewhat) in the file prog-bad.c. This program is not written to be compiled or run, but to be read. Sorry, missing comments.
Find what the vulnerabilities are, and what these vulnerabilities may cause and write a short explanation of what you found.