/poly

A C++ library to build Polymorphic Viruses.

Primary LanguageC++MIT LicenseMIT

Poly

A library to build Polymorphic Viruses.

Table of Contents

  1. About The Project
  2. Getting Started
  3. Example
  4. Documentation

About The Project

This project is made for the thesis of my bachelor's degree in Computer Science. It aims at providing an example of polymorphic virus written in a modern language, and is designed to be "easily" customized and extended.

Built With

This project is built using:

  • LIEF: used to parse and modify different binary formats.
  • AsmJit: used to generate assembly code on the fly.
  • Gulrak Filesystem: used to abstract from the details of different filesystems.
  • Catch2: used for unit testing.

Getting Started

Prerequisites

The code of this project is compatible with Linux, MacOS and Windows (and MinGW), but only on 64 bits systems which run a x86 processor.

Note: on Linux this project is compatible only with system which use ELF as binary format.

Note: this project was tested only on the latest MSVC, GCC and Apple Clang.

It is also required:

  • C++14
  • CMake
  • Git

Configurations

This project uses CMake as build system. The configuration file makes available this options which are turned off by default:

option(POLY_BUILD_TESTING "Build test cases"    OFF)
option(POLY_BUILD_DOC     "Build documentation" OFF)

Building

In order to build the project you need to perform the following steps:

  1. Clone the repo
    git clone https://github.com/gabrielepongelli/poly.git && cd poly
  2. Configure the project using CMake:
    cmake -S . -B ./build -DCMAKE_BUILD_TYPE=Release
  3. Compile the project:
    cmake --build ./build --config Release
    

Note: if compiled with the Debug configuration the virus will be much slower that the one compiled with the Release configuration.

Example

An example of usage of this library can be found here.

Documentation

A detailed documentation of the project' structure can be found here.