These are the standard instructions to build radare2 on Windows, keep reading for alternative methods below.
You can follow the r2book for a more complete guide.
You will need:
- Python 3 with pip3
- Meson and ninja (pip3 install meson)
- Visual Studio 2019 (2015 and 2022 should work too)
The easiest way to build is by using the batch scripts:
preconfigure.bat
configure.bat
make.bat
The first one will setup the python and visual studio in PATH, you only need to run it once per console.
The second will run meson under the hood and create the b
and vs
directories to build using ninja
or visual studio
project.
Finally the make
will run ninja
and create the prefix
directory
containing all the distribution binaries, libraries and support files.
As said, check the prefix\bin
directory and type radare2
Run sys/mingw32.sh
or sys/mingw64.sh
to crosscompile r2 from Linux/macOS
to 32 or 64bit Windows using acr/make
.
The binr/blob
directory contains the program that acts like busybox
but
for r2
. Rename the executable to any of the collection and it will act
accordingly.
This is, a single executable, with no external libraries that you can drop anywhere easily, 3rd party plugins won't work well with it, but it's useful to have in a variety of situations.
Follow the native build instructions and just pass an argument to the second step:
configure.bat static
make.bat
You can also check the CI scripts under .github/workflow
to see the steps
performed to generate the release builds for Windows.
Most notabily there are some 3rd party bugs that we cannot handle and they are workarounded in the environment setup.
- meson have race condition bugs that force you to compile with
ninja -j1
- Some recent versions of pip generate bogus wrapper programs for meson
- Visual Studio 2022 may not be supported out of the box yet
- Python PATH can break over shells, better use pyenv as
preconfigure.bat
does