https://github.com/jedevc/fyp
My Final Year Project from the University of Birmingham :student:
https://github.com/jedevc/fyp
Last synced: 5 days ago
JSON representation
My Final Year Project from the University of Birmingham :student:
- Host: GitHub
- URL: https://github.com/jedevc/fyp
- Owner: jedevc
- Created: 2020-10-19T13:28:46.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2021-08-31T10:38:27.000Z (almost 5 years ago)
- Last Synced: 2025-10-20T12:43:00.613Z (9 months ago)
- Language: Python
- Homepage:
- Size: 1.61 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Vulnspec
This repository contains the source code and associated tooling for `vulnspec`,
a domain specific programming language for designing pwnable and
reverse-engineering CTF challenges that I designed and built for the Final Year
Project at the University of Birmingham.
For more information, you can see my final writeup [here](https://github.com/jedevc/fyp-report/releases/download/submission/report.pdf).
## Installation
To install the project using pip (use the latest possible version of python 3.x
for best results):
```bash
https://github.com/jedevc/fyp.git
cd fyp
pip install --user .
```
To uninstall the package later (for whatever reason):
```bash
pip uninstall vulnspec
```
## Running
Create a hello world specification:
```
// hello.spec
block main {
puts@libc.stdio("Hello world!")
}
```
To synthesize it:
```bash
vulnspec synth hello.spec hello.c
```
Then to build it:
```bash
vulnspec build hello.c
```
Finally, to run it:
```bash
./hello
```
For more examples, see the `examples/protostar/` directory for adapted versions
of some of the protostar exercises. Or, see `examples/server/` for an example
integration of vulnspec into a minimal CTF platform.
## Development
### Installation in development mode
Install the package again using the following command:
```bash
pip install --user --editable .
```
Changes to the local copy of the code should now be reflected to the
installation.
### Run tests
Integration tests using the examples can be run using pytest:
```bash
pytest
```
### Use the dev scripts
Install the pre-commit git hook:
```bash
./tools/dev/install_hooks.sh
```
Now the code will be checked for formatting, typing and that it passes tests
before allowing a commit.
To autoformat the code:
```bash
./tools/dev/autoformat.sh
```
### Generating data files
Firstly, ensure that libmusl 1.2.1 (available [here](https://musl.libc.org/releases.html))
is download into `../musl-1.2.1`.
To regenerate the libraries:
```bash
PYTHONPATH=./tools python -m builtin_generator vulnspec/data/builtins
```
To regenerate the markov chains:
```
PYTHONPATH=./tools python -m markov_generator ../musl-1.2.1/ > vulnspec/data/markov.json
```