radare2中文版
  • 介绍
  • 历史
  • 框架
  • 下载 radare2
  • 编译和可移植性
  • 在Windows上编译
  • 用户界面
  • 第一步
    • 命令行标志
    • 命令格式
    • 表达式
    • 基本调试器会话
    • 对radare2的贡献
  • 配置
    • 颜色
    • 配置变量
    • Files
  • 基本命令
    • Seeking(寻求)
    • Block Size(区块大小)
    • Sections(分节)
    • Mapping Files(映射文件)
    • Print Modes(打印模式)
    • Flags(标志)
    • Write(写)
    • Zoom(缩放)
    • Yank/Paste(拉伸/粘贴)
    • Comparing Bytes(比较字节)
    • SDB
    • Dietline
  • 视图模式
    • 反汇编
    • 汇编
    • 配置编辑器
    • 面板
  • 搜索字节
    • 基本搜索
    • 配置搜索
    • 正则搜索
    • 自动化
    • 向后搜索
    • 在程序集中搜索
    • 搜索AES密钥
  • 反汇编
    • 添加元数据
    • ESIL
  • 分析
    • 代码分析
    • 变量
    • 类型
    • 调用约定
    • 虚拟表
    • 系统调用
    • 模拟
    • 符号信息
    • 签名
    • 图形命令
  • 脚本
    • 循环
    • 宏
    • R2pipe
  • 调试器
    • 入门
    • 迁移自ida, GDB or WinDBG
    • 寄存器
    • 内存映射
    • 堆
    • Files
    • 反向调试
  • 远程访问
    • 远程GDB
    • 远程WinDbg
  • 命令行工具
    • Rax2(数值转换)
    • Rafind2(查找)
    • Rarun2
    • Rabin2(文件格式)
      • 文件标识
      • 入口
      • 导入
      • 导出
      • 符号 (导出)
      • 库
      • 字符串
      • 程序节
    • Radiff2(比较)
      • Binary Diffing
    • Rasm2(反汇编)
      • 汇编
      • 反汇编
      • 配置
    • Ragg2(C编译器)
      • Language
    • Rahash2(加密算法)
      • Rahash Tool
  • 插件
    • IO 插件
    • 汇编插件
    • 分析插件
    • 二进制插件
    • 其他插件
    • Python插件
    • 调试
    • 测试
    • Packaging
  • Crackmes
    • IOLI
      • IOLI 0x00
      • IOLI 0x01
    • Avatao R3v3rs3 4
      • .radare2
      • .first_steps
      • .main
      • .vmloop
      • .instructionset
      • .bytecode
      • .outro
  • 参考卡
  • 致谢
由 GitBook 提供支持
在本页
  • Prerequisites
  • Step-by-Step
  • Install Visual Studio 2015 (or higher)
  • Install Python 3 and Meson via Conda
  • Install Git for Windows
  • Get Radare2 Code
  • Compile Radare2 Code
  • Check That Radare2 Runs From All Locations

这有帮助吗?

在Windows上编译

上一页编译和可移植性下一页用户界面

最后更新于4年前

这有帮助吗?

Radare2 relies on the Meson build system generator to support compilation on all platforms, including Windows. Meson will generate a Visual Studio Solution, all the necessary project files, and wire up the Microsoft Visual C++ compiler for you.

tip You can download nightly binaries from .

Prerequisites

  • Visual Studio 2015 (or higher)

  • Python 3

  • Meson

  • Git

Step-by-Step

Install Visual Studio 2015 (or higher)

Visual Studio must be installed with a Visual C++ compiler, supporting C++ libraries, and the appropriate Windows SDK for the target platform version.

  • In the Visual Studio 2015 installer, ensure Programming Languages > Visual C++ is selected

  • In the Visual Studio 2017+ installers, ensure the Desktop development with C++ workload is selected

If you need a copy of Visual Studio, the Community versions are free and work great.

Install Python 3 and Meson via Conda

It is strongly recommended you install Conda — a Python environment management system — when working with Python on the Windows platform. This will isolate the Radare2 build environment from other installed Python versions and minimize potential conflicts.

Set Up Conda:

  1. Install Conda with the recommended defaults

Create a Python Environment for Radare2

Follow these steps to create and activate a Conda environment named r2. All instructions from this point on will assume this name matches your environment, but you may change this if desired.

  1. Start > Anaconda Prompt

  2. conda create -n r2 python=3

  3. activate r2

Any time you wish to enter this environment, open the Anaconda Prompt and re-issue activate r2. Conversely, deactivate will leave the environment.

Install Meson

tip All versions of Meson at or below 0.47.1 have a bug that prevent normal use on Windows. Because there's no official release with the fixes available, you must install from sources. The following steps will walk you through this. We will update this documentation as soon as 0.48 is officially released.

  1. Enter the Radare2 Conda environment, if needed (activate r2)

  2. pip install \path\to\downloaded\master.zip

  3. Verify Meson is version 0.48 or higher (meson -v)

Install Git for Windows

Follow these steps to install Git for Windows.

  1. As you navigate the install wizard, we recommend you set these options when they appear:

    • Use a TrueType font in all console windows

    • Use Git from the Windows Command Prompt

    • Use the native Windows Secure Channel library (instead of OpenSSL)

    • Checkout Windows-style, commit Unix-style line endings (core.autocrlf=true)

    • Use Windows' default console window (instead of Mintty)

  2. Close any previously open console windows and re-open them to ensure they receive the new PATH

  3. Ensure git --version works

Get Radare2 Code

Follow these steps to clone the Radare2 git repository.

  1. In your Radare2 Conda environment, navigate to a location where the code will be saved and compiled. This location needs approximately 3-4GiB of space

  2. Clone the repository with git clone https://github.com/radare/radare2.git

Compile Radare2 Code

Follow these steps to compile the Radare2 Code.

Compiled binaries will be installed into the dest folder.

  1. Enter the Radare2 Conda environment

  2. Navigate to the root of the Radare2 sources (cd radare2)

  3. Initialize Visual Studio tooling by executing the command below that matches the version of Visual Studio installed on your machine and the version of Radare2 you wish to install:

    • Visual Studio 2015:

      Note: For the 64-bit version change only the x86 at the very end of the command below to x64.

      "%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86

    • Visual Studio 2017:

      Note 1: Change Community to either Professional or Enterprise in the command below depending on the version installed.

      Note 2: Change vcvars32.bat to vcvars64.bat in the command below for the 64-bit version.

      "%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars32.bat"

    • Visual Studio Preview:

      Note 1: Change Community to either Professional or Enterprise in the command below depending on the version installed.

      Note 2: Change vcvars32.bat to vcvars64.bat in the command below for the 64-bit version.

      "%ProgramFiles(x86)%\Microsoft Visual Studio\Preview\Community\VC\Auxiliary\Build\vcvars32.bat"

  4. Generate the build system with Meson:

    Note 1: Change debug to release in the command below depending on whether the latest version or release version is desired.

    Note 2: If you are using visual studio 2017, you can change swap vs2015 for vs2017.

    meson build --buildtype debug --backend vs2015 --prefix %cd%\dest

    Meson currently requires --prefix to point to an absolute path. We use the %CD% pseudo-variable to get the absolute path to the current working directory.

  5. Start a build:

    Note: Change Debug to Release in the command below depending on the version desired.

    msbuild build\radare2.sln /p:Configuration=Debug /m

    The /m[axcpucount] switch creates one MSBuild worker process per logical processor on your machine. You can specify a numeric value (e.g. /m:2) to limit the number of worker processes if needed. (This should not be confused with the Visual C++ Compiler switch /MP.)

    If you get an error with the 32-bit install that says something along the lines of error MSB4126: The specified solution configuration "Debug|x86" is invalid. Get around this by adding the following argument to the command: /p:Platform=Win32

  6. Install into your destination folder: meson install -C build --no-rebuild

  7. Check your Radare2 version: dest\bin\radare2.exe -v

Check That Radare2 Runs From All Locations

  1. In the file explorer go to the folder Radare2 was just installed in.

  2. From this folder go to dest > bin and keep this window open.

  3. Go to System Properties: In the Windows search bar enter sysdm.cpl.

  4. Go to Advanced > Environment Variables.

  5. Click on the PATH variable and then click edit (if it exists within both the user and system variables, look at the user version).

  6. Ensure the file path displayed in the window left open is listed within the PATH variable. If it is not add it and click ok.

  7. Log out of your Windows session.

  8. Open up a new Windows Command Prompt: type cmd in the search bar. Ensure that the current path is not in the Radare2 folder.

  9. Check Radare2 version from Command Prompt Window: radare2 -v

Download the appropriate Conda (Python 3.x) for your platform ()

Download

All Radare2 code is managed via the Git version control system and .

Download Git for Windows ()

https://bin.rada.re
Download Visual Studio 2015 Community (registration required)
Download Visual Studio 2017 Community
https://conda.io/miniconda.html
https://github.com/mesonbuild/meson/archive/master.zip
hosted on GitHub
https://git-scm.com/download/win