No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ReadMe.md 3.9KB

Secured processor

This repository gathers the different components allowing to execute a program written in a language derived from C on a processor secured against the hijacking of the execution flow by buffer overflow.

The built and execution process is divided into 5 steps, 3 mandatory and 2 optional.

  • Build the program thanks to the Compilateur module, this will generate a first assembly code without registers.
  • Optional: Interpret this assembly code with the Interpreteur module to check the behaviour of the program.
  • Add registers management into the assembly code with the CrossAssembleur module.
  • Optional: Interpret this assembly code with the InterpreteurRegistres module to check the behaviour of the program
  • Run the program into the processor designed in VHDL

Technologies :

- Development OS : Ubuntu 20.04.4 LTS

- Compilateur (Compiler) : Lex Yacc (flex et bison), C (gcc), Makefile (make)
- Interpreteur (Interpreter) : Lex Yacc (flex et bison), C (gcc), Makefile (make)
- CrossAssembleur (CrossAssembler) : Lex Yacc (flex et bison), C (gcc), Makefile (make)
- InterpreteurRegistres (InterpreterRegisters) : Lex Yacc (flex et bison), C (gcc), Makefile (make)
- Processeur (Processor) : Digilent FPGA Basys3 Artix7, Vivado (2018.2)

Key words :

Security, Secured, BufferOverflow, BOF, Processor, Compiler, FPGA; Basys3.

Usage

To clone the project including submodules, use:

git clone --recurse-submodules https://git.etud.insa-toulouse.fr/pfaure/PSI.git

If you have cloned the repository in the “classic” way, to download submodules use:

git submodule init
git submodule update

A Makefile has been included to simplify build and usage of the project.

Versions

Please note that there are two versions of the project, one with the security implemented, and one without. Be careful to have all modules in the same version. The best way is to use the following commands to change the version:

make secure

or

make unsecure

Building the project

Building the whole project at once:

make build WHAT="all"

Building compiler only:

make build WHAT="compilater"

Building interpreter only:

make build WHAT="interpreter"

Building CrossAssembler only:

make compile WHAT="cross_assembler"

Building interpreter registers only:

make build WHAT="interpreter_registers"

Using the project

Build, crossassemble and load program at once:

make exec WHAT="all" SOURCE="program_file_without_extension"

This will build program_file_without_extension.c, generate the assembly and binary files, and modify the processor code to load the program. (Does not perform the optional steps)

Build program only:

make exec WHAT="compile" SOURCE="program_file_without_extension"

This will build program_file_without_extension.c and generate the memory-oriented assembly file prefixe_file.memasm

Interpret a memory-oriented assembly program:

make exec WHAT="interprete" SOURCE="program_file_without_extension"

This will interpret the program_file_without_extension.memasm

CrossAssemble a memory-oriented assembly program:

make exec WHAT="cross_assemble" SOURCE="program_file_without_extension"

This will transform program_file_without_extension.memasm into program_file_without_extension.regasm adding registers management

Interpret a registers-oriented assembly program:

make exec WHAT="interprete_registers" SOURCE="program_file_without_extension"

This will interpret the program_file_without_extension.regasm

Load binary program into the processor:

make exec WHAT="load" SOURCE="program_file_without_extension"

This will add binary file program_file_without_extension.bin into the processor’s instructions memory