- Installing Haskell Dependecies
- Installing Java and Setting Environment Variables
- Building blaze-platform Monorepo
- Rapid Prototyping with Hspec library
- blaze-platform Versioning
- How To Actually Run flint
- Miscellaneous Build Instructions
First, install the following packages:
sudo apt install build-essential curl libffi-dev libffi8 libgmp-dev libgmp10 libncurses-dev pkg-config zlib1g-devThen, install the script:
curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | shEverything is generally default. However, if you plan on using vscode, make sure you install the Haskell Language Server.
Then, go ahead and refresh your shell:
source ~/.bashrcIn blaze-platform, we use stack for building and testing. Install stack using the ghcup:
ghcup install stackNext, you will need to clone z3:
git clone https://github.com/Z3Prover/z3.gitThen, build and install z3:
cd z3
./configure
mkdir -p build
cd buildNow, install z3:
make installNow, you can install Java 21:
sudo apt install openjdk-21-jdkThen, create environment variables for libjvm.so:
export JDK="$(dirname "$(dirname "$(readlink -f "$(which javac)")")")"
export PATH=$JDK/bin/${PATH:+:$PATH}
export LD_LIBRARY_PATH=$JDK/lib/server/${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}Now, clone blaze-platform:
git clone <repository link>.git
cd blaze-platformFirst, build blaze before anything else:
cd blaze
stack build
stack testNext, cd into ghidra-haskell and create an environment variable for libjvm.so:
export PATH=$JDK/bin/${PATH:+:$PATH}
export LD_LIBRARY_PATH=$JDK/lib/server/${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}Then, go ahead and build inside ghidra-haskell:
make res/ghidra.jar
stack build
stack testFinally, build flint and test everything inside blaze-platform:
cd ..
stack build
stack testYou can quickly add features to blaze, flint, or ghidra-haskell by creating or adding to a *spec*.hs file. This will allow rapid development using Hspec library.
You can find all the *spec*.hs files with the following command below:
find . -iname "*spec*.hs" ! -path "*dist*"You can run all test with stack test. However, its best to just run specific test using the --match flag.
stack test --test-arguments "--match MatcherSpec"blaze-platform versioning uses the format "N.YY.MMDDx" where "N" is the major version (0 before release),
"YY" is the last two digits of the year, "MMDD" is the numerical month and date concatenated, and "x" is the
alphabetical index of the version within the same day. For example, the third version of blaze-platform
before release committed on June 3, 2007 would be "0.07.0603c".
See flint's README.md for instructions on running flint.
The following sections are for developers on MacOS. Also, blaze supported Binary Ninja backend in the past. This was before Ghidra was open source.
- Install the build-essentials stuff from x tools. OSX doesn't have the build-essential package in their repository, but it should automatically prompt the equivalent when trying to download build-essential
- Get Haskell via the install_notes.txt instructions
- Get Homebrew and install openjdk@21. Do not get the oracle version or any other version, if you do you have to remove it
- get the blaze repo
- run getGhidraJar.sh on the ghidra-haskell directory (so your terminal would be ghidra-haskell > ./scripts/getGhidraJar.sh
- run
stack buildandstack testin the ghidra-haskell library