Skip to content
/ efc Public

Check if a binary contains banned functions. This program is made for Epitech student (and can be used in automated CI !)

License

Notifications You must be signed in to change notification settings

Dawoox/efc

Repository files navigation

[EFC] Epitech Banned Function Checker

Screenshot of the program running and detecting a banned function inside a binary.

This tool allow you to check if your binary contains any function banned in your current subject. It was made to be used in an automated CI.

Warning: The program will only run on UNIX systems.

Note: The program is only tested on NixOS.


Dependencies

On Nix systems

Nothing ! Everything is provided by the flake.nix file.

On other systems

Usage

If you don't specify the path to the authorized functions, the program will use the default one: ./bonus/authorized_functions.txt

On Nix systems

nix run github:Dawoox/efc </path/to/your/binary> [/path/to/authorized_functions.txt]

On other systems

python3 ./EpiFunctionChecker/main.py </path/to/your/binary> [/path/to/authorized_functions.txt]

authorized_functions.txt

The file must contain the list of authorized functions, one per line.
For example (from the setting_up project):

open
read
write
close
malloc
free
stat

Each line is treated as a regex expression, so you can ues wildcard to allow a full library.
For example (in the my_hunter project) to include all the CSFML functions:

sf*

Limitations

  • On some projects, the TA authorizes some functions without it being writing on the subject. On the setting_up project for example, the TA authorizes the use of memset without it being written on the subject.
  • We can't provide a trace back to the line where the banned function is used. We can only provide the name of the function (and the address where it is used, but it won't show up in the output).
  • Doesn't work on library file (.a), see this issue
  • CSFML colors need to be added to the authorized_functions.txt file, see this issue

About

Check if a binary contains banned functions. This program is made for Epitech student (and can be used in automated CI !)

Topics

Resources

License

Stars

Watchers

Forks