Skip to content

💣 Introduction to malware projects, this project will confront you with the principle of self-reproduction - ASM

Notifications You must be signed in to change notification settings

maxisimo/42-Dr-Quine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

72 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

42 logo

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.

Table of Contents

Mandatory part

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.

Colleen

  • 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)

Grace

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

Sully

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.

Compiling

run make

Running

./Colleen
./Grace
./Sully

Bonuses

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.

Prerequies

For the bonuses, this project uses Homebrew and Python. Go check them out if you don't have them locally installed.

Usage

python3 Colleen
python3 Grace
python3 Sully

Useful websites

Rate : 125/100

About

💣 Introduction to malware projects, this project will confront you with the principle of self-reproduction - ASM

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published