This small algo project invites you to confront the principle of self-reproduction and the problems that derive from it. It is a perfect introduction to more complex projects, particularly malware projects.
For this project, you will have to recode three different programs, each with different properties. Each programs will have to be coded in C and in Assembly, and respectivly in a folder named C and ASM, each folders containing its own Makefile with the usual rules.
- The executable of the first program must be named Colleen.
- When executed, the program must display on the standard output an output identical to the source code of the file used to compile the program.
- The source code must contain at least :
- A main function.
- Two different comments.
- One of the comments must be present in the main function
- One of the comments must be present outside of your program.
- Another function in addition to the main function (which of course will be called)
For the second program :
- The executable must be named Grace.
- When executed, the program writes in a file named Grace_kid.c/Grace_kid.s the source code of the file used to compile the program.
- The source code must strickly contain
- No main declared.
- Three defines only.
- One comment.
- The program will run by calling a macro
For the last program :
- The executable must be named Sully.
- When executed the program writes in a file named Sully_X.c/Sully_X.s. The X will be an integer given in the source. Once the file is created, the program compiles this file and then runs the new program (which will have the name of its source file).
- Stopping the program depends on the file name : the resulting program will be executed only if the integer X is greater than 0.
- An integer is therefore present in the source of your program and will have to evolve by decrementing every time you create a source file from the execution of the program.
- You have no constraints on the source code, apart from the integer that will be set to 5 at first.
run make
./Colleen
./Grace
./Sully
The only Bonus accepted during p2p is to have redone this project entirely in the language of your choice. I chose to redo it in Python.
For the bonuses, this project uses Homebrew and Python. Go check them out if you don't have them locally installed.
python3 Colleen
python3 Grace
python3 Sully