|
1 year ago | |
---|---|---|
Compilateur @ a72ac5ecba | 1 year ago | |
CrossAssembleur @ a1f0a5cc5a | 1 year ago | |
Interpreteur @ 1b805fca00 | 1 year ago | |
InterpreteurRegistres @ 20a372f29a | 1 year ago | |
Processeur @ e46d1700b3 | 1 year ago | |
.gitignore | 2 years ago | |
.gitmodules | 2 years ago | |
Makefile | 1 year ago | |
ReadMe.md | 1 year ago | |
prog_vulnerable.c | 1 year ago |
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.
- 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)
Security, Secured, BufferOverflow, BOF, Processor, Compiler, FPGA; Basys3.
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.
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
make build WHAT="all"
make build WHAT="compilater"
make build WHAT="interpreter"
make compile WHAT="cross_assembler"
make build WHAT="interpreter_registers"
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)
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
make exec WHAT="interprete" SOURCE="program_file_without_extension"
This will interpret the program_file_without_extension.memasm
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
make exec WHAT="interprete_registers" SOURCE="program_file_without_extension"
This will interpret the program_file_without_extension.regasm
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