Skip to content

This C/ASM project explores the principle of self-reproduction through the implementation of a quine, a program that produces a copy of its own source code as output.

Notifications You must be signed in to change notification settings

daisvke/bacteria

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bacteria

Description

This C/ASM project explores the principle of self-reproduction through the implementation of a quine, a program that produces a copy of its own source code as output.
It delves into the challenges associated with self-replicating code and serves as an excellent introduction to more complex topics, including malware development, providing insights into the mechanisms and implications of self-replicating programs.

Features

The project includes both C and ASM versions of the self-replicating program, named bacteria.

Functionality

When executed, the program performs the following actions:

  • It creates a file named bacteria_X.c or bacteria_X.s, where X is an integer defined in the source code.
  • After creating the file, it compiles and runs the newly created program.

Execution Rules

  1. The program stops based on the file name: it executes only if the integer X is greater than or equal to 0.
  2. The integer, initially set to 50, is decremented with each execution, controlling how many iterations the program performs.

Usage

Build and run

  • Build the project using make:
    cd ASM/  # Or cd C/
    make
    ./bacteria

Testing

To test if all generated files are quines (i.e., they produce the same code with only the variable value differing), run:

make test

in the ASM/C directory.

This command will execute the test suite to verify that each generated program correctly replicates its source code, differing only in the index variable.

Screenshots

  1. Before Execution:

No replication has occurred yet. Index is at 50.
2. **After Execution**:

This shows the replicated files created by the program.

About

This C/ASM project explores the principle of self-reproduction through the implementation of a quine, a program that produces a copy of its own source code as output.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published